dashboard: consolidate NodeView.has_log into build_log_id

Per mara's review on #2896: has_log: bool was fully redundant once
build_log_id: Option<i64> existed alongside it (has_log was always
just build_log_id.is_some()). Dropped has_log, threading the single
Option<i64> field through job_queue::mod.rs, the hivectl NodeView
test-helper literal, and the one remaining frontend consumer
(findLiveBuild's live-log-panel gate, which now checks
build_log_id != null instead of the separate bool).

Also fixed a now-stale doc comment on GET /api/build-log/{node_id}
that claimed the dashboard used on-demand node-id fetches "instead
of an inline build_log_id on the wire" -- no longer true after this
PR put one there for the BUILD L0GS deep-link.

cargo build/clippy/test clean across the three touched crates; nix
fmt clean; frontend build verified (0 has_log references, 3
build_log_id references in the built builds.js bundle).
This commit is contained in:
iris 2026-08-01 11:30:36 +02:00 committed by mara
commit 4c37ce9150
5 changed files with 13 additions and 18 deletions

View file

@ -105,16 +105,12 @@ pub struct NodeView {
/// node. Display-only payload, not derivable from the graph.
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub inputs: Vec<String>,
/// Whether this node has a captured build log fetchable at
/// `GET /api/build-log/<id>`. Only the nix-heavy nodes that stream build
/// output set one; the client gates its log link on this so lock / noop /
/// store-only nodes don't render a link that 404s.
#[serde(default)]
pub has_log: bool,
/// The underlying build-log history row id, when this node has a
/// captured log (`Some` iff `has_log`). Lets the client deep-link to the
/// rich BUILD L0GS tab view (`/builds.html?id=<id>#buildlogs`) instead of
/// only the raw-text download endpoint.
/// The build-log history row id, when this node has a captured build
/// log fetchable at `GET /api/build-log/<node id>` and deep-linkable to
/// `/builds.html?id=<this>#buildlogs`. Only the nix-heavy nodes that
/// stream build output set one; the client gates its log link on
/// `.is_some()` so lock / noop / store-only nodes don't render a link
/// that 404s.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub build_log_id: Option<i64>,
/// Structural parent in the jobq tree — `None` for top-level nodes