Skip to content

fix: Use the appropriate absolute path to unit config file, not basename when checking version constraints - #6728

Open
yhakbar wants to merge 1 commit into
mainfrom
fix/unit-config-path-join-in-version-check
Open

fix: Use the appropriate absolute path to unit config file, not basename when checking version constraints#6728
yhakbar wants to merge 1 commit into
mainfrom
fix/unit-config-path-join-in-version-check

Conversation

@yhakbar

@yhakbar yhakbar commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Description

We use the base name right now, which will under-match. We should be using the full absolute path

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
    • Improved version constraint validation for units discovered before their configuration is parsed.
    • Correctly identifies incompatible Terragrunt versions using the configured file path.
    • Added regression coverage to ensure invalid version constraints return the expected error.

@vercel

vercel Bot commented Aug 21, 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 21, 2026 8:30pm

Request Review

@coderabbitai

coderabbitai Bot commented Aug 21, 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

Run ID: b606c13b-9b1d-4f35-8e72-6cbfad93478e

📥 Commits

Reviewing files that changed from the base of the PR and between 286a33c and 6d74601.

📒 Files selected for processing (2)
  • internal/runner/runnerpool/builder_helpers.go
  • internal/runner/runnerpool/builder_test.go

Included review availability: 4 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


📝 Walkthrough

Walkthrough

The version constraint checker is now exported. It parses unparsed units using unitOpts.TerragruntConfigPath. A regression test verifies that an unsatisfied constraint returns run.InvalidTerragruntVersion.

Changes

Unit version constraint validation

Layer / File(s) Summary
Checker parsing and validation
internal/runner/runnerpool/builder_helpers.go, internal/runner/runnerpool/builder_test.go
CheckUnitVersionConstraints is exported. The checker parses unparsed units from unitOpts.TerragruntConfigPath. The concurrent caller and regression test use the exported checker. The test verifies run.InvalidTerragruntVersion for an unsatisfied constraint.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 6d746

This is a localized correction to use the unit configuration file's absolute path when checking version constraints, with associated tests; no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: denis256

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly describes the main change: using the unit configuration file's absolute path for version-constraint checks.
Description check ✅ Passed The description includes the required sections, explains the path-matching fix, and records the TODO checklist status.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/unit-config-path-join-in-version-check

Comment @coderabbitai help to get the list of available commands.

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

1 participant