-
Notifications
You must be signed in to change notification settings - Fork 3k
chore: upgrade pflags v1.0.9 #2305
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
Conversation
@jpmcb for k/k master, i filed a PR to move forward to pflags 1.0.9 ( kubernetes/kubernetes#133823 ), but yes, if folks mix versions of cobra/pflags (on top of what's in k/k 1.34 for example) they will dig themselves into a hole and will come to this issue :) |
Good call @dims!!! An alternative to this PR in cobra is to just keep the existing changes, upgrade to the new version of pflag, and cut a release: @marckhouzam - let's touch base when you have a chance |
Exactly @jpmcb , that was my plan for today |
63a3af1
to
4cf2574
Compare
@marckhouzam - pushed with just the changes for |
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.
This also changed go-md2man, was that pulled in by pflag?
Signed-off-by: John McBride <[email protected]>
4cf2574
to
db03d88
Compare
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
Thanks!
This PR contains the following updates: | Package | Change | Age | Confidence | |---|---|---|---| | [github.com/spf13/cobra](https://github.com/spf13/cobra) | `v1.9.1` -> `v1.10.1` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>spf13/cobra (github.com/spf13/cobra)</summary> ### [`v1.10.1`](https://github.com/spf13/cobra/releases/tag/v1.10.1) [Compare Source](spf13/cobra@v1.10.0...v1.10.1) ##### π Fix - chore: upgrade pflags v1.0.9 by [@​jpmcb](https://github.com/jpmcb) in [#​2305](spf13/cobra#2305) v1.0.9 of pflags brought back `ParseErrorsWhitelist` and marked it as deprecated **Full Changelog**: <spf13/cobra@v1.10.0...v1.10.1> ### [`v1.10.0`](https://github.com/spf13/cobra/releases/tag/v1.10.0) [Compare Source](spf13/cobra@v1.9.1...v1.10.0) #### What's Changed ##### π¨ Attention! - Bump pflag to 1.0.8 by [@​tomasaschan](https://github.com/tomasaschan) in [#​2303](spf13/cobra#2303) This version of `pflag` carried a breaking change: it renamed `ParseErrorsWhitelist` to `ParseErrorsAllowlist` which can break builds if both `pflag` and `cobra` are dependencies in your project. - If you use both `pflag and `cobra`, upgrade `pflag`to 1.0.8 and`cobra`to`1.10.0\` - ***or*** use the newer, fixed version of `pflag` v1.0.9 which keeps the deprecated `ParseErrorsWhitelist` More details can be found here: [#​2303 (comment)](spf13/cobra#2303 (comment)) ##### β¨ Features - Flow context to command in SetHelpFunc by [@​Frassle](https://github.com/Frassle) in [#​2241](spf13/cobra#2241) - The default ShellCompDirective can be customized for a command and its subcommands by [@​albers](https://github.com/albers) in [#​2238](spf13/cobra#2238) ##### π Fix - Upgrade golangci-lint to v2, address findings by [@​scop](https://github.com/scop) in [#​2279](spf13/cobra#2279) ##### πͺ Testing - Test with Go 1.24 by [@​harryzcy](https://github.com/harryzcy) in [#​2236](spf13/cobra#2236) - chore: Rm GitHub Action PR size labeler by [@​jpmcb](https://github.com/jpmcb) in [#​2256](spf13/cobra#2256) ##### π Docs - Remove traling curlybrace by [@​yedayak](https://github.com/yedayak) in [#​2237](spf13/cobra#2237) - Update command.go by [@​styee](https://github.com/styee) in [#​2248](spf13/cobra#2248) - feat: Add security policy by [@​jpmcb](https://github.com/jpmcb) in [#​2253](spf13/cobra#2253) - Update Readme (Warp) by [@​ericdachen](https://github.com/ericdachen) in [#​2267](spf13/cobra#2267) - Add Periscope to the list of projects using Cobra by [@​anishathalye](https://github.com/anishathalye) in [#​2299](spf13/cobra#2299) #### New Contributors - [@​harryzcy](https://github.com/harryzcy) made their first contribution in [#​2236](spf13/cobra#2236) - [@​yedayak](https://github.com/yedayak) made their first contribution in [#​2237](spf13/cobra#2237) - [@​Frassle](https://github.com/Frassle) made their first contribution in [#​2241](spf13/cobra#2241) - [@​styee](https://github.com/styee) made their first contribution in [#​2248](spf13/cobra#2248) - [@​ericdachen](https://github.com/ericdachen) made their first contribution in [#​2267](spf13/cobra#2267) - [@​albers](https://github.com/albers) made their first contribution in [#​2238](spf13/cobra#2238) - [@​anishathalye](https://github.com/anishathalye) made their first contribution in [#​2299](spf13/cobra#2299) - [@​tomasaschan](https://github.com/tomasaschan) made their first contribution in [#​2303](spf13/cobra#2303) **Full Changelog**: <spf13/cobra@v1.9.1...v1.9.2> </details> --- ### Configuration π **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC). π¦ **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. π **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS45MS4yIiwidXBkYXRlZEluVmVyIjoiNDEuOTEuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiS2luZC9DaG9yZSIsInJ1bi1lbmQtdG8tZW5kLXRlc3RzIl19--> <!--start release-notes-assistant--> <!--URL:https://code.forgejo.org/forgejo/runner--> - other - [PR](https://code.forgejo.org/forgejo/runner/pulls/930): <!--number 930 --><!--line 0 --><!--description VXBkYXRlIG1vZHVsZSBnaXRodWIuY29tL3NwZjEzL2NvYnJhIHRvIHYxLjEwLjE=-->Update module github.com/spf13/cobra to v1.10.1<!--description--> <!--end release-notes-assistant--> Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/930 Reviewed-by: earl-warren <[email protected]> Co-authored-by: Renovate Bot <[email protected]> Co-committed-by: Renovate Bot <[email protected]>
Edit: blast radius seems to primarily be from projects that use both cobra and pflag. The use of the re-exported type:
https://github.com/spf13/cobra/blob/main/command.go#L41-L42
shouldn't break projects now that we've cut a v1.10.0 with those changes. This now just upgrades pflag without the need to emergency roll back the original variable type changes.
This is an emergency roll forward to unblock
kubernetes/kubernetes
(see kubernetes/kubernetes#133809 and failing prow-bot) and other large projects / cloud providers that directly consumed breaking changes off cobra related to downstream breaking changes inspf13/pflags
v1.0.8:that were merged into
spf13/cobra
in:We obviously want to use these more inclusive names so we'll plan to roll forward a change in the future for
ParseErrorsWhitelist
-->ParseErrorsAllowlist
once the dust has settled and we understand what the blast radius for such a breaking change is.