Skip to content

fix(daemon,hub): a running job is not counted as ready or live - #593

Merged
7schmiede merged 2 commits into
mainfrom
fix/571-job-running-not-ready
Nov 19, 2026
Merged

7schmiede merged 2 commits into
mainfrom
fix/571-job-running-not-ready

Conversation

@7schmiede

Copy link
Copy Markdown
Member

What and why

Since #544 a job (kind = "job") is running while it runs. #573 taught the daemon's checks that; two places still read a running job as "up":

  • Hub summary (The hub's summary counts a running job as ready #575): Scope::glance in crates/devstack-hub/src/notify/rules.rs counted a running job as ready, so a stack whose migration still ran showed as ready on the start page. It now counts as starting. The kind comes from the snapshot (a service event carries none).
  • Build timeline (A job's build shows as live while the job still runs #571): timeline::builds marked a job's build live as soon as it reported running, and it stayed live when the job then failed. For a job, a build is live once the job completed with exit code 0; the builds endpoint passes the service's kind.

No review card: no trust, concept, contract or term changes (the API's shapes are unchanged).

Bug fix

Cause running was read as ready/live without the job exception (#544 changed what running means for a job).
Bug class running-read-as-ready (as #573)
Proof Two new unit tests, both red before the fix at the expected assertion: a_running_job_counts_as_starting_not_ready (glance (2, 2, false) instead of (1, 2, true)), a_jobs_build_is_live_once_the_job_completed (ccc, bbb live instead of only aaa). Daemon 230/230, hub 176/176. In a stack (Windows, own build): a job that runs 25 s; while it ran devstack builds migrate listed no live build, after it completed fb37cbe23026 live. The hub's summary was not checked with a running hub of this build (unit test only).
Siblings Searched Status::Running, is_ready() and "running" across daemon, hub, CLI and node: the other readers already have the job exception (#573, commands.rs, client.rs). The dashboard's statusBucket counts a running job as healthy: #591.
Guard Tests per place; the dashboard sibling has its issue.

Closes #571
Closes #575

🤖 Generated with Claude Code

@7schmiede

Copy link
Copy Markdown
Member Author

Code review before 0.51.0, finding 2: a job rebuilt through the candidate showed interrupted while it ran and interrupted/superseded when it failed. A job's build is now running, then live or failed with its reason (19a81e4; the test replays the candidate events, red before with [interrupted, superseded, live]). docs/dashboard-api.md names the new outcome; the dashboard shows it like building.

7schmiede and others added 2 commits November 19, 2026 13:07
Since #544 a job is `running` while it runs. Two more places read that
as "up", without the job exception the daemon's own checks have (#573):

- The hub's summary (`Scope::glance`) counted a running job as ready, so a
  stack whose migration still ran showed as ready on the start page. It
  now counts as starting; the kind comes from the snapshot, as a service
  event carries none (#575).
- The build timeline marked a job's build live from its start, and kept
  it live when the job then failed. A job's build is live once the job
  completed with exit code 0; `GET /v1/services/{name}/builds` passes the
  service's kind (#571).

Closes #571
Closes #575

Bug-Class: running-read-as-ready
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… timeline

A rebuild of a job that does not run goes through the candidate, which
is cleared before the job starts: the entry stayed `building` and the
final pass made it `interrupted` while the job ran, and a job that then
failed showed `interrupted` (or `superseded` after the next change)
instead of `failed`. The service events now set a job's build to
`running` while it runs, `live` once it completed with exit code 0, and
`failed` with the status's reason; a `running` build that is not the
current one was interrupted. The test replays the candidate events.

Code review before 0.51.0, finding 2.

Bug-Class: running-read-as-ready
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@7schmiede
7schmiede force-pushed the fix/571-job-running-not-ready branch from 19a81e4 to f8928cc Compare November 19, 2026 12:07
@7schmiede
7schmiede merged commit 7571d97 into main Nov 19, 2026
26 of 28 checks passed
@7schmiede
7schmiede deleted the fix/571-job-running-not-ready branch November 19, 2026 12:25
7schmiede added a commit that referenced this pull request Nov 23, 2026
Since #591 and #593 a job that runs is not counted as ready, which is
right, but it went into "starting" instead: a training of hours in a lane
showed as a service stuck in its start, and its stack card said
"Starting" for a whole day.

- The dashboard's `statusBucket` has a bucket of its own for a running
  job (`job`): the overview counts it as "running as a job", with its own
  filter, neither healthy nor starting; a job's shortcut card is in the
  info tone.
- The hub's glance counts running jobs (`jobs`) instead of setting
  `starting`, so a stack with a running job is `ok`; the summary carries
  `jobs` and the started lanes' `lane_ready`/`lane_total` (additive, in
  `GET /hub/summary` and the `summary` event).
- The start page says "Running · 1 job", and shows the lanes' services
  ("Services in lanes 1/4") while nothing of the main tree is up and a
  lane runs, instead of 0/4.
- The mock hub gets `?mock=longjob` for it.

Verification: the new vitest cases failed before the change (`expected
'starting' to be 'job'`, the card's label and lane figures) and pass with
it; the hub's tests for the glance and the summary; the lane's dashboard
with `?mock=longjob` shows shop "Running · 1 job", crm "Services in lanes
1/4", and the overview's "1 running as a job" filter lists `migrate`.

Bug-Class: running-job-read-as-starting

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The hub's summary counts a running job as ready A job's build shows as live while the job still runs

1 participant