-
Notifications
You must be signed in to change notification settings - Fork 4.8k
feat(ci): replace hard-to-maintain get-modified-connectors.sh
shell script with Python implementation having built-in tests
#67560
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
base: master
Are you sure you want to change the base?
Conversation
…tion - Replace get-modified-connectors.sh with get_connector_matrix.py - Add support for filtering connectors by certification status (--certified/--no-certified) - Use PEP 723 inline metadata with uv for portable execution - Pin to Python 3.12 for stability - Include doctests for all utility functions (19 tests total) - Add @lru_cache decorated get_manifest_dict() to efficiently cache metadata.yaml reads - Refactor is_java_connector() and is_certified_connector() to use cached manifest reader - Update poethepoet tasks to use new Python script with POSIX-compatible shell wrapper - Add Contributing section to docstring with doctest guidelines The new script maintains full backward compatibility with the original bash script while adding certification filtering capabilities and improved testability. Co-Authored-By: AJ Steers <[email protected]>
Original prompt from AJ Steers
|
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. Helpful Resources
PR Slash CommandsAirbyte Maintainers (that's you!) can execute the following slash commands on your PR:
|
Replace argparse with Typer for more concise and modern CLI definition. - Add typer to PEP 723 inline dependencies - Refactor main() function to use @app.command() decorator - Use typer.Option() for all CLI arguments - Maintain all existing functionality (all 19 doctests pass) - All verification commands work correctly with Typer CLI Co-Authored-By: AJ Steers <[email protected]>
Replace complex bash wrapper with simple cmd passthrough. The get-modified-connectors poe task no longer needs the bash wrapper that conditionally builds command arguments since Typer now handles all CLI parsing. This reduces the task definition from 25 lines to 2 lines. All verification commands pass: - poe get-modified-connectors --json - poe get-modified-connectors --certified --json - poe get-modified-connectors --java --json - poe get-modified-connectors --files-list ... --json Co-Authored-By: AJ Steers <[email protected]>
…s://github.com/airbytehq/airbyte into devin/1759881721-replace-bash-connector-matrix
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.
Pull Request Overview
This PR replaces the bash script get-modified-connectors.sh
with a new Python implementation get_connector_matrix.py
to improve maintainability and add certification filtering capabilities.
- Implements Python script with PEP 723 inline metadata for portable execution
- Adds
--certified
and--no-certified
flags for filtering connectors by support level - Includes comprehensive doctests for all utility functions and LRU caching for metadata parsing
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
poe-tasks/get_connector_matrix.py | New Python implementation with git detection, YAML parsing, filtering logic, and comprehensive doctests |
poe-tasks/repo-root-tasks.toml | Updated task configuration to use new Python script instead of bash script |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
- Fix undefined local_cdk variable bug in get_modified_connectors() - Update all workflow files to use get_connector_matrix.py - Update CLI arg from --json to --json-matrix - Replace references in: - connector-ci-checks.yml (4 references) - build-connector-images-command.yml (1 reference) - cdk-connector-compatibility-test.yml (1 reference) - publish_connectors.yml (1 reference) All tests pass and no references to get-modified-connectors.sh remain. Co-Authored-By: AJ Steers <[email protected]>
get-modified-connectors
shell script with Python implementation using built-in tests
get-modified-connectors
shell script with Python implementation using built-in testsget-modified-connectors
shell script with Python implementation having built-in tests
Co-Authored-By: AJ Steers <[email protected]>
get-modified-connectors
shell script with Python implementation having built-in testsget-modified-connectors
shell script with Python implementation having built-in tests
get-modified-connectors
shell script with Python implementation having built-in testsget-modified-connectors.sh
shell script with Python implementation having built-in tests
Co-Authored-By: AJ Steers <[email protected]>
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.
looks right,
some logistical questions
- as a python noob, how does one run the docstring tests 😅
- and do we want those to be triggered on CI? or is that overkill, and we can just leave it up to people to remember to do it if they edit get_connector_matrix.py
return {} | ||
|
||
|
||
def find_local_cdk_connectors() -> list[str]: |
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.
not a blocker for this PR, but we recently changed how this gets declared >.> so reminder to me to update this method later, I guess
Co-Authored-By: AJ Steers <[email protected]>
Thanks for the review! To answer your questions:
Note: I just pushed a commit to fix the ruff-format issue that was caught by CI on the "tidy code" commit. |
What
Replaces the bash script
get-modified-connectors.sh
with a new Python implementationget_connector_matrix.py
to improve maintainability and add certification filtering capabilities. This script has had a number of issues over the past few months, which take a toll on engineering capacity. This update rewrites the script in poetry, using uv to run the script, and adding doctest tests, which allow each function in the script to have their own inline examples-as-tests.Note:
uv
tool and theuv
-based shebang will bootstrap a compatible python version if none is available. This means callers can directly run the script with no need to pre-install anything besidesuv
itself (brew install uv
). I wrote more about this here: The Modern Ways to (not) Install Python and Virtual Environments - DEV Community./poe-tasks/get_connector_matrix.py --run-tests
to test all functions.Requested by: @aaronsteers
Devin session: https://app.devin.ai/sessions/da08211cf74a4ac5980f874209e7f0ce
How
get_connector_matrix.py
uses PEP 723 inline metadata with uv for portable execution on Python 3.12--certified
and--no-certified
flags to filter connectors by support level@lru_cache
decoratedget_manifest_dict()
function to cache metadata.yaml readsReview guide
poe-tasks/get_connector_matrix.py
- New Python implementationpoe-tasks/repo-root-tasks.toml
- Updated task configurationCritical areas to verify:
User Impact
Positive:
poe get-modified-connectors
)--certified
,--no-certified
)Potential negative:
Can this PR be safely reverted and rolled back?
The original bash script still exists and the poethepoet task can be easily reverted to use it. No breaking changes to the external API.