Skip to content

fix(cli): allow 'secrets list' to work outside the airbyte repo#897

Merged
Aaron ("AJ") Steers (aaronsteers) merged 1 commit intomainfrom
devin/1770326259-fix-secrets-list-outside-repo
Feb 5, 2026
Merged

fix(cli): allow 'secrets list' to work outside the airbyte repo#897
Aaron ("AJ") Steers (aaronsteers) merged 1 commit intomainfrom
devin/1770326259-fix-secrets-list-outside-repo

Conversation

@aaronsteers
Copy link
Copy Markdown
Member

@aaronsteers Aaron ("AJ") Steers (aaronsteers) commented Feb 5, 2026

Summary

airbyte-cdk secrets list <connector-name> fails when run outside the airbyte monorepo because the list_ command unnecessarily calls resolve_connector_name_and_directory(), which tries to locate the connector directory on disk. The list command 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 in resolve_connector_name_and_directory (line 110 of connector_paths.py) for consistency.

Review & Testing Checklist for Human

  • Verify uvx airbyte-cdk[dev] secrets list source-postgres works from a directory outside the airbyte repo (e.g. /tmp)
  • Verify uvx airbyte-cdk[dev] secrets list source-postgres still works from within the airbyte repo
  • Verify uvx airbyte-cdk[dev] secrets list (no connector arg) still gives a sensible error when run outside the repo

Notes


Open with Devin

Important

Auto-merge enabled.

This PR is set to merge automatically when all requirements are met.

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Simplified connector name input handling in the list secrets command for improved usability. The command now directly accepts plain connector names without requiring full path specifications.

Note

Auto-merge may have been disabled. Please check the PR status to confirm.

@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 5, 2026

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

💡 Show Tips and Tricks

Testing This CDK Version

You 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-repo

PR Slash Commands

Airbyte Maintainers can execute the following slash commands on your PR:

  • /autofix - Fixes most formatting and linting issues
  • /poetry-lock - Updates poetry.lock file
  • /test - Runs connector tests with the updated CDK
  • /prerelease - Triggers a prerelease publish with default arguments
  • /poe build - Regenerate git-committed build artifacts, such as the pydantic models which are generated from the manifest JSON schema in YAML.
  • /poe <command> - Runs any poe command in the CDK environment
📚 Show Repo Guidance

Helpful Resources

📝 Edit this welcome message.

@aaronsteers Aaron ("AJ") Steers (aaronsteers) marked this pull request as ready for review February 5, 2026 21:21
Copilot AI review requested due to automatic review settings February 5, 2026 21:21
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 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 original resolve_connector_name_and_directory() function

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 5, 2026

📝 Walkthrough

Walkthrough

The list secrets command in _secrets.py now checks if the provided connector string contains path separators. If not, it uses the connector value directly as the connector name; otherwise, it resolves the connector name and directory using the existing path resolution logic.

Changes

Cohort / File(s) Summary
Connector Name Derivation
airbyte_cdk/cli/airbyte_cdk/_secrets.py
Updated connector name derivation logic to treat plain connector strings without path separators as direct connector names, falling back to path resolution for complex paths.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: enabling the 'secrets list' command to work outside the airbyte repo by bypassing path resolution for plain connector names.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch devin/1770326259-fix-secrets-list-outside-repo

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 5, 2026

PyTest Results (Fast)

3 855 tests  ±0   3 843 ✅ ±0   6m 32s ⏱️ +5s
    1 suites ±0      12 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 0c4fec3. ± Comparison against base commit 15542de.

@aaronsteers Aaron ("AJ") Steers (aaronsteers) merged commit ef8df7b into main Feb 5, 2026
34 checks passed
@aaronsteers Aaron ("AJ") Steers (aaronsteers) deleted the devin/1770326259-fix-secrets-list-outside-repo branch February 5, 2026 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants