Skip to content
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 DeleteDeployment for Repositories #1555

Merged
merged 3 commits into from Jun 17, 2020

Conversation

pablito-perez
Copy link
Contributor

Addresses #1554

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@codecov
Copy link

codecov bot commented Jun 9, 2020

Codecov Report

Merging #1555 into master will decrease coverage by 0.00%.
The diff coverage is 57.14%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1555      +/-   ##
==========================================
- Coverage   67.92%   67.91%   -0.01%     
==========================================
  Files          94       94              
  Lines        8670     8677       +7     
==========================================
+ Hits         5889     5893       +4     
- Misses       1880     1882       +2     
- Partials      901      902       +1     
Impacted Files Coverage Δ
github/repos_deployments.go 56.31% <57.14%> (+0.06%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dbeb049...e69b5e3. Read the comment docs.

@pablito-perez pablito-perez force-pushed the repositories-delete-deployment branch 2 times, most recently from 4837902 to 0499296 Compare June 9, 2020 14:27
@pablito-perez pablito-perez force-pushed the repositories-delete-deployment branch from 0499296 to 78dfc53 Compare June 9, 2020 14:29
@gmlewis
Copy link
Collaborator

gmlewis commented Jun 10, 2020

This looks great, @nomonamo - thank you!

Please make sure to sign the Google CLA (see instructions above), and then we can get it approved and merged.

@pablito-perez
Copy link
Contributor Author

@googlebot I signed it!

@pablito-perez
Copy link
Contributor Author

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.

What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@googlebot I signed it!

@gmlewis
Copy link
Collaborator

gmlewis commented Jun 10, 2020

@willnorris - when you get a chance, could you please give @nomonamo some guidance on getting the CLA issues straightened out? Thank you!

@pablito-perez
Copy link
Contributor Author

@googlebot I signed it!

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes Indication that the PR author has signed a Google Contributor License Agreement. and removed cla: no labels Jun 11, 2020
@pablito-perez
Copy link
Contributor Author

pablito-perez commented Jun 11, 2020

@willnorris - when you get a chance, could you please give @nomonamo some guidance on getting the CLA issues straightened out? Thank you!

Took us some time to get the "Corporate signer" CLA right :)
Thanks for your comment @gmlewis ! I'm not sure what to do about the checks from codecov though?

@gmlewis
Copy link
Collaborator

gmlewis commented Jun 11, 2020

I'm glad you got it fixed. We use the codecov tool as a guideline and not a strict blocker so you do not need to be concerned about it. Ideally, we will increase the code coverage by writing unit tests that cover more code paths.

t.Error("Repositories.DeleteDeployment should return an error")
}
if resp.StatusCode != http.StatusNotFound {
t.Error("Repositories.DeleteDeployment should return a 404 status")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the API docs, it looks like it should return 204 No Content on a successful request?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @nightlark.
@nomonamo - once you add the line above, then this can be changed to http.StatusNoContent and the 404 can be changed to 204.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case I was just adding a test for a non-existent deployment (id: 2), in an attempt to increase test coverage.

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one minor tweak, @nomonamo and then I think we will be good to get a second LGTM and then merge.


mux.HandleFunc("/repos/o/r/deployments/1", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "DELETE")
})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be:

		testMethod(t, r, "DELETE")
		w.WriteHeader(http.StatusNoContent)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I'll add a test for that status

t.Error("Repositories.DeleteDeployment should return an error")
}
if resp.StatusCode != http.StatusNotFound {
t.Error("Repositories.DeleteDeployment should return a 404 status")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @nightlark.
@nomonamo - once you add the line above, then this can be changed to http.StatusNoContent and the 404 can be changed to 204.

@pablito-perez
Copy link
Contributor Author

Thank you @nightlark and @gmlewis for reviewing 🙏 I've addressed your comments

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @nomonamo and @nightlark!
LGTM.

Awaiting second LGTM before merging.

Copy link
Collaborator

@wesleimp wesleimp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👌

@gmlewis
Copy link
Collaborator

gmlewis commented Jun 17, 2020

Thank you, @wesleimp!
Merging.

@gmlewis gmlewis merged commit 3312662 into google:master Jun 17, 2020
n1lesh pushed a commit to n1lesh/go-github that referenced this pull request Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Indication that the PR author has signed a Google Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants