-
-
Couldn't load subscription status.
- Fork 323
Provide build step information #1204
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
base: master
Are you sure you want to change the base?
Conversation
|
Can you maybe write a test for this? I think this would probably fit into Calling |
|
Thanks for taking a look at this @ajs124, appreciated!
Certainly, I've added one to the I also discovered that the swagger didn't like the |
3f0094d to
158e856
Compare
|
I do sometimes see the following warnings when running the unit tests, also happens on the |
Hi everyone,
As my colleague @mikepurvis described in #1193, we are in the process of incorporating some Nix builds running on Hydra into our Jenkins pipelines. An important aspect of this is making sure that it is clear for developers where to find the logs for build failures, with our transition to Nix we should be able to provide this in a more specific manner than we previously could. However, we could not find any API endpoint that actually provides information about the build steps that make up a build.
I think the (currently undocumented)
<build_id>/api/get-infoendpoint was supposed to provide this information, so in this PR I extended that endpoint to provide information about all the build steps that make up a build. With this newly available information about the results of each individual build step, we will be able to link directly to compilation logs for failed steps.Overview of changes:
<build_id/api/get-infoendpoint to include build steps, and made it (mostly) a superset of the current/build/<build_id>api endpoint, this should allow for uniform handling between the two. The old fields are preserved for backwards compatibility.buildToHashto ensure thebuildstatusandpriorityfields are always present.This is the first time I'm using Perl, one of the things I couldn't quite figure out is how the current build api endpoint (so
/build/<build_id) works. I reused this buildToHash function, but later noticed that this is not the function that provides that is used in the/build/<build_id>endpoint, as thebuild_statuskey was missing if the build was still ongoing. I think that endpoint is served by this as_json function. But I don't know enough Perl to figure out why we have two, or how I could call the latter to populate the results of theget-infoendpoint as a starting point and then add the steps to that. It would be the ideal case ifget-infois a superset of the simple/build/<build_id>api, currently it's close, but because there's two conversion functions it's not guaranteed. Ideally, these should be consolidated in the future to ensure the endpoints in the api are as consistent as possible.Another thing that's worth considering is changing the name from
/build/<build_id>/api/get-infoto/build/<build_id>/get-infothat would break backwards compatibility, but makes it more in line with the current api naming.