-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ci) Run codeflash in on PRs modifying the Python CDK #44427
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
airbyte-cdk/python/pyproject.toml
Outdated
@@ -114,3 +115,10 @@ optional_poetry_groups = ["dev"] | |||
poetry_extras = ["file-based", "sphinx-docs", "vector-db-based"] | |||
poe_tasks = ["check-ci"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would ideally recommend adding poetry run code flash
as a poe task and add this poe task here
poe_tasks = ["check-ci"] | |
poe_tasks = ["check-ci", "codeflash"] | |
required_env_variables = ["CODEFLASH_API_KEY", "CODEFLASH_PR_NUMBER"] |
This would prevent the introduction of a new GHA workflow and make codeflash run on the listed python_versions
.
You'd need to set the env vars in the GHA workflow here
This reverts commit 2ea1e1f.
@@ -149,6 +152,7 @@ runs: | |||
SLACK_WEBHOOK: ${{ inputs.slack_webhook_url }} | |||
SPEC_CACHE_BUCKET_NAME: ${{ inputs.spec_cache_bucket_name }} | |||
SPEC_CACHE_GCS_CREDENTIALS: ${{ inputs.spec_cache_gcs_credentials }} | |||
CODEFLASH_API_KEY: ${{ inputs.codeflash_api_key }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alafanechere am I missing something obvious here? After moving from a custom GHA to airbyte-ci, the workflow is failing because it can't access the CODEFLASH_API_KEY
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you're missing one last change: the thing that would make airbyte-ci
set this env var on the docker container running the poe task.
It has to be defined in [tool.airbyte-ci]
in the pyproject.toml
file. I'll add a suggestion comment below.
@@ -149,6 +152,7 @@ runs: | |||
SLACK_WEBHOOK: ${{ inputs.slack_webhook_url }} | |||
SPEC_CACHE_BUCKET_NAME: ${{ inputs.spec_cache_bucket_name }} | |||
SPEC_CACHE_GCS_CREDENTIALS: ${{ inputs.spec_cache_gcs_credentials }} | |||
CODEFLASH_API_KEY: ${{ inputs.codeflash_api_key }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you're missing one last change: the thing that would make airbyte-ci
set this env var on the docker container running the poe task.
It has to be defined in [tool.airbyte-ci]
in the pyproject.toml
file. I'll add a suggestion comment below.
Co-authored-by: Augustin <augustin@airbyte.io>
for i in range(len(arr)): | ||
# This is a diff | ||
for j in range(len(arr) - 1): | ||
if arr[j] > arr[j + 1]: | ||
temp = arr[j] | ||
arr[j] = arr[j + 1] | ||
arr[j + 1] = temp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for i in range(len(arr)): | |
# This is a diff | |
for j in range(len(arr) - 1): | |
if arr[j] > arr[j + 1]: | |
temp = arr[j] | |
arr[j] = arr[j + 1] | |
arr[j + 1] = temp | |
arr.sort() |
⚡️ Codeflash found optimizations for this PR📄
|
wil refactor into using airbyte-ci separately
/approve-and-merge reason="adding a new non-required github action" |
What
Adds a github action running Codeflash on PRs modifying the Python CDK.
Codeflash will inspect the new code and provide suggestions to improve the performance.
The github action is not required to complete before merging. There is no requirement for updating the code as per Codeflash's suggestions.
For reference:
The goal is to try the tool and see if it can provide value by suggesting performance improvement as we go.
This PR is built on top of this PR adding codeflash to the CDK.
I can integrate with airbyte-ci as a follow up step but I want to get this in ASAP so we can try the tool.
Code review guide
The main thing I want to make sure is the GHA has the right security filters.
User Impact
There should be no user impact.
Can this PR be safely reverted and rolled back?