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: don't break on --substitute values which have commas #580

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

hallyn
Copy link
Contributor

@hallyn hallyn commented Jan 5, 2024

The following:

stacker build --substitute a=b,c

used to work, until commit 3baba64:

fix(ci): convert ci is failing due to perms (#439)

This squashed PR included 'chore(go.mod): update cli to github.com/urfave/cli/v2'. Switching from urfave/cli/v1 to v2 changes string slice flag behavior to automatically split on commas.

Luckily there is an app.DisableSliceFlagSeparator flag we can set to tell it not to do that. Set that flag. And add a test for this.

What type of PR is this?

Which issue does this PR fix:

What does this PR do / Why do we need it:

If an issue # is not available please add repro steps and logs showing the issue:

Testing done on this change:

Automation added to e2e:

Will this break upgrades or downgrades?

Does this PR introduce any user-facing change?:


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

The following:

  stacker build --substitute a=b,c

used to work, until commit 3baba64:

  fix(ci): convert ci is failing due to perms (project-stacker#439)

This squashed PR included 'chore(go.mod): update cli to
github.com/urfave/cli/v2'.  Switching from urfave/cli/v1 to v2 changes
string slice flag behavior to automatically split on commas.

Luckily there is an app.DisableSliceFlagSeparator flag we can set to
tell it not to do that.  Set that flag.  And add a test for this.

Signed-off-by: Serge Hallyn <shallyn@cisco.com>
Copy link

codecov bot commented Jan 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (d54e250) 57.10% compared to head (d9cb119) 57.12%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #580      +/-   ##
==========================================
+ Coverage   57.10%   57.12%   +0.01%     
==========================================
  Files          64       64              
  Lines        7519     7521       +2     
==========================================
+ Hits         4294     4296       +2     
  Misses       2483     2483              
  Partials      742      742              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hallyn
Copy link
Contributor Author

hallyn commented Jan 6, 2024

not ok 66 import various sizes in 4sec

@rchincha is this a regression in this test? (i don't see how it could be, but...) Or has it been seen elsewhere?

run: |
touch /foo
EOF
stacker build --substitute "a=b,c"
Copy link
Contributor

Choose a reason for hiding this comment

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

How is this substitution used though in the stacker.yaml?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean in the testcase? It's not. That's not necessary to trigger the regression failure-to-build in main branch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm. When I run this test locally (sudo bats test/basic.bats), i get zero failures.

Copy link
Contributor

Choose a reason for hiding this comment

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

In the run: section, maybe echo "${{a}}"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I was wrong - I can reproduce this. No idea why.

Copy link
Contributor

Choose a reason for hiding this comment

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

The CI failure is due to the gzip issue. It is a concern, but unrelated to this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually it seems to just be a flaky test? :

ubuntu@stacker:~/stacker$ sudo -E bats test/gzip.bats 
 ✓ import various sizes 

1 test, 0 failures

@hallyn hallyn merged commit 68bae2b into project-stacker:main Jan 8, 2024
10 of 11 checks passed
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.

2 participants