Skip to content

Commit d0ba1c5

Browse files
Merge branch 'main' into robots
2 parents 5c26cd3 + a4f808a commit d0ba1c5

194 files changed

Lines changed: 8505 additions & 2544 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/pull_request_template.md

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- Prepend '[WIP]' to the title if this PR is still a work-in-progress. Remove it when it is ready for review! -->
1+
<!-- Keep this PR in draft while it is still a work-in-progress. Mark it as ready for review once it is ready for review by maintainers. -->
22

33
## Description
44

@@ -14,15 +14,7 @@ Read the [Gruntwork contribution guidelines](https://gruntwork.notion.site/Grunt
1414
- [ ] I am submitting code based on open source software (e.g. MIT, MPL-2.0, Apache)
1515
- [ ] I am adding or upgrading a dependency or adapted code and confirm it has a compatible open source license
1616
- [ ] Update the docs.
17+
- [ ] Update the changelog in the docs.
1718
- [ ] Run the relevant tests successfully, including pre-commit checks.
18-
- [ ] Include release notes. If this PR is backward incompatible, include a migration guide.
19-
20-
## Release Notes (draft)
21-
22-
<!-- One-line description of the PR that can be included in the final release notes. -->
23-
Added / Removed / Updated [X].
24-
25-
### Migration Guide
26-
27-
<!-- Important: If you made any backward incompatible changes, then you must write a migration guide! -->
28-
19+
- [ ] This change is backwards compatible.
20+
- [ ] If this change is not forwards compatible (e.g. a new feature), it is gated behind a feature flag.

.github/scripts/release/resolve-version-ref.sh

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
set -euo pipefail
44

55
# Script to resolve the release version and target ref from a
6-
# workflow_dispatch input by looking up the existing draft release.
6+
# workflow_dispatch input by looking up the existing release.
7+
# Works for both draft and published releases so an existing release
8+
# can be rebuilt and clobbered with new assets.
79
#
810
# Usage: resolve-version-ref.sh
911
# Environment variables:
@@ -20,18 +22,11 @@ function main {
2022

2123
# Look up the release to get target_commitish
2224
local release_json
23-
if ! release_json=$(gh release view "$version" --json 'isDraft,targetCommitish' 2>/dev/null); then
25+
if ! release_json=$(gh release view "$version" --json 'targetCommitish' 2>/dev/null); then
2426
echo "ERROR: No release found for version $version" >&2
2527
exit 1
2628
fi
2729

28-
local is_draft
29-
is_draft=$(jq -r '.isDraft' <<<"$release_json")
30-
if [[ "$is_draft" != "true" ]]; then
31-
echo "ERROR: Release $version is already published. Cannot rebuild a published release." >&2
32-
exit 1
33-
fi
34-
3530
local ref
3631
ref=$(jq -r '.targetCommitish' <<<"$release_json")
3732

.github/scripts/release/tests/resolve-version-ref.bats

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ teardown() {
2727

2828
run "$SCRIPT"
2929
[ "$status" -eq 0 ]
30-
grep -q "^version=v1.2.3$" "$GITHUB_OUTPUT"
30+
grep -q "^version=${INPUT_VERSION}$" "$GITHUB_OUTPUT"
3131
grep -q "^ref=${sha}$" "$GITHUB_OUTPUT"
3232
}
3333

@@ -40,12 +40,14 @@ teardown() {
4040
[[ "$output" == *"No release found"* ]]
4141
}
4242

43-
@test "errors if release is already published" {
44-
export GH_STUB_RESPONSE='{"isDraft":false,"targetCommitish":"a1b2c3d4e5f6789012345678901234567890abcd"}'
43+
@test "resolves published release to version + ref" {
44+
local sha="a1b2c3d4e5f6789012345678901234567890abcd"
45+
export GH_STUB_RESPONSE="{\"targetCommitish\":\"${sha}\"}"
4546

4647
run "$SCRIPT"
47-
[ "$status" -ne 0 ]
48-
[[ "$output" == *"already published"* ]]
48+
[ "$status" -eq 0 ]
49+
grep -q "^version=${INPUT_VERSION}$" "$GITHUB_OUTPUT"
50+
grep -q "^ref=${sha}$" "$GITHUB_OUTPUT"
4951
}
5052

5153
@test "fails when INPUT_VERSION missing" {

.github/workflows/sign-macos.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,16 @@ on:
2525
required: false
2626
type: string
2727
default: 'macos-signed-files'
28+
skip-build:
29+
description: 'Skip the internal build job and sign artifacts uploaded earlier in this workflow run'
30+
required: false
31+
type: boolean
32+
default: true
2833

2934
jobs:
3035
build:
3136
name: Build (darwin/${{ matrix.arch }})
32-
if: github.event_name == 'workflow_dispatch'
37+
if: ${{ inputs['skip-build'] != true }}
3338
runs-on: ubuntu-latest
3439
strategy:
3540
matrix:

.github/workflows/sign-windows.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,16 @@ on:
2525
required: false
2626
type: string
2727
default: 'windows-signed-files'
28+
skip_build:
29+
description: 'Skip the internal build job and sign artifacts uploaded earlier in this workflow run'
30+
required: false
31+
type: boolean
32+
default: true
2833

2934
jobs:
3035
build:
3136
name: Build (windows/${{ matrix.arch }})
32-
if: github.event_name == 'workflow_dispatch'
37+
if: ${{ inputs.skip_build != true }}
3338
runs-on: ubuntu-latest
3439
strategy:
3540
matrix:

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ linters:
121121
# trying to get this merged in.
122122
- linters:
123123
- lll
124-
path-except: '^(internal/awshelper/|internal/cas/|internal/cli/commands/(backend/(delete|migrate)|catalog/tui/command|exec|find|help|list|stack)/|internal/cloner/|internal/configbridge/|internal/engine/|internal/errorconfig/|internal/errors/|internal/experiment/|internal/gcphelper/|internal/git/|internal/os/exec/|internal/prepare/|internal/queue/|internal/runner/(common|graph|run/creds)/|internal/stacks/(generate|output)/|internal/tf/cache/(controllers|middleware)/|internal/tflint/|internal/tips/|internal/vfs/|internal/worktrees/|pkg/log/(format/placeholders|writer)/)'
124+
path-except: '^(internal/awshelper/|internal/cas/|internal/cli/commands/(backend/(delete|migrate)|catalog/tui/command|dag/graph|exec|find|help|list|scaffold|stack)/|internal/cloner/|internal/configbridge/|internal/engine/|internal/errorconfig/|internal/errors/|internal/experiment/|internal/gcphelper/|internal/git/|internal/os/exec/|internal/prepare/|internal/queue/|internal/report/|internal/retry/|internal/runner/(common|graph|run/creds|runall|runcfg)/|internal/stacks/(generate|output)/|internal/telemetry/|internal/tf/cache/(controllers|middleware)/|internal/tflint/|internal/tips/|internal/vfs/|internal/worktrees/|pkg/log/(format/(options|placeholders)|writer)/|pkg/options/)'
125125
paths:
126126
- docs
127127
- _ci

docs/src/content/docs/01-getting-started/04-terminology.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ The Run Queue is the queue of all units that Terragrunt will do work on over one
162162

163163
Certain commands like [run --all](/reference/cli/commands/run#all) populate the Run Queue with all units in a stack, while other commands like `plan` or `apply` will only populate the Run Queue with the unit that the command was run in.
164164

165-
Certain flags like [--include-dir](/reference/cli/commands/run#include-dir) can be used to adjust the Run Queue to include additional units. Conversely, there are flags like [--exclude-dir](/reference/cli/commands/run#exclude-dir) that can be used to adjust the Run Queue to exclude units.
165+
The [`--filter`](/features/filter) flag can be used to adjust the Run Queue, including or excluding units based on filter expressions. For example, `--filter './networking'` includes a specific path, while `--filter '!./legacy'` excludes one.
166166

167167
Terragrunt will always attempt to run until the Run Queue is empty.
168168

@@ -213,7 +213,7 @@ By default, Terragrunt will interact with OpenTofu/Terraform in order to retriev
213213

214214
Terragrunt does have the ability to mock outputs, which is useful when dependencies do not yet have outputs to be consumed (e.g. during the run of a unit with a dependency that has not been applied).
215215

216-
Terragrunt also has the ability to fetch outputs without interacting with OpenTofu/Terraform via [--fetch-dependency-output-from-state](/reference/cli/commands/run#fetch-dependency-output-from-state) for dependencies where state is stored in AWS. This is an experimental feature, and more tooling is planned to make this easier to use.
216+
Terragrunt also has the ability to fetch outputs without interacting with OpenTofu/Terraform via [--dependency-fetch-output-from-state](/reference/cli/commands/run#dependency-fetch-output-from-state) for dependencies where state is stored in AWS. This is an experimental feature, and more tooling is planned to make this easier to use.
217217

218218
### Feature
219219

docs/src/content/docs/02-guides/01-terralith-to-terragrunt/08-step-5-adding-terragrunt.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ Group 1
3939
...
4040
`} />
4141

42-
We can also selectively run the plan for the `dev` environment by changing the working directory to `dev`, or using the [`--queue-include-dir`](https://docs.terragrunt.com/reference/cli-options/#queue-include-dir) flag.
42+
We can also selectively run the plan for the `dev` environment by changing the working directory to `dev`, or using the [`--filter`](/features/filter) flag.
4343

4444
<Code title="live/dev" lang="bash" frame="terminal" code={`$ terragrunt plan`} />
4545

46-
<Code title="live" lang="bash" frame="terminal" code={`$ terragrunt run --all --queue-include-dir dev plan
46+
<Code title="live" lang="bash" frame="terminal" code={`$ terragrunt run --all --filter ./dev plan
4747
15:09:17.090 INFO The runner at . will be processed in the following order for command plan:
4848
Group 1
4949
- Unit ./dev

docs/src/content/docs/03-features/02-stacks/03-explicit.mdx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,23 @@ Requirements:
474474
- The `--no-cas` flag must not be set.
475475
- Sources using `update_source_with_cas` must be relative paths within the same repository.
476476

477+
### Local catalog sources
478+
479+
The consumer stack's `source` can be a local filesystem path in addition to a remote Git URL. Both go through the same CAS-backed rewrite pipeline:
480+
481+
```hcl
482+
# live/terragrunt.stack.hcl
483+
stack "service" {
484+
source = "../catalog//stacks/service"
485+
486+
path = "service"
487+
}
488+
```
489+
490+
Terragrunt copies the referenced directory into a temporary directory, computes a content-addressed root hash over `(relative path, mode, file-content hash)` triples using SHA-256, and rewrites nested `source` attributes against that copy. The original directory is never modified, so the catalog on disk stays clean even though the rewritten `source` values need somewhere to live.
491+
492+
This is useful when iterating on a catalog before tagging a release: the same `update_source_with_cas = true` attributes in the catalog's `terragrunt.stack.hcl` and `terragrunt.hcl` files apply unchanged, whether consumers pull the catalog over Git or point at a local checkout.
493+
477494
</Since>
478495

479496
## Known Limitations of Explicit Stacks

docs/src/content/docs/03-features/07-caching/04-cas.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ terraform {
9292

9393
During stack generation, Terragrunt rewrites these relative sources to `cas::` references that point to content stored in the CAS. The repository is cloned once, and subsequent stack generations resolve content from the local store without network access. Generated `.terragrunt-stack` files contain deterministic CAS references instead of version variables, so they do not produce diffs on regeneration.
9494

95+
The catalog source can be either a remote Git URL or a local filesystem path (absolute, or relative to the current working directory). Local sources are copied into a temporary directory before rewriting, so the original catalog directory is never modified. This makes the same catalog layout usable against a published Git ref or a local checkout, which is useful when iterating on a catalog before tagging a release.
96+
9597
For more details on using this with stacks, see [Explicit Stacks: CAS Integration](/features/stacks/explicit#cas-integration).
9698

9799
<Aside type="caution">

0 commit comments

Comments
 (0)