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

feat: add create --wants and --wanted-by flags. #1888

Merged
merged 4 commits into from
Sep 27, 2024
Merged

Conversation

i4ki
Copy link
Contributor

@i4ki i4ki commented Sep 25, 2024

What this PR does / why we need it:

Implements terramate create --wants ... and terramate create --wanted-by ....
The flag works the same as --after, --before, etc, it creates the stack with the given values in the stack.wants and stack.wanted_by respectively.

Which issue(s) this PR fixes:

none

Special notes for your reviewer:

Does this PR introduce a user-facing change?

yes, add new feature.

@i4ki i4ki requested a review from a team as a code owner September 25, 2024 23:28
Copy link

github-actions bot commented Sep 25, 2024

2024/09/27 12:49:07 Terraform detected version: 1.9.6
toolsetPath: /tmp/cmd-terramate-test-893603603
=== 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 (12.17s)
    --- PASS: TestInteropCloudSyncPreview/preview:_basic-drift (6.28s)
    --- PASS: TestInteropCloudSyncPreview/preview:_basic-drift-uppercase-id (5.89s)
=== RUN   TestInteropSyncDeployment
=== RUN   TestInteropSyncDeployment/deployment:_empty
=== RUN   TestInteropSyncDeployment/deployment:_empty-uppercase-id
--- PASS: TestInteropSyncDeployment (39.46s)
    --- PASS: TestInteropSyncDeployment/deployment:_empty (19.97s)
    --- PASS: TestInteropSyncDeployment/deployment:_empty-uppercase-id (19.49s)
=== RUN   TestInteropDrift
=== RUN   TestInteropDrift/drift:_basic-drift
=== RUN   TestInteropDrift/drift:_basic-drift-uppercase-id
--- PASS: TestInteropDrift (64.63s)
    --- PASS: TestInteropDrift/drift:_basic-drift (32.68s)
    --- PASS: TestInteropDrift/drift:_basic-drift-uppercase-id (31.95s)
PASS
ok  	github.com/terramate-io/terramate/e2etests/cloud/interop	128.217s

Copy link

github-actions bot commented Sep 25, 2024

Preview of ubuntu-focal/go1.21 tests in 80ffec2

🔍 View Details on Terramate Cloud

.
cmd/terramate/cli
stack
e2etests/core

Copy link

github-actions bot commented Sep 25, 2024

Preview of macos-ventura/go1.21 tests in 80ffec2

🔍 View Details on Terramate Cloud

.
cmd/terramate/cli
stack
e2etests/core

@i4ki i4ki marked this pull request as draft September 25, 2024 23:56
Copy link

github-actions bot commented Sep 26, 2024

metric: time/op
CloudReadLines-4: old 1.03ms ± 4%: new 1.01ms ± 6%: delta: 0.00%
CloudReadLine-4: old 7.27ms ± 1%: new 7.25ms ± 2%: delta: 0.00%
ListFiles-4: old 79.0µs ± 1%: new 79.1µs ± 1%: delta: 0.00%
Generate-4: old 5.04s ± 2%: new 4.98s ± 1%: delta: -1.21%
GenerateRegex-4: old 3.31s ± 2%: new 3.33s ± 1%: delta: 0.69%
TokensForExpressionComplex-4: old 1.25ms ± 0%: new 1.26ms ± 1%: delta: 0.51%
TokensForExpressionPlainStringNoNewline-4: old 794ns ± 1%: new 791ns ± 1%: delta: -0.44%
TokensForExpressionStringWith100Newlines-4: old 23.8µs ± 2%: new 24.0µs ± 1%: delta: 0.74%
TokensForExpressionObjectWith100KeysWithNumberValues-4: old 1.45ms ± 0%: new 1.45ms ± 0%: delta: 0.35%
TokensForExpression-4: old 1.26ms ± 1%: new 1.26ms ± 0%: delta: 0.27%
PartialEvalComplex-4: old 521µs ± 2%: new 521µs ± 1%: delta: 0.00%
PartialEvalSmallString-4: old 3.75µs ± 1%: new 3.77µs ± 1%: delta: 0.48%
PartialEvalHugeString-4: old 1.92ms ± 1%: new 1.91ms ± 1%: delta: -0.50%
PartialEvalHugeInterpolatedString-4: old 4.73ms ± 1%: new 4.73ms ± 1%: delta: 0.00%
PartialEvalObject-4: old 25.0µs ± 1%: new 24.9µs ± 1%: delta: 0.00%
TmAllTrueLiteralList-4: old 622µs ± 1%: new 620µs ± 0%: delta: 0.00%
TmAllTrueFuncall-4: old 20.5µs ± 1%: new 20.4µs ± 1%: delta: -0.29%
TmAnyTrueLiteralList-4: old 4.87ms ± 0%: new 4.87ms ± 1%: delta: 0.00%
TmAnyTrueFuncall-4: old 20.8µs ± 1%: new 20.8µs ± 1%: delta: 0.00%
TmTernary-4: old 2.58µs ± 1%: new 2.58µs ± 1%: delta: -0.25%
TmTryUnknownFunc-4: old 2.26µs ± 1%: new 2.26µs ± 1%: delta: -0.27%
TmTryUnknownVariable-4: old 2.16µs ± 0%: new 2.17µs ± 1%: delta: 0.28%
TmTryUnknownObjectKey-4: old 2.49µs ± 0%: new 2.49µs ± 1%: delta: 0.00%
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 395kB ± 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 ready for review September 26, 2024 16:46
@i4ki i4ki force-pushed the i4k-add-create-wants branch from 5f7cf98 to b2928b0 Compare September 26, 2024 16:58
snakster
snakster previously approved these changes Sep 26, 2024
Copy link
Contributor

@snakster snakster left a comment

Choose a reason for hiding this comment

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

👍

soerenmartius
soerenmartius previously approved these changes Sep 27, 2024
@i4ki i4ki dismissed stale reviews from soerenmartius and snakster via 6d8c635 September 27, 2024 08:21
@i4ki i4ki merged commit 5271356 into main Sep 27, 2024
7 checks passed
@i4ki i4ki deleted the i4k-add-create-wants branch September 27, 2024 13:11
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