Skip to content
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

fix: change detection of Terragrunt module source. #1971

Merged
merged 3 commits into from
Nov 27, 2024

Conversation

i4ki
Copy link
Contributor

@i4ki i4ki commented Nov 26, 2024

What this PR does / why we need it:

Fix the Terragrunt change detection for the case the terraform.source references a local directory.

Which issue(s) this PR fixes:

Fixes #1959

Special notes for your reviewer:

Does this PR introduce a user-facing change?

yes, fixes a bug.

@i4ki i4ki requested a review from a team as a code owner November 26, 2024 10:07
@i4ki i4ki force-pushed the i4k-fix-tg-change-detection branch from fa12337 to 8698c3c Compare November 26, 2024 10:09
Copy link

github-actions bot commented Nov 26, 2024

2024/11/27 16:52:08 Terraform detected version: 1.9.8
toolsetPath: /tmp/cmd-terramate-test-3379726002
=== RUN   TestInteropCloudSyncPreview
=== RUN   TestInteropCloudSyncPreview/preview:_basic-drift
    interoperability_test.go:46: using GITHUB_EVENT_FILE=/home/runner/work/_temp/_github_workflow/event.json
=== RUN   TestInteropCloudSyncPreview/preview:_basic-drift-uppercase-id
    interoperability_test.go:46: using GITHUB_EVENT_FILE=/home/runner/work/_temp/_github_workflow/event.json
--- PASS: TestInteropCloudSyncPreview (11.84s)
    --- PASS: TestInteropCloudSyncPreview/preview:_basic-drift (6.28s)
    --- PASS: TestInteropCloudSyncPreview/preview:_basic-drift-uppercase-id (5.56s)
=== RUN   TestInteropSyncDeployment
=== RUN   TestInteropSyncDeployment/deployment:_empty
=== RUN   TestInteropSyncDeployment/deployment:_empty-uppercase-id
--- PASS: TestInteropSyncDeployment (39.06s)
    --- PASS: TestInteropSyncDeployment/deployment:_empty (19.95s)
    --- PASS: TestInteropSyncDeployment/deployment:_empty-uppercase-id (19.11s)
=== RUN   TestInteropDrift
=== RUN   TestInteropDrift/drift:_basic-drift
=== RUN   TestInteropDrift/drift:_basic-drift-uppercase-id
--- PASS: TestInteropDrift (63.20s)
    --- PASS: TestInteropDrift/drift:_basic-drift (32.30s)
    --- PASS: TestInteropDrift/drift:_basic-drift-uppercase-id (30.90s)
PASS
ok  	github.com/terramate-io/terramate/e2etests/cloud/interop	125.722s

Copy link

github-actions bot commented Nov 26, 2024

Preview of ubuntu-focal/go1.21 tests in 906c955

🔍 View Details on Terramate Cloud

.
stack
test
tg

Copy link

github-actions bot commented Nov 26, 2024

Preview of macos-ventura/go1.21 tests in 906c955

🔍 View Details on Terramate Cloud

.
stack
test
tg

Copy link

github-actions bot commented Nov 26, 2024

metric: time/op
ChangeDetection-4: old 4.07ms ± 5%: new 3.96ms ± 9%: delta: -2.70%
ChangeDetectionTFAndTG-4: old 12.9ms ± 3%: new 12.8ms ± 2%: delta: 0.00%
CloudReadLines-4: old 1.00ms ± 6%: new 0.99ms ± 4%: delta: 0.00%
CloudReadLine-4: old 7.32ms ± 1%: new 7.36ms ± 1%: delta: 0.50%
ListFiles-4: old 86.5µs ± 1%: new 86.4µs ± 1%: delta: 0.00%
Generate-4: old 1.53s ± 3%: new 1.54s ± 3%: delta: 0.00%
GenerateRegex-4: old 1.06s ± 4%: new 1.05s ± 3%: delta: 0.00%
TokensForExpressionComplex-4: old 1.25ms ± 0%: new 1.25ms ± 0%: delta: 0.11%
TokensForExpressionPlainStringNoNewline-4: old 784ns ± 0%: new 787ns ± 1%: delta: 0.38%
TokensForExpressionStringWith100Newlines-4: old 23.6µs ± 1%: new 23.6µs ± 1%: delta: 0.00%
TokensForExpressionObjectWith100KeysWithNumberValues-4: old 1.44ms ± 0%: new 1.44ms ± 1%: delta: 0.00%
TokensForExpression-4: old 1.25ms ± 0%: new 1.25ms ± 0%: delta: 0.11%
PartialEvalComplex-4: old 535µs ± 1%: new 538µs ± 2%: delta: 0.61%
PartialEvalSmallString-4: old 3.91µs ± 0%: new 3.88µs ± 1%: delta: -0.83%
PartialEvalHugeString-4: old 1.90ms ± 1%: new 1.91ms ± 1%: delta: 0.00%
PartialEvalHugeInterpolatedString-4: old 4.88ms ± 1%: new 4.91ms ± 1%: delta: 0.57%
PartialEvalObject-4: old 26.4µs ± 1%: new 26.4µs ± 1%: delta: 0.00%
TmAllTrueLiteralList-4: old 615µs ± 0%: new 615µs ± 0%: delta: 0.00%
TmAllTrueFuncall-4: old 20.1µs ± 0%: new 20.1µs ± 0%: delta: 0.00%
TmAnyTrueLiteralList-4: old 4.84ms ± 1%: new 4.85ms ± 1%: delta: 0.00%
TmAnyTrueFuncall-4: old 20.5µs ± 1%: new 20.5µs ± 1%: delta: 0.00%
TmTernary-4: old 2.52µs ± 0%: new 2.52µs ± 1%: delta: 0.22%
TmTryUnknownFunc-4: old 2.27µs ± 0%: new 2.29µs ± 1%: delta: 0.81%
TmTryUnknownVariable-4: old 2.18µs ± 0%: new 2.19µs ± 1%: delta: 0.69%
TmTryUnknownObjectKey-4: old 2.49µs ± 0%: new 2.50µs ± 0%: delta: 0.70%
metric: alloc/op
ChangeDetection-4: old 353kB ± 0%: new 353kB ± 0%: delta: 0.00%
ChangeDetectionTFAndTG-4: old 4.80MB ± 0%: new 4.81MB ± 0%: delta: 0.07%
CloudReadLines-4: old 3.12MB ± 0%: new 3.12MB ± 0%: delta: 0.00%
CloudReadLine-4: old 3.37MB ± 0%: new 3.37MB ± 0%: delta: 0.00%
ListFiles-4: old 27.6kB ± 0%: new 27.6kB ± 0%: delta: 0.00%
Generate-4: old 2.24GB ± 0%: new 2.24GB ± 0%: delta: 0.00%
GenerateRegex-4: old 926MB ± 0%: new 926MB ± 0%: delta: 0.00%
TokensForExpressionComplex-4: old 394kB ± 0%: new 394kB ± 0%: delta: 0.00%
TokensForExpressionPlainStringNoNewline-4: old 512B ± 0%: new 512B ± 0%: delta: 0.00%
TokensForExpressionStringWith100Newlines-4: old 12.5kB ± 0%: new 12.5kB ± 0%: delta: 0.00%
TokensForExpressionObjectWith100KeysWithNumberValues-4: old 395kB ± 0%: new 395kB ± 0%: delta: 0.00%
TokensForExpression-4: old 394kB ± 0%: new 394kB ± 0%: delta: 0.00%
PartialEvalComplex-4: old 361kB ± 0%: new 361kB ± 0%: delta: 0.00%
PartialEvalSmallString-4: old 1.95kB ± 0%: new 1.95kB ± 0%: delta: 0.00%
PartialEvalHugeString-4: old 196kB ± 0%: new 196kB ± 0%: delta: 0.00%
PartialEvalHugeInterpolatedString-4: old 4.31MB ± 0%: new 4.31MB ± 0%: delta: 0.00%
PartialEvalObject-4: old 19.4kB ± 0%: new 19.4kB ± 0%: delta: 0.00%
TmAllTrueLiteralList-4: old 321kB ± 0%: new 321kB ± 0%: delta: 0.00%
TmAllTrueFuncall-4: old 10.6kB ± 0%: new 10.6kB ± 0%: delta: 0.00%
TmAnyTrueLiteralList-4: old 2.09MB ± 0%: new 2.09MB ± 0%: delta: 0.00%
TmAnyTrueFuncall-4: old 10.7kB ± 0%: new 10.7kB ± 0%: delta: 0.00%
TmTernary-4: old 1.18kB ± 0%: new 1.18kB ± 0%: delta: 0.00%
TmTryUnknownFunc-4: old 784B ± 0%: new 784B ± 0%: delta: 0.00%
TmTryUnknownVariable-4: old 768B ± 0%: new 768B ± 0%: delta: 0.00%
TmTryUnknownObjectKey-4: old 952B ± 0%: new 952B ± 0%: delta: 0.00%
metric: allocs/op
ChangeDetection-4: old 2.39k ± 0%: new 2.39k ± 0%: delta: -0.01%
ChangeDetectionTFAndTG-4: old 33.6k ± 0%: new 33.6k ± 0%: delta: 0.00%
CloudReadLines-4: old 5.54k ± 0%: new 5.54k ± 0%: delta: 0.00%
CloudReadLine-4: old 60.0k ± 0%: new 60.0k ± 0%: delta: 0.00%
ListFiles-4: old 335 ± 0%: new 335 ± 0%: delta: 0.00%
Generate-4: old 25.7M ± 0%: new 25.7M ± 0%: delta: 0.00%
GenerateRegex-4: old 18.4M ± 0%: new 18.4M ± 0%: delta: 0.00%
TokensForExpressionComplex-4: old 4.83k ± 0%: new 4.83k ± 0%: delta: 0.00%
TokensForExpressionPlainStringNoNewline-4: old 20.0 ± 0%: new 20.0 ± 0%: delta: 0.00%
TokensForExpressionStringWith100Newlines-4: old 227 ± 0%: new 227 ± 0%: delta: 0.00%
TokensForExpressionObjectWith100KeysWithNumberValues-4: old 3.19k ± 0%: new 3.19k ± 0%: delta: 0.00%
TokensForExpression-4: old 4.83k ± 0%: new 4.83k ± 0%: delta: 0.00%
PartialEvalComplex-4: old 3.78k ± 0%: new 3.78k ± 0%: delta: 0.00%
PartialEvalSmallString-4: old 26.0 ± 0%: new 26.0 ± 0%: delta: 0.00%
PartialEvalHugeString-4: old 38.0 ± 0%: new 38.0 ± 0%: delta: 0.00%
PartialEvalHugeInterpolatedString-4: old 26.1k ± 0%: new 26.1k ± 0%: delta: 0.00%
PartialEvalObject-4: old 183 ± 0%: new 183 ± 0%: delta: 0.00%
TmAllTrueLiteralList-4: old 5.94k ± 0%: new 5.94k ± 0%: delta: 0.00%
TmAllTrueFuncall-4: old 275 ± 0%: new 275 ± 0%: delta: 0.00%
TmAnyTrueLiteralList-4: old 59.6k ± 0%: new 59.6k ± 0%: delta: 0.00%
TmAnyTrueFuncall-4: old 277 ± 0%: new 277 ± 0%: delta: 0.00%
TmTernary-4: old 27.0 ± 0%: new 27.0 ± 0%: delta: 0.00%
TmTryUnknownFunc-4: old 21.0 ± 0%: new 21.0 ± 0%: delta: 0.00%
TmTryUnknownVariable-4: old 20.0 ± 0%: new 20.0 ± 0%: delta: 0.00%
TmTryUnknownObjectKey-4: old 23.0 ± 0%: new 23.0 ± 0%: delta: 0.00%

@i4ki i4ki force-pushed the i4k-fix-tg-change-detection branch 4 times, most recently from bcf628b to 4a0c366 Compare November 26, 2024 14:49
@i4ki i4ki force-pushed the i4k-fix-tg-change-detection branch from 4a0c366 to 9b0a40f Compare November 26, 2024 22:51
@i4ki i4ki changed the base branch from main to i4k-fix-project-path-handling November 26, 2024 22:53
@i4ki i4ki force-pushed the i4k-fix-tg-change-detection branch 4 times, most recently from 2672ff2 to 355ee9a Compare November 27, 2024 00:43
@i4ki i4ki force-pushed the i4k-fix-tg-change-detection branch from 355ee9a to 09bdfca Compare November 27, 2024 00:56
i4ki added a commit that referenced this pull request Nov 27, 2024
## What this PR does / why we need it:

While fixing #1971 another problem was identified that prevented the
fix.
The `project.PrjAbsPath()` function had many misuses that worked by luck
in many cases but the other fix depends on this one.

## Which issue(s) this PR fixes:
none

## Special notes for your reviewer:

## Does this PR introduce a user-facing change?
```
no
```
Base automatically changed from i4k-fix-project-path-handling to main November 27, 2024 15:32
@i4ki i4ki merged commit ff79b05 into main Nov 27, 2024
7 checks passed
@i4ki i4ki deleted the i4k-fix-tg-change-detection branch November 27, 2024 17:35
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.

[BUG] no changes detected in stack if base Terraform module is changed in previous commit
2 participants