-
Notifications
You must be signed in to change notification settings - Fork 44
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
Change bk build pipeline argument to a flag #275
Conversation
|
||
cmd := cobra.Command{ | ||
DisableFlagsInUseLine: true, | ||
Use: "cancel [number [pipeline]] [flags]", | ||
Short: "Cancels a build.", | ||
Use: "cancel <number> [flags]", |
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.
As this is a destructive operation and could cause issues when builds are cancelled whilst running, I think requiring an actual build number here is a good idea. That will mean the user won't unintentionally cancel a main
branch build which could cause issues with deploys or other things.
Use: "new [pipeline] [flags]", | ||
Short: "Creates a new pipeline build", | ||
Args: cobra.MaximumNArgs(1), | ||
Use: "new [flags]", | ||
Short: "Create a new build", | ||
Args: cobra.NoArgs, | ||
Long: heredoc.Doc(` | ||
Creates a new build for the specified pipeline and output the URL to the build. | ||
|
||
The pipeline can be a {pipeline_slug} or in the format {org_slug}/{pipeline_slug}. | ||
If the pipeline argument is omitted, it will be resolved using the current directory. | ||
Create a new build on a pipeline. | ||
The web URL to the build will be printed to stdout. | ||
`), | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
resolvers := resolver.NewAggregateResolver( | ||
resolver.ResolveFromPositionalArgument(args, 0, f.Config), | ||
resolver.ResolveFromFlag(pipeline, f.Config), |
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.
There is no build argument to this command. So I thought making the pipeline name optional instead of an arg would make sense. Any thoughts?
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 am fine with that behaviour.
This changes the positional pipeline argument to a flag instead. This should make more sense to users to allow specifying which pipeline to operate on within the build commands