-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[wip] fix: #4381 remove terragrunt.values.hcl
file when stack no longer has values
provided.
#4428
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
base: main
Are you sure you want to change the base?
[wip] fix: #4381 remove terragrunt.values.hcl
file when stack no longer has values
provided.
#4428
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
📝 WalkthroughWalkthroughThe Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant StackConfig
Caller->>StackConfig: writeValues(values)
alt values is nil
StackConfig->>FileSystem: Open existing values file
alt File exists
StackConfig->>FileSystem: Read first line to check auto-generated comment
alt File is auto-generated
StackConfig->>FileSystem: Remove values file
alt Removal success
StackConfig-->>Caller: Return nil
else Removal error
StackConfig-->>Caller: Return error
end
else File is user-provided
StackConfig->>Logger: Log debug message, skip removal
StackConfig-->>Caller: Return nil
end
else File does not exist
StackConfig->>Logger: Log debug message, skip removal
StackConfig-->>Caller: Return nil
end
else
StackConfig->>FileSystem: Write values file with auto-generated comment
StackConfig-->>Caller: Return result
end
Assessment against linked issues
Suggested reviewers
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (1.64.8)Error: you are using a configuration file for golangci-lint v2 with golangci-lint v1: please use golangci-lint v2 📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (9)
🚧 Files skipped from review as they are similar to previous changes (9)
⏰ Context from checks skipped due to timeout of 90000ms (1)
✨ 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
Documentation and Community
|
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: 0
🧹 Nitpick comments (1)
config/stack.go (1)
756-760
: Minor: avoid joining with empty directoryWhen
directory
is empty,filepath.Join("", valuesFile)
yields a relative path in the CWD.
Consider validatingdirectory
before callingos.Remove
(same as you already do later for the write case) to avoid surprising deletions if the caller passes an empty string by mistake.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
config/stack.go
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.go`: Review the Go code for quality and correctness. Make sure that the Go code follows best practices, is performant, and is easy to understand and maintain.
**/*.go
: Review the Go code for quality and correctness. Make sure that the Go code follows best practices, is performant, and is easy to understand and maintain.
config/stack.go
⏰ Context from checks skipped due to timeout of 90000ms (11)
- GitHub Check: Test (Windows)
- GitHub Check: Test (AWS with Latest Terraform)
- GitHub Check: Test (Fixtures with Latest OSS Terraform)
- GitHub Check: License Check
- GitHub Check: Build (windows/amd64)
- GitHub Check: Test OIDC (GHA AWS)
- GitHub Check: Build (linux/amd64)
- GitHub Check: Test (ubuntu)
- GitHub Check: lint
- GitHub Check: Test (macos)
- GitHub Check: lint
🔇 Additional comments (1)
config/stack.go (1)
761-768
: ```shell
#!/bin/bashVerify the existence of the file and display the relevant lines
if [ -f config/stack.go ]; then
echo "=== config/stack.go: Lines 740-800 ==="
sed -n '740,800p' config/stack.go
else
echo "config/stack.go not found"
fi</details> </blockquote></details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
a7ce857
to
467f8fb
Compare
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.
This is good, but please add a test to confirm we don't regress on this in the future.
467f8fb
to
57dc4f7
Compare
…as `values` provided.
57dc4f7
to
2fa447e
Compare
Should we move this in-draft, then consider closing this out if we merge #4446? It resolves the need to do this check, right? |
agree, let me change the status |
terragrunt.values.hcl
file when stack no longer has values
provided.terragrunt.values.hcl
file when stack no longer has values
provided.
Description
Fixes #4381 remove
terragrunt.values.hcl
file when stack no longer hasvalues
provided.TODOs
Read the Gruntwork contribution guidelines.
Release Notes (draft)
fix: #4381 remove
terragrunt.values.hcl
file when stack no longer hasvalues
provided.Migration Guide
n/a
Summary by CodeRabbit