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

Provide an API to query the build status by commit #872

Closed
hgrecco opened this issue Aug 5, 2014 · 18 comments
Closed

Provide an API to query the build status by commit #872

hgrecco opened this issue Aug 5, 2014 · 18 comments
Labels
Good First Issue Good for new contributors Improvement Minor improvement to code Sprintable Small enough to sprint on

Comments

@hgrecco
Copy link

hgrecco commented Aug 5, 2014

In order to do a check before release that everything is ok, I would like to have a way to obtain the current build status for a given commit. So, in addition to:

GET /api/v1/build/{id}/

also have this:

GET /api/v1/commit/{sha1}/

or

GET /api/v1/{user}/{project}/commit/{sha1}/

Is this possible right now?

@ericholscher
Copy link
Member

Neat. We currently don't record the commit hash for builds. This is a good idea, and would allow that kind of API.

@hgrecco
Copy link
Author

hgrecco commented Dec 9, 2014

Any news on this? Any way I can help?

@hgrecco
Copy link
Author

hgrecco commented Aug 25, 2015

New (simpler?) idea: Is it possible to insert the commit hash in the sphinx html? If it can be done already, then I just need to download the the page and check that it matches the version my latest hash.

@agjohnson
Copy link
Contributor

This should be part of newly built documentation with our theme already, we pass the commit hash in with via the API. We are storing the commit hash on the build object now, but we don't expose the commit as a first class endpoint in the api.

@gregmuellegger gregmuellegger added the Improvement Minor improvement to code label Sep 14, 2015
@ericholscher
Copy link
Member

You can find similar API endpoints here: https://github.com/rtfd/readthedocs.org/blob/master/readthedocs/restapi/views/core_views.py

Adding a build_status endpoint to that file with a test would be a good place to start.

@PeterJCLaw
Copy link
Contributor

This looks like it might have some overlap with #2251 which also adds commit ids to builds.

@RichardLitt
Copy link
Member

@agjohnson This "good first issue" is quite old. Can we improve the solution to fixing it, to encourage contribution? Same with #1045.

@Alig1493
Copy link
Contributor

Would it be possible to get a more up to date information on this issue? I'm interested to have a look. Thanks.

@humitos
Copy link
Member

humitos commented Jan 22, 2018

Would it be possible to get a more up to date information on this issue? I'm interested to have a look.

Thanks for your interest.

I think the original aspect of the issue is still valid: "build an API endpoint that receive a project and a commit hash and return the status (failed/success) of that build"

The Build object should have the commit hash: https://github.com/rtfd/readthedocs.org/blob/1af444173481df9a7b16e015fc6b12abe8155e7e/readthedocs/builds/models.py#L430-L431

So, I think we have all the information to create that endpoint. This could be next to the others at this file: https://github.com/rtfd/readthedocs.org/blob/1af444173481df9a7b16e015fc6b12abe8155e7e/readthedocs/restapi/views/model_views.py

@Alig1493 let me know if you are able to start with that info or not. Please, keep us updated on this :)

Thanks!

@Alig1493
Copy link
Contributor

Will the api endpoint be under v1 or v2?

@humitos
Copy link
Member

humitos commented Jan 23, 2018

v2 is the right place.
v1 is deprecated and shouldn't be used.

@safwanrahman
Copy link
Member

@humitos There are already api/v2/buid/<id>, so what should be the endpoint for this?

@humitos
Copy link
Member

humitos commented Jan 23, 2018

Yes. What I understood from the original report is to have the ability that given the sha and the project you can know the status of that build.

Now, a build id is needed, that you don't know how to get it from a sha.

Makes sense?

@safwanrahman
Copy link
Member

safwanrahman commented Jan 23, 2018

@humitos I have understand. I wanted to explain that, there are already a endpoint for api/v2/buid/<id>, so the getting with another endpoint like api/v2/buid/<commit hash> will make the user confuse.
So I was wondering, what the API endpoint will look like. Can you please clarify?

@humitos
Copy link
Member

humitos commented Jan 25, 2018

Can you please clarify?

What about /api/v2/build/commit/{hash}?

@shaddygarg
Copy link

Hey, I would like to contribute to this project. Can I take up this issue if no one is currently working on it?

@safwanrahman
Copy link
Member

@shaddygarg It has been already worked on by @Alig1493

@stsewd
Copy link
Member

stsewd commented Jun 15, 2018

#3544 (just linking the PR here)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue Good for new contributors Improvement Minor improvement to code Sprintable Small enough to sprint on
Projects
None yet
Development

No branches or pull requests