Skip to content

feat: Add glob_file_match option#6341

Open
BhasherBEL wants to merge 1 commit intorunatlantis:mainfrom
BhasherBEL:glob_file_match
Open

feat: Add glob_file_match option#6341
BhasherBEL wants to merge 1 commit intorunatlantis:mainfrom
BhasherBEL:glob_file_match

Conversation

@BhasherBEL
Copy link
Copy Markdown

what

  • Add glob_file_match parameter to project to customize folders discovered by expandProjectGlobs (default to ["*.tf"] if not defined).

Example:

projects:
- dir: a/**/*
  glob_file_match:
  - "*.tf"
  - "terragrunt.hcl"

why

  • Allow expandProjectGlobs to match with folders that doesn't contains .tf files
  • Allow to match terragrunt-only folders

tests

  • Tested with terragrunt-only (["terragrunt.hcl"])
  • Tested with no value (i.e. default)
  • Tested with both (["*.tf", "terragrunt.hcl"])

references

Copilot AI review requested due to automatic review settings March 26, 2026 17:12
@dosubot dosubot bot added feature New functionality/enhancement go Pull requests that update Go code labels Mar 26, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new per-project glob_file_match configuration option to control which files must exist in a matched directory for expandProjectGlobs to include it (defaulting to ["*.tf"]).

Changes:

  • Introduces glob_file_match in raw project config and validates its patterns.
  • Updates glob expansion filtering to look for any matching filename patterns (instead of only .tf).
  • Adds unit/integration tests covering parsing, validation, and glob expansion behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
server/core/config/raw/project.go Adds GlobFileMatch field and validation for glob_file_match.
server/core/config/raw/project_test.go Adds tests for YAML unmarshalling and validation error cases.
server/core/config/parser_validator.go Updates glob expansion to filter directories by matching filenames (default *.tf).
server/core/config/parser_validator_test.go Adds integration test ensuring glob expansion respects glob_file_match and the default behavior.

Signed-off-by: bdubois <bdubois@openanalytics.eu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New functionality/enhancement go Pull requests that update Go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Terragrunt-only folders not found by autoplan

2 participants