-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Add gh issue close <urlOrNumber>
#843
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 gh issue close <urlOrNumber>
#843
Conversation
Add test for closing issue Co-Authored-By: Nate Smith <[email protected]>
Co-Authored-By: Nate Smith <[email protected]>
Co-Authored-By: Nate Smith <[email protected]>
Co-Authored-By: Nate Smith <[email protected]>
Co-Authored-By: Nate Smith <[email protected]>
|
@ampinsk Made those changes. The red checkmark both seems correct and incorrect, but so does the green checkmark. So I say lets try it out. |
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'm just being nitpicky about testing
| if !strings.Contains(err.Error(), "issues disabled") { | ||
| t.Fatalf("got unexpected error: %s", err) | ||
| } | ||
| } |
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.
maybe a third test for the already closed state
test/fixtures/issueClose.json
Outdated
| @@ -0,0 +1 @@ | |||
| { "id": "hi" } | |||
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 think it would be fine to inline this? it's tiny and only used once. you can do:
http.StubResponse(200, bytes.NewBufferString(`{"id": "hi"}`))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.
Very good point...
|
@vilmibm I've got the changes you requested in |
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.
hot damn and hell yeah
This implements
gh issue close <issue number or url>. If it is already closed it outputs a warning. If the repo doesn't allow issues, then it results in an error.Below is an AMAZING screenshot of it it in action!
#413