-
Notifications
You must be signed in to change notification settings - Fork 14
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
Fix/env load #178
Fix/env load #178
Conversation
- Reverse the condition - Remove sleep as it is redundant in the test file
WalkthroughThe changes involve enhancements to the Changes
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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 (
|
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.
Actionable comments posted: 7
🧹 Outside diff range and nitpick comments (2)
internal/config/env.go (1)
124-128
: Avoid setting environment variables within functionsSetting environment variables inside a function can lead to side effects that are hard to trace and debug. It might be better to return the extracted credentials and let the caller decide how to use them.
Consider refactoring the code to return the credentials as a struct:
func extractDBCredsFromSecret() (*copilotSecrets, error) { // ... existing code ... return secrets, nil }Then, in the calling function, set the necessary environment variables or pass the credentials where needed.
internal/config/env_test.go (1)
Line range hint
399-452
: EnsureexpectedKeyValues
are correctly asserted inloadDbCredsInjectedInLocalEnv
In the function
loadDbCredsInjectedInLocalEnv
, verify that all expected environment variables are correctly set and asserted inexpectedKeyValues
. This ensures that the test fully validates the loading of database credentials in the local environment.Review the
expectedKeyValues
to ensure completeness.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
- internal/config/env.go (3 hunks)
- internal/config/env_test.go (6 hunks)
🔇 Additional comments (1)
internal/config/env.go (1)
61-63
: Use of constantlocalEnvFile
enhances maintainabilityDefining
localEnvFile
as a constant improves code readability and maintainability by avoiding hardcoded strings and making it easier to update the environment identifier in the future.
Closing this PR, as new PR against this will be opened, instead from |
Ticket Link
Related Links
Description
Steps to Reproduce / Test
go test -gcflags=all=-l go-template/internal/config -run TestLoadEnv
Request
Response
Summary by CodeRabbit
New Features
Bug Fixes
Tests