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

chore: upgrade Kong library to v1.4.0 #1965

Merged
merged 1 commit into from
Nov 25, 2024
Merged

chore: upgrade Kong library to v1.4.0 #1965

merged 1 commit into from
Nov 25, 2024

Conversation

i4ki
Copy link
Contributor

@i4ki i4ki commented Nov 20, 2024

What this PR does / why we need it:

Upgrade Kong in preparation for upcoming cli help changes.

Which issue(s) this PR fixes:

none

Special notes for your reviewer:

Does this PR introduce a user-facing change?

no

@i4ki i4ki requested a review from a team as a code owner November 20, 2024 23:50
Copy link

github-actions bot commented Nov 20, 2024

2024/11/21 00:31:24 Terraform detected version: 1.9.8
toolsetPath: /tmp/cmd-terramate-test-2687141657
=== 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.51s)
    --- PASS: TestInteropCloudSyncPreview/preview:_basic-drift (6.13s)
    --- PASS: TestInteropCloudSyncPreview/preview:_basic-drift-uppercase-id (5.39s)
=== RUN   TestInteropSyncDeployment
=== RUN   TestInteropSyncDeployment/deployment:_empty
=== RUN   TestInteropSyncDeployment/deployment:_empty-uppercase-id
--- PASS: TestInteropSyncDeployment (36.66s)
    --- PASS: TestInteropSyncDeployment/deployment:_empty (18.49s)
    --- PASS: TestInteropSyncDeployment/deployment:_empty-uppercase-id (18.17s)
=== RUN   TestInteropDrift
=== RUN   TestInteropDrift/drift:_basic-drift
=== RUN   TestInteropDrift/drift:_basic-drift-uppercase-id
--- PASS: TestInteropDrift (58.76s)
    --- PASS: TestInteropDrift/drift:_basic-drift (29.19s)
    --- PASS: TestInteropDrift/drift:_basic-drift-uppercase-id (29.57s)
PASS
ok  	github.com/terramate-io/terramate/e2etests/cloud/interop	118.617s

soerenmartius
soerenmartius previously approved these changes Nov 21, 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 Nov 21, 2024

metric: time/op
ChangeDetection-4: old 4.24ms ± 6%: new 4.02ms ± 3%: delta: -5.28%
ChangeDetectionTFAndTG-4: old 14.3ms ± 4%: new 13.5ms ± 2%: delta: -5.59%
CloudReadLines-4: old 1.03ms ± 5%: new 1.01ms ± 8%: delta: 0.00%
CloudReadLine-4: old 7.41ms ± 2%: new 7.37ms ± 2%: delta: 0.00%
ListFiles-4: old 87.5µs ± 1%: new 88.4µs ± 1%: delta: 1.07%
Generate-4: old 1.58s ± 4%: new 1.58s ± 3%: delta: 0.00%
GenerateRegex-4: old 1.08s ± 3%: new 1.11s ± 4%: delta: 2.77%
TokensForExpressionComplex-4: old 1.27ms ± 1%: new 1.28ms ± 2%: delta: 0.63%
TokensForExpressionPlainStringNoNewline-4: old 794ns ± 1%: new 800ns ± 1%: delta: 0.65%
TokensForExpressionStringWith100Newlines-4: old 23.9µs ± 1%: new 24.7µs ± 1%: delta: 3.52%
TokensForExpressionObjectWith100KeysWithNumberValues-4: old 1.46ms ± 0%: new 1.47ms ± 0%: delta: 0.71%
TokensForExpression-4: old 1.27ms ± 1%: new 1.28ms ± 1%: delta: 1.00%
PartialEvalComplex-4: old 546µs ± 3%: new 561µs ± 1%: delta: 2.87%
PartialEvalSmallString-4: old 3.93µs ± 1%: new 3.97µs ± 1%: delta: 1.23%
PartialEvalHugeString-4: old 1.92ms ± 0%: new 1.92ms ± 0%: delta: 0.00%
PartialEvalHugeInterpolatedString-4: old 4.98ms ± 2%: new 4.98ms ± 2%: delta: 0.00%
PartialEvalObject-4: old 26.9µs ± 2%: new 27.0µs ± 2%: delta: 0.00%
TmAllTrueLiteralList-4: old 630µs ± 2%: new 627µs ± 1%: delta: -0.48%
TmAllTrueFuncall-4: old 20.6µs ± 2%: new 20.7µs ± 1%: delta: 0.58%
TmAnyTrueLiteralList-4: old 4.91ms ± 1%: new 4.89ms ± 0%: delta: -0.45%
TmAnyTrueFuncall-4: old 21.1µs ± 2%: new 20.9µs ± 1%: delta: -0.59%
TmTernary-4: old 2.53µs ± 1%: new 2.54µs ± 1%: delta: 0.59%
TmTryUnknownFunc-4: old 2.28µs ± 1%: new 2.30µs ± 1%: delta: 0.55%
TmTryUnknownVariable-4: old 2.18µs ± 1%: new 2.20µs ± 0%: delta: 0.79%
TmTryUnknownObjectKey-4: old 2.51µs ± 2%: new 2.53µs ± 1%: delta: 0.70%
metric: alloc/op
ChangeDetection-4: old 357kB ± 0%: new 357kB ± 0%: delta: -0.02%
ChangeDetectionTFAndTG-4: old 4.80MB ± 0%: new 4.80MB ± 0%: delta: 0.00%
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 395kB ± 0%: new 395kB ± 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 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.43k ± 0%: new 2.43k ± 0%: delta: -0.02%
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%

Signed-off-by: i4k <t.nateldemoura@gmail.com>
Copy link

Preview of ubuntu-focal/go1.21 tests in 257e17a

🔍 View Details on Terramate Cloud

.
cmd/terramate/cli

Copy link

Preview of macos-ventura/go1.21 tests in 257e17a

🔍 View Details on Terramate Cloud

.
cmd/terramate/cli

@soerenmartius soerenmartius self-requested a review November 21, 2024 01:43
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

@@ -119,6 +119,12 @@ func selectPlanFile(terraformPlan, tofuPlan string) (planfile, provisioner strin
func (c *cli) runOnStacks() {
c.gitSafeguardDefaultBranchIsReachable()

if len(c.parsedArgs.Run.Command) > 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you briefly explain why this becomes necessarily now?

Copy link
Contributor Author

@i4ki i4ki Nov 21, 2024

Choose a reason for hiding this comment

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

they changed the behavior of specifically arg:"" passthrough:"":
alecthomas/kong#436

Maybe I'm missing something but I cannot make it work in in the way it was before...
The passthrough:"" prevents kong from interpretating the flags, so it's needed otherwise commands with same flags as Terramate gets interpreted. The arg:"" is also needed to ... make it an argument, unless there's other option to keep old behavior :(

@i4ki i4ki merged commit b3943cf into main Nov 25, 2024
7 checks passed
@i4ki i4ki deleted the i4k-upgrade-kong branch November 25, 2024 15:02
i4ki added a commit that referenced this pull request Nov 29, 2024
The `arg:"" passthrough:""` option leads to malparsing of flags.

Signed-off-by: i4k <t.nateldemoura@gmail.com>
i4ki added a commit that referenced this pull request Nov 29, 2024
The `arg:"" passthrough:""` option leads to malparsing of flags.

Signed-off-by: i4k <t.nateldemoura@gmail.com>
i4ki added a commit that referenced this pull request Nov 29, 2024
## What this PR does / why we need it:

Revert #1965 due to a Kong bug in the parsing of `arg:""` in conjunction
with `passthrough:""`.

Example:

Works:
```
$ terramate list --unknown-flag
Error: parsing cli args [list --unknown-flag]
> unknown flag --unknown-flag
```
Fails:
```
$ ./bin/terramate run --test echo ok
terramate: Entering stack in /
Error: one or more commands failed
> executable file not found in $PATH: running `--test echo ok` in stack /: --test
```

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

## Special notes for your reviewer:

## Does this PR introduce a user-facing change?
```
yes, fixes a command line flag parsing bug.
```
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.

4 participants