Skip to content

Create a proper build step details page#1685

Open
Ericson2314 wants to merge 2 commits into
NixOS:masterfrom
obsidiansystems:webapp-more-step
Open

Create a proper build step details page#1685
Ericson2314 wants to merge 2 commits into
NixOS:masterfrom
obsidiansystems:webapp-more-step

Conversation

@Ericson2314
Copy link
Copy Markdown
Member

Please review the commits in order, and see each commit message for details.

@Ericson2314
Copy link
Copy Markdown
Member Author

@mweinelt While the last commit adds a redirect from nixlog so users get no breaking change, I suspect a deployment config change might be needed to change a nixlog/n/raw -> S3 redirect to a step/n/log/raw S3 redirect?

In other words, while there isn't a user-facing breaking change, I think there is a sysadmin-facing breaking change.

@mweinelt
Copy link
Copy Markdown
Member

I don't believe we currently do any redirects to S3 ourselves.

https://github.com/NixOS/infra/blob/main/build/hydra-proxy.nix#L68-L102

@Ericson2314
Copy link
Copy Markdown
Member Author

OK Thanks @mweinelt. I guess, we will see!

@Ericson2314 Ericson2314 added this pull request to the merge queue May 2, 2026
@Ericson2314 Ericson2314 removed this pull request from the merge queue due to a manual request May 2, 2026
@Ericson2314 Ericson2314 added this pull request to the merge queue May 2, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 2, 2026
@Ericson2314 Ericson2314 force-pushed the webapp-more-step branch 5 times, most recently from 28c88fb to a32fefe Compare May 4, 2026 22:11
Soon, we're going to make a new build step page which will share a
number of things with the build page.

In order to get ready for that, extract the following into a new
`build-common.tt` for reuse:

- `renderOutputs`
- `renderOutputsTable`
- `renderStepStatus`
- `renderStepDuration`
- `renderStepMachine`
- `renderLogButtons`

Likewise, move the `showLog` helper out of `Build.pm` into
`Hydra::Helper::LogEndpoints`. Both are needed by the BuildStep
controller introduced in a later commit.

As a bonus, the new `renderLogButtons` is already used twice within
`build.tt` itself (for the build log and the runcommand log),
deduplicating previously identical button markup.

No behavior changes.
Build steps are, in my view, an important concept that Hydra doesn't
yet give enough attention. This is my attempt to rectify that.

A new detail page at `/build/:id/step/:stepnr` shows output paths,
derivation, system, machine, duration, status, and log links, reusing
the shared blocks extracted in the previous commit. Clicking anywhere in
the build steps table row now navigates to this page, instead of the
step log page. The step log pages also have a link back to this page.

Also reflecting giving build steps more status, introduce
`Hydra::Controller::BuildStep`, chained off `/build/buildChain`, giving
them a first-class controller.

For a bit of back story, note that in the future, we might switch
associating build steps more with derivations than builds. This
reflects that we don't really care *why* something was scheduled (the
build/root derivation) as much as *what* was scheduled, especially when
multiple new builds would "race" to schedule the same derivation. It
also bodes well for a future where Hydra can act as a Nix derivation
that receives ad-hoc build requests, so the "build" in this case would
be rather lacking in metadata. Both these scenarios point to a world
where `BuildStep`s become more important than `Build`s, building (ahem)
atop this refactor.

The step log handling is now better suited to live as part of this
controller. Accordingly, it is moved from
`/build/:id/nixlog/:stepnr[/raw|/tail]` to
`/build/:id/step/:stepnr/log[/raw|/tail]`. The old `nixlog` URLs are
preserved as 301 redirects in `Build.pm`. All templates updated to
generate the new canonical URLs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants