-
Notifications
You must be signed in to change notification settings - Fork 70
Add a add subcommand to extsvc #856
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
In the context of scaletesting, it's pretty useful to be able to add code hosts on the fly, while toying with a test instance. This PR adds such a command.
mrnugget
left a comment
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 know the mutation is called addExternalService, but all the other CRUD commands in src-cli use create as the verb: src users create, src orgs create, ... I think create would be better.
cmd/src/extsvc_add.go
Outdated
| _, err := lookupExternalService(ctx, client, "", *nameFlag) | ||
| if err != errServiceNotFound { | ||
| return errors.New("service already exists") | ||
| } | ||
| } |
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.
Do you need to do that lookup or can't you be optimistic and have the server fail if there's a problem with a duplicate 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 naively assumed we didn't want duplicate and this wasn't supported. Fixed as we actually support this.
| } | ||
| return err | ||
| } else if ok { | ||
| fmt.Println("External service created:", *nameFlag) |
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.
| fmt.Println("External service created:", *nameFlag) | |
| fmt.Println("External service created: ", *nameFlag) |
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 is going to print two spaces, with your suggestion:
~/work/src-cli US jh/extsvc-add $ go run ./cmd/src extsvc create -kind GITHUB -name testjhf config.json
External service created: testjhf
* Add a add subcommand to extsvc In the context of scaletesting, it's pretty useful to be able to add code hosts on the fly, while toying with a test instance. This PR adds such a command. * fixup * Small fixes
In the context of scaletesting, it's pretty useful to be able to add code hosts on the fly, while toying with a test instance. This PR adds such a command.
Test plan
Manually tested.