Add --no-maintainer-edit flag#2250
Conversation
Closes #2213 while retaining backwards compatibility.
mislav
left a comment
There was a problem hiding this comment.
This looks good! I'm not sure about the --maintainer-edit flag name, but I can discuss that with my team first to see if we can come up with something that makes sense.
Also, users are not generally aware of the --maintainer-edit=false syntax for boolean flags, so we would have to document that better too.
Do you think we should print some sort of warning or error when both --web and --maintainer-edit=false are used? It doesn't look like we can pass this parameter via URL query parameters for web-based editing 🤔
|
I agree, i dont like the name of the flag either. I guess i'm too familiar with unix like systems, as that is an intuitive concept to me! Where do you think should the documentation reside? I guess including both the example from above within the examples and a short notice within the long text would be adaquate then right? How about: &cobra.Command{
// [...]
Long: heredoc.Doc(`
Create a pull request on GitHub.
When the current branch isn't fully pushed to a git remote, a prompt will ask where
to push the branch and offer an option to fork the base repository. Use '--head' to
explicitly skip any forking or pushing behavior.
A prompt will also ask for the title and the body of the pull request. Use '--title'
and '--body' to skip this, or use '--fill' to autofill these values from git commits.
By default users with write access to the base respository can add new commits to your branch.
If undesired, you may disable access of maintainers by using '--maintainer-edit=false'
You can always change this setting later.
`),
Example: heredoc.Doc(`
$ gh pr create --title "The bug is fixed" --body "Everything works again"
$ gh pr create --reviewer monalisa,hubot
$ gh pr create --project "Roadmap"
$ gh pr create --base develop --head monalisa:feature
$ gh pr create --maintainer-edit=false
`),
// [...]
}While i agree we should definitely throw an error if the web based access does not allow to pass the flag. However i would suggest, as this is a github product, and the Web UI already supports this field, to adapt and change this behavior, if possible. I'll add my changes this evening. |
|
Hey there, thank you for picking the issue up so quickly! I hope you are all well! From my "user perspective" a name like
Anyway, thank you all for your work on this project, I use it all the time! |
|
@mislav As the design might still take some time, mind adding a hacktoberfest-accepted label? If you need any changes, feel free to suggest them 😄 . |
|
going with |

Closes #2213 while retaining backwards compatibility.
This PR adds no additional tests, as the change is mostly related to the server implementation and not the client implementation.
Furthermore i could not verify it's behavior using a local repository (e.g. the Web UI did not show it as a maintainer and PR requester).
Using the CLI to push it right now though :)