Conversation
| flagSet.SetNormalizeFunc(aliasDraftToBranchFunc) | ||
| } | ||
|
|
||
| // aliasDraftToBranchFunc aliases the draft flag to branch. |
There was a problem hiding this comment.
- are we sure we want to directly alias, and have no change in behavior?
- is there not a native way in pflag/cobra to do this?
There was a problem hiding this comment.
For the initial step of releasing the branches UI, yes. There are server side changes we need to make for upcoming features, but it doesn't warrant a flag structure change.
This is the recommended way from Cobra's pflag package: https://github.com/spf13/pflag#mutating-or-normalizing-flag-names
There was a problem hiding this comment.
Once we do this, it's forever, so we can't later bring in any changes to --branch - just confirming we're comfortable with this
There was a problem hiding this comment.
I had an original draft of this change where I added a new --branch flag, and then had a check return an error if the user attempted to pass both a --draft and --branch.
The normalize func here seems to be the recommended way to do a direct alias, but I think I would be more comfortable with the new flag and the check. Does that seem reasonable to you?
There was a problem hiding this comment.
Yea I would error if both are specified.
CHANGELOG.md
Outdated
| - Update `buf beta price` with the latest pricing information. | ||
| - Fix issue where `buf generate --exclude-path` was not properly excluding paths | ||
| for remote modules. | ||
| - Alias the `--draft` flag for `buf push` to `--branch` and update flag description. |
There was a problem hiding this comment.
I would not call out the alias. More specifically, I would actually only do this when you are ready to deprecate --draft entirely, and then deprecate and hide --draft, and add `--branch.
--draft flag to --branch in buf push--branch to buf push
This aliases the
--draftflag to--branchinbuf push.We are planning to start branch support with parity to
--draft.The description is also updated for the flag to reflect branch.