Skip to content

fix: autoinclude config path fixes - #6711

Open
denis256 wants to merge 4 commits into
mainfrom
6692-config-path
Open

fix: autoinclude config path fixes#6711
denis256 wants to merge 4 commits into
mainfrom
6692-config-path

Conversation

@denis256

@denis256 denis256 commented Aug 19, 2026

Copy link
Copy Markdown
Member

Description

  • Skip autoinclude-overridden dependency blocks when config_path references absent values.* attributes
  • Handle both "Unsupported attribute" and "Unknown variable" errors during autoinclude merge
  • Add WithSkipLabelsOnError expand option and decodeDependencyBlocksWithAutoIncludeRetry shared helper
  • Add unit tests, a no-autoinclude regression test, and an end-to-end stack integration fixture

Fixes #6692.

TODOs

Read the Gruntwork contribution guidelines.

  • I authored this code entirely myself
  • I am submitting code based on open source software (e.g. MIT, MPL-2.0, Apache)
  • I am adding or upgrading a dependency or adapted code and confirm it has a compatible open source license
  • Update the docs.
  • Update the changelog in the docs.
  • Run the relevant tests successfully, including pre-commit checks.
  • This change is backwards compatible.
  • If this change is not forwards compatible (e.g. a new feature), it is gated behind a feature flag.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed errors when autoincluded dependencies override paths derived from configuration values.
    • Stack generation and planning now succeed when overridden values are undefined.
    • Preserved validation for unrelated unresolved dependencies and missing autoincludes.
  • Documentation
    • Added a v1.1.4 changelog entry describing the dependency path override fix.

@vercel

vercel Bot commented Aug 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
terragrunt-docs Ready Ready Preview Aug 19, 2026 7:44pm

Request Review

@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 5ea94e2f-8b9b-463c-9b4f-d610d63a6f3d

📥 Commits

Reviewing files that changed from the base of the PR and between 970d79c and 77af974.

📒 Files selected for processing (1)
  • pkg/config/config_partial.go

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

Dependency decoding retries with dependency labels overridden by sibling autoincludes skipped during failed expansion. Tests cover unresolved values paths, mixed dependencies, and stack generation. A changelog entry documents the fix.

Changes

Autoinclude dependency override

Layer / File(s) Summary
Skip overridden labels during expansion
pkg/config/hclparse/expansion.go, pkg/config/hclparse/expansion_test.go
Adds WithSkipLabelsOnError. Matching blocks are skipped after decode errors. Other labels still produce errors.
Autoinclude-aware dependency retry
pkg/config/dependency.go, pkg/config/config.go, pkg/config/config_partial.go
Detects dependency labels from sibling autoincludes and retries dependency decoding while skipping overridden labels.
Override regression coverage and fixture
pkg/config/autoinclude_test.go, test/fixtures/stacks/stack-deps-autoinclude-config-path-values/*, test/integration_stack_dependencies_test.go, test/integration_stack_dependencies_tf_test.go, docs/src/data/changelog/v1.1.4/autoinclude-config-path-override.mdx
Adds unit and integration coverage for overridden and unresolved dependencies. Adds a stack fixture and changelog entry.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 77af9

This PR improves autoinclude handling for config-path overrides and adds targeted regression and integration coverage; no actionable merge-blocking risk remains beyond normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant ConfigDecoder
  participant DependencyRetry
  participant AutoInclude
  participant HCLExpansion
  ConfigDecoder->>DependencyRetry: Decode dependencies
  DependencyRetry->>HCLExpansion: Expand dependency blocks
  HCLExpansion-->>DependencyRetry: Report unresolved values path
  DependencyRetry->>AutoInclude: Read overridden dependency labels
  AutoInclude-->>DependencyRetry: Return labels
  DependencyRetry->>HCLExpansion: Retry while skipping labels
  HCLExpansion-->>ConfigDecoder: Return decoded dependencies
Loading

Possibly related PRs

Suggested reviewers: yhakbar

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: fixes for autoinclude dependency config paths.
Description check ✅ Passed The description includes the issue, implementation summary, testing details, documentation updates, and relevant checklist items.
Linked Issues check ✅ Passed The changes satisfy issue #6692 by allowing autoinclude overrides to bypass missing values.* config_path attributes.
Out of Scope Changes check ✅ Passed The code, tests, fixtures, and changelog changes directly support the autoinclude config_path override fix.
Docstring Coverage ✅ Passed Docstring coverage is 90.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 6692-config-path

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.

@denis256
denis256 marked this pull request as ready for review August 19, 2026 17:12
@denis256
denis256 requested a review from yhakbar as a code owner August 19, 2026 17:12
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.

autoinclude fails to override "config_path" parameter if set to attribute of "values" in unit source

1 participant