[Bug] SecretsManager get function supports env_var pararmeters.
Tracking issue
Why are the changes needed?
In flytekit secretsManager, it will check whether the secret exist in an env var "
What changes were proposed in this pull request?
Adding env_var pararmeters in secreateManager get function. Initially, secretManager search the secret with following orders.
- "
_ " env - "/etc/secrets/
/ " file In this PR, its order will be - "
_ " env 2 . env_var - "/etc/secrets/
/ " file
How was this patch tested?
make test
os.environ["LOCAL_ENV_VAR"] = "value" assert sec.get(group="group", key="key2", env_var="LOCAL_ENV_VAR") == "value" assert sec.get(key="key", env_var="LOCAL_ENV_VAR") == "value" assert sec.get(env_var="LOCAL_ENV_VAR") == "value"
Setup process
Screenshots
Check all the applicable boxes
- [x] I updated the documentation accordingly.
- [x] All new and existing tests passed.
- [x] All commits are signed-off.
Related PRs
Docs link
Summary by Bito
This PR fixes a bug in SecretsManager by adjusting secret lookup order and adding an optional 'env_var' parameter. It includes renaming and reordering variables in the context_manager module with updated type annotations. The changes enhance reliability and clarity of secret management in flytekit.Unit tests added: True
Estimated effort to review (1-5, lower is better): 1
Thank you for opening this pull request! 🙌
These tips will help get your PR across the finish line:
- Most of the repos have a PR template; if not, fill it out to the best of your knowledge.
- Sign off your commits (Reference: DCO Guide).
Code Review Agent Run Status
- Limitations and other issues: ❌ Failure - The AI Code Review Agent skipped reviewing this change because it is configured to exclude certain pull requests based on the source/target branch or the pull request status. You can change the settings here, or contact the agent instance creator at [email protected].
Code Review Agent Run Status
- Limitations and other issues: ❌ Failure - The AI Code Review Agent skipped reviewing this change because it is configured to exclude certain pull requests based on the source/target branch or the pull request status. You can change the settings here, or contact the agent instance creator at [email protected].
Code Review Agent Run #2389d5
Actionable Suggestions - 1
-
flytekit/core/context_manager.py - 1
- Possible undefined variable reference · Line 433-433
Review Details
-
Files reviewed - 2 · Commit Range:
9503d33..9503d33- flytekit/core/context_manager.py
- tests/flytekit/unit/core/test_context_manager.py
-
Files skipped - 0
-
Tools
- Whispers (Secret Scanner) - ✔︎ Successful
- Detect-secrets (Secret Scanner) - ✔︎ Successful
- MyPy (Static Code Analysis) - ✔︎ Successful
- Astral Ruff (Static Code Analysis) - ✔︎ Successful
Bito Usage Guide
Commands
Type the following command in the pull request comment and save the comment.
/review- Manually triggers a full AI review.
Refer to the documentation for additional commands.
Configuration
This repository uses code_review_bito You can customize the agent settings here or contact your Bito workspace admin at [email protected].
Documentation & Help
Changelist by Bito
This pull request implements the following key changes.
| Key Change | Files Impacted |
|---|---|
| Bug Fix - SecretsManager Bug Fixes |
- |
| Testing - SecretsManager Unit Tests Update |
- |
Code Review Agent Run Status
- Limitations and other issues: ❌ Failure - The AI Code Review Agent skipped reviewing this change because it is configured to exclude certain pull requests based on the source/target branch or the pull request status. You can change the settings here, or contact the agent instance creator at [email protected].
Code Review Agent Run #98d23d
Actionable Suggestions - 0
Review Details
-
Files reviewed - 1 · Commit Range:
9503d33..e74db52- flytekit/core/context_manager.py
-
Files skipped - 0
-
Tools
- Whispers (Secret Scanner) - ✔︎ Successful
- Detect-secrets (Secret Scanner) - ✔︎ Successful
- MyPy (Static Code Analysis) - ✔︎ Successful
- Astral Ruff (Static Code Analysis) - ✔︎ Successful
Bito Usage Guide
Commands
Type the following command in the pull request comment and save the comment.
/review- Manually triggers a full AI review.
Refer to the documentation for additional commands.
Configuration
This repository uses code_review_bito You can customize the agent settings here or contact your Bito workspace admin at [email protected].
Documentation & Help
/review
Code Review Agent Run #f74fd8
Actionable Suggestions - 1
-
flytekit/core/context_manager.py - 1
- Potential undefined variable in error message · Line 435-435
Review Details
-
Files reviewed - 2 · Commit Range:
9503d33..e74db52- flytekit/core/context_manager.py
- tests/flytekit/unit/core/test_context_manager.py
-
Files skipped - 0
-
Tools
- Whispers (Secret Scanner) - ✔︎ Successful
- Detect-secrets (Secret Scanner) - ✔︎ Successful
- MyPy (Static Code Analysis) - ✔︎ Successful
- Astral Ruff (Static Code Analysis) - ✔︎ Successful
Bito Usage Guide
Commands
Type the following command in the pull request comment and save the comment.
/review- Manually triggers a full AI review.
Refer to the documentation for additional commands.
Configuration
This repository uses code_review_bito You can customize the agent settings here or contact your Bito workspace admin at [email protected].
Documentation & Help
/review
Code Review Agent Run #ba9449
Actionable Suggestions - 0
Review Details
-
Files reviewed - 2 · Commit Range:
33820f9..33820f9- flytekit/core/context_manager.py
- tests/flytekit/unit/core/test_context_manager.py
-
Files skipped - 0
-
Tools
- Whispers (Secret Scanner) - ✔︎ Successful
- Detect-secrets (Secret Scanner) - ✔︎ Successful
Bito Usage Guide
Commands
Type the following command in the pull request comment and save the comment.
/review- Manually triggers a full AI review.
Refer to the documentation for additional commands.
Configuration
This repository uses code_review_bito You can customize the agent settings here or contact your Bito workspace admin at [email protected].
Documentation & Help
Code Review Agent Run #21673e
Actionable Suggestions - 0
Review Details
-
Files reviewed - 2 · Commit Range:
33820f9..33820f9- flytekit/core/context_manager.py
- tests/flytekit/unit/core/test_context_manager.py
-
Files skipped - 0
-
Tools
- Whispers (Secret Scanner) - ✔︎ Successful
- Detect-secrets (Secret Scanner) - ✔︎ Successful
Bito Usage Guide
Commands
Type the following command in the pull request comment and save the comment.
/review- Manually triggers a full AI review.
Refer to the documentation for additional commands.
Configuration
This repository uses code_review_bito You can customize the agent settings here or contact your Bito workspace admin at [email protected].
Documentation & Help