Skip to content
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

Merged
merged 20 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/actions/run-airbyte-ci/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ inputs:
s3_build_cache_secret_key:
description: "Gradle S3 Build Cache AWS secret key"
required: false
codeflash_api_key:
description: "Codeflash API key"
required: true
airbyte_ci_binary_url:
description: "URL to airbyte-ci binary"
required: false
Expand Down Expand Up @@ -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 }}
Copy link
Contributor Author

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.

Copy link
Contributor

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.

girarda marked this conversation as resolved.
Show resolved Hide resolved
with:
shell: bash
max_attempts: ${{ inputs.max_attempts }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/airbyte-ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ jobs:
git_revision: ${{ steps.fetch_last_commit_id_pr.outputs.commit_id }}
github_token: ${{ secrets.GH_PAT_MAINTENANCE_OSS }}
sentry_dsn: ${{ secrets.SENTRY_AIRBYTE_CI_DSN }}
codeflash_api_key: ${{ secrets.CODEFLASH_API_KEY }}
subcommand: "test --modified"

- name: Run poe tasks for requested internal packages [WORKFLOW DISPATCH]
Expand All @@ -106,4 +107,5 @@ jobs:
git_revision: ${{ steps.fetch_last_commit_id_pr.outputs.commit_id }}
github_token: ${{ secrets.GH_PAT_MAINTENANCE_OSS }}
sentry_dsn: ${{ secrets.SENTRY_AIRBYTE_CI_DSN }}
codeflash_api_key: ${{ secrets.CODEFLASH_API_KEY }}
subcommand: "test ${{ inputs.airbyte_ci_subcommand}}"
12 changes: 12 additions & 0 deletions airbyte-cdk/python/airbyte_cdk/bubble_sort.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright (c) 2024 Airbyte, Inc., all rights reserved.


def sorter(arr):
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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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()

return arr
Loading
Loading