-
Notifications
You must be signed in to change notification settings - Fork 61
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
add projectID flag option to delete project command #324
base: main
Are you sure you want to change the base?
add projectID flag option to delete project command #324
Conversation
Signed-off-by: adityachopra29 <[email protected]>
@bupd I have made the changes. Plz have a look if anything needs to be changed.
|
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.
Thanks for you contribution
I have left a review on changes that can be made on this PR.
@@ -45,6 +46,7 @@ func DeleteProjectCommand() *cobra.Command { | |||
|
|||
flags := cmd.Flags() | |||
flags.BoolVar(&forceDelete, "force", false, "Deletes all repositories and artifacts within the project") | |||
flags.BoolVar(&useProjectID, "projectID", false, "If set, treats the provided argument as a project ID instead of a project name") |
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 would suggest project ID to be a flag to which you can pass project ids. rather than having it as a boolean. since this would allow the args to always be projectname maintaining consistency.
Thanks
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 would suggest project ID to be a flag to which you can pass project ids. rather than having it as a boolean. since this would allow the args to always be projectname maintaining consistency.
@bupd
So are you suggesting to make projectName an optional input for the delete command? Because I was under the understanding that we are giving projectID when we did not know the projectName.
Right now, when we don't give projectName, we enter the prompt mode and again choose projectName. So do we want to change that behavior when the projectID flag is given?
@@ -32,16 +32,16 @@ func ViewCommand() *cobra.Command { | |||
Args: cobra.MaximumNArgs(1), | |||
Run: func(cmd *cobra.Command, args []string) { | |||
var err error | |||
var projectName string | |||
var projectNameOrID string |
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.
have it just projectName and have different var for projectID.
|
||
func CreateBoolPointer(b bool) *bool { | ||
return &b | ||
} | ||
|
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.
remove this
ctx, client, err := utils.ContextWithClient() | ||
if err != nil { | ||
return repository.ListRepositoriesOK{}, err | ||
} | ||
projectName := projectNameOrID |
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.
wrong wording.
Which problem is this PR solving?
Description of the changes
projectID
flag todelete
command inproject
command.projectID
parameter to all corresponding functionsHow was this change tested?