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 ability to list a single deployment, by id #996

Merged
merged 2 commits into from
Mar 31, 2018
Merged

Add ability to list a single deployment, by id #996

merged 2 commits into from
Mar 31, 2018

Conversation

russellballestrini
Copy link
Contributor

@russellballestrini russellballestrini commented Mar 29, 2018

Fixes #995

From the Github API I see that it is possible to fetch a single Github Deployment (https://developer.github.com/v3/repos/deployments/#get-a-single-deployment).

That said, at frst clance it doesn't appear that octokit supports this.

It seems like this file only needs the following (https://github.com/octokit/octokit.rb/blob/master/lib/octokit/client/deployments.rb):

@russellballestrini
Copy link
Contributor Author

@tarebyte could you help me figure out how to proceed? I'm hung on an error I'm not familiar with.

@tarebyte
Copy link
Member

@russellballestrini this you need to run the test locally in order to create a VCR cassette. It's basically a mock that tells the test what it should expect from the API request.

@tarebyte
Copy link
Member

I think I'm having trouble triggering VCR to create a new entry in the "cassette". Here is my PR: #996

Apologies I read this ^^ comment after I submitted my suggestion.

@tarebyte
Copy link
Member

@russellballestrini so the reason your test is having issues is because a lot of these tests are old and have been hard coded.

I took some time this morning to update the tests so that is not longer the case. Hopefully this should get this PR back on track 😄

def deployment(repo, deployment_id, options = {})
get("#{Repository.path repo}/deployments/#{deployment_id}", options)
end
alias :list_deployment :deployment
Copy link
Member

Choose a reason for hiding this comment

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

This alias doesn't really make sense, could we remove it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I could but I was following the pattern of the other methods. Does list mean "array" in this case or "look".

Copy link
Member

Choose a reason for hiding this comment

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

In this case list means "array"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cool! I'll fix

@russellballestrini russellballestrini changed the title WIP: Add ability to list a single deployment, by id Add ability to list a single deployment, by id Mar 30, 2018
Update the deployment tests to not rely on static data

	modified:   .gitignore
	modified:   lib/octokit/client/deployments.rb
	deleted:    spec/cassettes/Octokit_Client_Deployments/_create_deployment/creates_a_deployment.json
	deleted:    spec/cassettes/Octokit_Client_Deployments/_create_deployment/creates_a_deployment_with_a_payload.json
	deleted:    spec/cassettes/Octokit_Client_Deployments/_create_deployment_status/creates_a_deployment_status.json
	deleted:    spec/cassettes/Octokit_Client_Deployments/_deployment_statuses/lists_deployment_statuses.json
	modified:   spec/cassettes/Octokit_Client_Deployments/_deployments/lists_deployments.json
	new file:   spec/cassettes/Octokit_Client_Deployments/with_ref/_create_deployment/creates_a_deployment.json
	new file:   spec/cassettes/Octokit_Client_Deployments/with_ref/_create_deployment/creates_a_deployment_with_a_payload.json
	new file:   spec/cassettes/Octokit_Client_Deployments/with_ref/with_deployment/_create_deployment_status/creates_a_deployment_status.json
	new file:   spec/cassettes/Octokit_Client_Deployments/with_ref/with_deployment/_deployment/gets_a_single_deployment.json
	new file:   spec/cassettes/Octokit_Client_Deployments/with_ref/with_deployment/_deployment_statuses/lists_deployment_statuses.json
	modified:   spec/octokit/client/deployments_spec.rb
@tarebyte tarebyte mentioned this pull request Mar 30, 2018
@russellballestrini
Copy link
Contributor Author

@tarebyte please let me know what else needs to be done for this PR.

@tarebyte tarebyte merged commit f2a5ff1 into octokit:master Mar 31, 2018
@tarebyte
Copy link
Member

Nothing, thanks @russellballestrini !

@russellballestrini
Copy link
Contributor Author

@tarebyte would you know off chance if the team is considering a new release of octokit.rb? I'd like to use this new functionality. : )

@tarebyte
Copy link
Member

tarebyte commented May 8, 2018

This has been released as part of https://github.com/octokit/octokit.rb/releases/tag/v4.9.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants