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: cleanup of orphaned files must respect -C flag. #1886

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

i4ki
Copy link
Contributor

@i4ki i4ki commented Sep 25, 2024

What this PR does / why we need it:

When using terramate -C <dir> generate, Terramate is still cleaning up orphaned files in the entire repository.

Which issue(s) this PR fixes:

none

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 September 25, 2024 16:21
@i4ki i4ki force-pushed the i4k-fix-orphan-cleanup branch from ed56345 to 2190a03 Compare September 25, 2024 16:23
soerenmartius
soerenmartius previously approved these changes Sep 25, 2024
Copy link
Contributor

@soerenmartius soerenmartius left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

github-actions bot commented Sep 25, 2024

2024/09/25 23:03:13 Terraform detected version: 1.9.6
toolsetPath: /tmp/cmd-terramate-test-2533359566
=== RUN   TestInteropCloudSyncPreview
=== RUN   TestInteropCloudSyncPreview/preview:_basic-drift
=== RUN   TestInteropCloudSyncPreview/preview:_basic-drift-uppercase-id
--- PASS: TestInteropCloudSyncPreview (11.76s)
    --- PASS: TestInteropCloudSyncPreview/preview:_basic-drift (6.23s)
    --- PASS: TestInteropCloudSyncPreview/preview:_basic-drift-uppercase-id (5.53s)
=== RUN   TestInteropSyncDeployment
=== RUN   TestInteropSyncDeployment/deployment:_empty
=== RUN   TestInteropSyncDeployment/deployment:_empty-uppercase-id
--- PASS: TestInteropSyncDeployment (39.04s)
    --- PASS: TestInteropSyncDeployment/deployment:_empty (19.54s)
    --- PASS: TestInteropSyncDeployment/deployment:_empty-uppercase-id (19.50s)
=== RUN   TestInteropDrift
=== RUN   TestInteropDrift/drift:_basic-drift
=== RUN   TestInteropDrift/drift:_basic-drift-uppercase-id
--- PASS: TestInteropDrift (65.54s)
    --- PASS: TestInteropDrift/drift:_basic-drift (31.03s)
    --- PASS: TestInteropDrift/drift:_basic-drift-uppercase-id (34.51s)
PASS
ok  	github.com/terramate-io/terramate/e2etests/cloud/interop	126.437s

Copy link

github-actions bot commented Sep 25, 2024

Preview of ubuntu-focal/go1.21 tests in b5aa451

🔍 View Details on Terramate Cloud

.
generate

Copy link

github-actions bot commented Sep 25, 2024

Preview of macos-ventura/go1.21 tests in b5aa451

🔍 View Details on Terramate Cloud

.
generate

Copy link

github-actions bot commented Sep 25, 2024

metric: time/op
CloudReadLines-4: old 995µs ± 3%: new 1012µs ± 5%: delta: 1.73%
CloudReadLine-4: old 7.22ms ± 3%: new 7.24ms ± 1%: delta: 0.00%
ListFiles-4: old 78.6µs ± 1%: new 79.2µs ± 1%: delta: 0.69%
Generate-4: old 4.95s ± 2%: new 4.98s ± 1%: delta: 0.72%
GenerateRegex-4: old 3.24s ± 1%: new 3.30s ± 2%: delta: 2.06%
TokensForExpressionComplex-4: old 1.26ms ± 1%: new 1.26ms ± 1%: delta: 0.00%
TokensForExpressionPlainStringNoNewline-4: old 785ns ± 0%: new 789ns ± 1%: delta: 0.47%
TokensForExpressionStringWith100Newlines-4: old 23.5µs ± 1%: new 23.6µs ± 1%: delta: 0.67%
TokensForExpressionObjectWith100KeysWithNumberValues-4: old 1.44ms ± 0%: new 1.44ms ± 1%: delta: 0.00%
TokensForExpression-4: old 1.25ms ± 1%: new 1.26ms ± 1%: delta: 0.00%
PartialEvalComplex-4: old 516µs ± 1%: new 518µs ± 1%: delta: 0.00%
PartialEvalSmallString-4: old 3.72µs ± 1%: new 3.74µs ± 1%: delta: 0.45%
PartialEvalHugeString-4: old 1.90ms ± 0%: new 1.91ms ± 1%: delta: 0.58%
PartialEvalHugeInterpolatedString-4: old 4.69ms ± 2%: new 4.71ms ± 2%: delta: 0.00%
PartialEvalObject-4: old 24.9µs ± 1%: new 24.7µs ± 1%: delta: -0.85%
TmAllTrueLiteralList-4: old 616µs ± 1%: new 618µs ± 1%: delta: 0.40%
TmAllTrueFuncall-4: old 20.3µs ± 1%: new 20.2µs ± 1%: delta: -0.34%
TmAnyTrueLiteralList-4: old 4.85ms ± 1%: new 4.87ms ± 1%: delta: 0.47%
TmAnyTrueFuncall-4: old 20.7µs ± 2%: new 20.6µs ± 1%: delta: -0.34%
TmTernary-4: old 2.60µs ± 1%: new 2.58µs ± 0%: delta: -0.75%
TmTryUnknownFunc-4: old 2.29µs ± 1%: new 2.25µs ± 0%: delta: -1.51%
TmTryUnknownVariable-4: old 2.19µs ± 0%: new 2.16µs ± 0%: delta: -1.47%
TmTryUnknownObjectKey-4: old 2.51µs ± 1%: new 2.48µs ± 0%: delta: -1.10%
metric: alloc/op
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 23.3kB ± 0%: new 23.3kB ± 0%: delta: 0.00%
Generate-4: old 4.47GB ± 0%: new 4.47GB ± 0%: delta: 0.00%
GenerateRegex-4: old 1.84GB ± 0%: new 1.84GB ± 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 338kB ± 0%: new 338kB ± 0%: delta: 0.00%
PartialEvalSmallString-4: old 1.74kB ± 0%: new 1.74kB ± 0%: delta: 0.00%
PartialEvalHugeString-4: old 196kB ± 0%: new 196kB ± 0%: delta: 0.00%
PartialEvalHugeInterpolatedString-4: old 4.05MB ± 0%: new 4.05MB ± 0%: delta: 0.00%
PartialEvalObject-4: old 17.2kB ± 0%: new 17.2kB ± 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.20kB ± 0%: new 1.20kB ± 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
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 321 ± 0%: new 321 ± 0%: delta: 0.00%
Generate-4: old 51.4M ± 0%: new 51.4M ± 0%: delta: 0.00%
GenerateRegex-4: old 36.8M ± 0%: new 36.8M ± 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.48k ± 0%: new 3.48k ± 0%: delta: 0.00%
PartialEvalSmallString-4: old 23.0 ± 0%: new 23.0 ± 0%: delta: 0.00%
PartialEvalHugeString-4: old 35.0 ± 0%: new 35.0 ± 0%: delta: 0.00%
PartialEvalHugeInterpolatedString-4: old 23.1k ± 0%: new 23.1k ± 0%: delta: 0.00%
PartialEvalObject-4: old 152 ± 0%: new 152 ± 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 28.0 ± 0%: new 28.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 marked this pull request as draft September 25, 2024 17:57
@i4ki i4ki force-pushed the i4k-fix-orphan-cleanup branch 2 times, most recently from 96d7b08 to 6fa97f1 Compare September 25, 2024 22:07
@i4ki i4ki marked this pull request as ready for review September 25, 2024 22:14
@i4ki i4ki force-pushed the i4k-fix-orphan-cleanup branch from 56e8e1b to 923753b Compare September 25, 2024 22:51
@i4ki i4ki force-pushed the i4k-fix-orphan-cleanup branch from 923753b to b5aa451 Compare September 25, 2024 23:02
@i4ki i4ki requested a review from soerenmartius September 25, 2024 23:02
@i4ki i4ki merged commit 2e10c1f into main Sep 27, 2024
7 checks passed
@i4ki i4ki deleted the i4k-fix-orphan-cleanup branch September 27, 2024 07:17
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.

3 participants