NixOS / hydra

Hydra, the Nix-based continuous build system
http://nixos.org/hydra
GNU General Public License v3.0
1.1k stars 291 forks source link

Allow build products on aggregate jobs #1269

Open Ma27 opened 1 year ago

Ma27 commented 1 year ago

Is your feature request related to a problem? Please describe. Right now the UI doesn't show build products (from $out/nix-support/hydra-build-products) if the job is an aggregate job: https://github.com/NixOS/hydra/blob/d6cbf227cba90cf281f72f464393d75a45f2f3a8/src/root/build.tt#L254

I'd like to change that. Use-case: I have a project that makes heavy use of NixOS vm tests and these tests also make screenshots. In the docs I'd like to provide screenshots and I wanted to take them directly from the VM tests.

To achieve that my idea was to collect all screenshots in an aggregate job and make them available by registering a build-product. The aggregate job already existed to have a gate which indicates that all tests are passing.

Describe the solution you'd like As suggested above, Hydra should allow aggregate jobs to provide build products.

Describe alternatives you've considered The alternative (that I'm currently using) is to create a non-aggregate job for that purpose, i.e. to collect screenshots from $out of all VM tests and create a build product for that.

However I don't like the solution because (1) it's effectively a second gate as it depends on all tests to succeed and (2) it's more expensive to evaluate because now the VM tests have to be evaluated for multiple jobs (i.e. because they're constituents of the aggregate job and for the screenshots-job).

Additional context n/a

cc @grahamc @dasJ @edolstra for more opinions. If you agree I'm happy to file a patch.