Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
WIP add combined status func to pull requests #897
Conversation
4e36909
to
b39f98f
|
I've left some in-line comments. There isn't really a direct API for this via the pull request. what's happening here is a convenience method making use of knowledge of how the APIs are structured, in that you could take a provided |
| def combined_status(self): | ||
| """ Retrieve the combined status for this Pull Request | ||
| :rtype: | ||
| :class:`~github3.repos.CombinedStatus` |
omgjlk
Oct 16, 2018
Collaborator
This would need a .. versionadded:: 1.3.0 to reflect when this function was added to the API.
This would need a .. versionadded:: 1.3.0 to reflect when this function was added to the API.
| :rtype: | ||
| :class:`~github3.repos.CombinedStatus` | ||
| """ | ||
| combined_status_url = self.statuses_url.replace('/statuses/', '/status/') |
omgjlk
Oct 16, 2018
Collaborator
This feels a bit clumsy, but I can't immediately think of a better way to do this. Perhaps another reviewer will have a suggestion.
This feels a bit clumsy, but I can't immediately think of a better way to do this. Perhaps another reviewer will have a suggestion.
markddavidoff
Oct 16, 2018
Author
I was also struggling to find a neater way :/ i don't see any other place we actually build urls so i had nothing to go off
I was also struggling to find a neater way :/ i don't see any other place we actually build urls so i had nothing to go off
sigmavirus24
Oct 17, 2018
Owner
What does statuses_url look like (when the API provides it)?
What does statuses_url look like (when the API provides it)?
markddavidoff
Oct 17, 2018
Author
you can find it here: https://developer.github.com/v3/pulls/
"statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e",
you can find it here: https://developer.github.com/v3/pulls/
"statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e",
|
@sigmavirus24 @omgjlk I don't know another way to do this, so before I write tests I'd like to know, is this is too smelly to get accepted? (Any chance that endpoint will be added to actual API?) |
I don't think either of us can answer that. This project works primarily from the developer.github.com documentation and secondarily from whatever the API's actual (not necessarily documented) behaviour is. By this I mean, we use the documentation to find what we might be able to do, and exercise the API to find out how it really works. At the moment, I'm leaning somewhat away from this. I believe combined statuses are currently specific to commits, and while that implementation detail really shouldn't be in every downstream integrator, it is available today. |
|
Changed the way the url is built, tests coming soon. |
No description provided.