-
Notifications
You must be signed in to change notification settings - Fork 2.4k
drop shlex dependency #5943
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
drop shlex dependency #5943
Conversation
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: koba1t The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
d2e62c5 to
95c954b
Compare
95c954b to
042a2cf
Compare
|
This PR has multiple commits, and the default merge method is: merge. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
stormqueen1990
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi there, @koba1t! This change looks good to me in essence, I just have a suggestion regarding documentation and a question on the test cases.
| case (r == '\'' || r == '"') && quote == 0: | ||
| quote = r | ||
| case r == quote: | ||
| quote = 0 | ||
| case r == '#' && quote == 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we use a constant for the indication that a quote was finished? It wasn't immediately clear to me why the value of quote here was 0 to mean "no quote open".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good opinion.
I added a noQuote const value to check.
3866a30
| if tc.wantErr { | ||
| if err == nil { | ||
| t.Errorf("FAIL: Expected error but got none, Expected: %q\n", tc.expected) | ||
| } | ||
| return | ||
| } | ||
|
|
||
| if assert.NoError(t, err, "FAIL: Unexpected error %q for input %q", err, tc.input) { | ||
| // check if the result matches the expected output | ||
| assert.Equal(t, tc.expected, result, | ||
| "FAIL: Result mismatch,Input %q, Expected %q, Got: %q\n", | ||
| tc.input, tc.expected, result, | ||
| ) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if we want require.Error/require.NoError in this loop instead of just assert. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The difference between require and assert functions in whether execution continues when a test fails—in this test function, specifying either should produce identical behavior. This is because both assert variants cause the t.Run() function to terminate immediately upon failure.
https://pkg.go.dev/github.com/stretchr/testify/require
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. Let's keep as-is.
stormqueen1990
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [kubernetes-sigs/kustomize](https://github.com/kubernetes-sigs/kustomize) | patch | `v5.7.0` -> `v5.7.1` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>kubernetes-sigs/kustomize (kubernetes-sigs/kustomize)</summary> ### [`v5.7.1`](https://github.com/kubernetes-sigs/kustomize/releases/tag/kustomize/v5.7.1) [Compare Source](kubernetes-sigs/kustomize@kustomize/v5.7.0...kustomize/v5.7.1) This release introduces code to replace the shlex library used for parsing arguments in the exec plugin. If any existing manifests become corrupted, please file an issue. discussion: https://github.com/kubernetes/kubernetes/pull/132593#discussion\_r2178116543 #### Dependencies [#​5943](kubernetes-sigs/kustomize#5943): drop shlex dependency #### Chore [#​5948](kubernetes-sigs/kustomize#5948): Update kyaml to v0.20.1 [#​5949](kubernetes-sigs/kustomize#5949): Update cmd/config to v0.20.1 [#​5950](kubernetes-sigs/kustomize#5950): Update api to v0.20.1 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MC42Mi4xIiwidXBkYXRlZEluVmVyIjoiNDAuNjIuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
Remove dependency on shlex package by implementing functionality for shlex.Split()
ref: kubernetes/kubernetes#132593 (comment)