-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
bug: discovery parsing errors handling #5037
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?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughEarly deprecation detection was added to partial config parsing to fail fast on deprecated syntax in included configs. Discovery now treats include-only/no-settings parse failures as non-fatal when suppression is enabled. Additional test fixtures and regression tests were added, and minor Path -> Path() refactors applied. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant PartialParseConfig
participant DetectDeprecated
participant Parser
Client->>PartialParseConfig: Request partial parse (included config)
PartialParseConfig->>DetectDeprecated: Check for deprecated syntax
alt deprecated syntax found
DetectDeprecated-->>PartialParseConfig: Return deprecation error
PartialParseConfig-->>Client: Return error (fail fast)
else no deprecated syntax
DetectDeprecated-->>PartialParseConfig: OK
PartialParseConfig->>Parser: Continue parsing/decoding
Parser-->>Client: Return partial config
end
sequenceDiagram
participant Discovery
participant PartialParse
participant ErrorChecker
participant Storage
Discovery->>PartialParse: PartialParse included file
alt PartialParse returns error
PartialParse-->>ErrorChecker: Error
ErrorChecker->>ErrorChecker: containsNoSettingsError(err)?
alt suppression enabled && no-settings error
ErrorChecker->>Discovery: Log debug, treat as non-fatal
Discovery->>Storage: Do not store partial config (skip)
Discovery-->>Client: Continue discovery without this include
else
ErrorChecker-->>Discovery: Propagate error
end
else success
PartialParse-->>Discovery: Store partial config
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 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. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (19)
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. Comment |
internal/discovery/discovery.go
Outdated
| if suppressParseErrors && containsNoSettingsError(err) { | ||
| l.Debugf("Skipping include-only config during discovery: %s", parseOpts.TerragruntConfigPath) | ||
|
|
||
| // Store an empty partial config to avoid nil dereferences in subsequent dependency discovery |
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 odd to me. Why don't we just nil check later?
Description
Before this fix:
After this fix:
Fixes #4983.
TODOs
Read the Gruntwork contribution guidelines.
Release Notes (draft)
Added / Removed / Updated [X].
Migration Guide
Summary by CodeRabbit
Bug Fixes
Tests