fix(cli): allow 'secrets list' to work outside the airbyte repo#897
Conversation
Co-Authored-By: AJ Steers <aj@airbyte.io>
🤖 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. 💡 Show Tips and TricksTesting This CDK VersionYou can test this version of the CDK using the following: # Run the CLI from this branch:
uvx 'git+https://github.com/airbytehq/airbyte-python-cdk.git@devin/1770326259-fix-secrets-list-outside-repo#egg=airbyte-python-cdk[dev]' --help
# Update a connector to use the CDK from this branch ref:
cd airbyte-integrations/connectors/source-example
poe use-cdk-branch devin/1770326259-fix-secrets-list-outside-repoPR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
There was a problem hiding this comment.
Pull request overview
This PR fixes the secrets list command to work outside the Airbyte monorepo by avoiding unnecessary directory resolution. The command only needs the connector name to query GCP Secret Manager, not the physical directory location.
Changes:
- Short-circuit directory resolution when a plain connector name is provided (e.g.,
source-postgres) - Path-based resolution (containing
/or\) still falls through to the originalresolve_connector_name_and_directory()function
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📝 WalkthroughWalkthroughThe list secrets command in Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
airbyte-cdk secrets list <connector-name>fails when run outside the airbyte monorepo because thelist_command unnecessarily callsresolve_connector_name_and_directory(), which tries to locate the connector directory on disk. Thelistcommand only needs the connector name (to query GCP Secret Manager), not the directory.This fix short-circuits the directory resolution when a plain connector name string is provided (e.g.
source-postgres), using it directly. Path-based and cwd-based resolution still falls through to the original function.The condition (
"/" not in connector and "\\" not in connector) mirrors the same check inresolve_connector_name_and_directory(line 110 ofconnector_paths.py) for consistency.Review & Testing Checklist for Human
uvx airbyte-cdk[dev] secrets list source-postgresworks from a directory outside the airbyte repo (e.g./tmp)uvx airbyte-cdk[dev] secrets list source-postgresstill works from within the airbyte repouvx airbyte-cdk[dev] secrets list(no connector arg) still gives a sensible error when run outside the repoNotes
fetchcommand intentionally still requires directory resolution since it writes secret files to disksource-ordestination-), but invalid names will simply return no results from GSM, which is already handled gracefullyImportant
Auto-merge enabled.
This PR is set to merge automatically when all requirements are met.
Summary by CodeRabbit
Release Notes
Note
Auto-merge may have been disabled. Please check the PR status to confirm.