feat(cli): accept dynamic GCP project ID from env var during secrets fetch#545
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces dynamic configuration for the GCP project ID by allowing it to be set via an environment variable for integration tests while also simplifying the CLI command for listing secrets by replacing the separate connector options with a single, optional positional argument.
- Add support for dynamic GCP project ID configuration using the "GCP_PROJECT_ID" env var.
- Update CLI options and help text for both "fetch" and "list" commands to align with recent improvements.
- Replace the dual connector flags with one positional argument in the "secrets list" command.
Comments suppressed due to low confidence (1)
airbyte_cdk/cli/airbyte_cdk/_secrets.py:90
- [nitpick] Consider updating the help text to state that if the
GCP_PROJECT_IDenvironment variable is not set, the default value 'dataline-integration-testing' will be used.
Default to the value of the `GCP_PROJECT_ID` environment variable, if set.
📝 Walkthrough""" WalkthroughThe changes update the handling of the GCP project ID by replacing a hardcoded constant with an environment-variable-driven value. The CLI commands for fetching and listing secrets now use a single optional positional argument for connector identification, and related docstrings and parameter defaults are revised to reflect this new behavior. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI
participant Env
participant GCP
User->>CLI: Run 'fetch' or 'list' command [optional CONNECTOR]
CLI->>Env: Read GCP_PROJECT_ID env var
Env-->>CLI: Return value or None
CLI->>CLI: Set GCP_PROJECT_ID (env or default)
CLI->>CLI: Resolve connector name and directory from argument
CLI->>GCP: Fetch or list secrets using GCP_PROJECT_ID and connector info
GCP-->>CLI: Return secrets data
CLI-->>User: Output secrets
Would you like to see a more detailed breakdown of the connector resolution logic in a separate diagram, or is this overview sufficient for your needs? Wdyt? Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. Note ⚡️ Faster reviews with cachingCodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (8)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Logging here: I successfully tested this locally using the following method.
|
David Gold (dbgold17)
left a comment
There was a problem hiding this comment.
LGTM, one comment
6485afd
into
main
This does a few things:
First, this sets us up to support community-provided "BYO" creds as related to here:
/run-connector-testsslash command and "BYO connector creds" airbyte#60289By setting an env var for
GCP_PROJECT_ID(non-sensitive) along withGCP_GSM_CREDENTIALS(secret), partners and community members can enable integration tests to run in their own forks, without intervention from Airbyte and without needing Airbyte approval for their workflows to run.Also included: this drive-by fix:
secrets listCLI, which is to accept a CONNECTOR positional arg, rather than requiring--connector-nameor--connector-directoryto be set. This brings this CLI command into parity with the other recent updates tosecrets fetch,connector test, and others.Summary by CodeRabbit
New Features
Improvements
listandfetchcommands now accept a single optional positional argument to specify the connector by name or path, simplifying usage.Important
Auto-merge enabled.
This PR is set to merge automatically when all requirements are met.