fix(status): do not go quiet on a host whose units predate run records - #158
Merged
Conversation
Run records are written by the unit, so a host still running units from before this change has none. `ob status` had stopped reading systemd's own result entirely, which meant upgrading `ob` — with no deploy, no change on the host — turned a failing scheduled job into a clean report and an exit 0. That is the one direction this feature exists to close. With no records, systemd's retained result is the only evidence there is, and status uses it and says so: the issue names the failure and points at `ob schedule apply`, which is what starts the records. Once records exist they remain the verdict, and a stale systemd result raises nothing. Claude-Session: https://claude.ai/code/session_013MqwrF5NA179khDtEQdib5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
Found while preparing the first release that carries #156, and it should not ship as it stands.
Run records are written by the generated unit, so a host still running units from before that change has none.
ob statushad stopped querying systemd'sResultandExecMainStatusentirely and derived its verdict only from records. The consequence is that upgradingobon the workstation — no deploy, nothing changed on the host — turns a failing scheduled job into a clean report and an exit 0, until someone happens to runob schedule apply.That is the exact direction the feature exists to close, arriving as a side effect of installing it.
With no records at all, systemd's retained result is the only evidence there is, so status uses it and says what it is looking at:
Once records exist they remain the verdict, and a stale systemd result raises nothing.
Why this is correct
TestScheduleStatusFallsBackToSystemdWhenNoRecordsExistcovers the pre-upgrade host;TestScheduleStatusPrefersRecordsOverSystemdResultpins a retainedResult=timeoutlosing to asuccessrecord.just checkandjust lintpass.Effect on the safety envelope
Restores a divergence signal that #156 removed for hosts that have not been reconciled yet. It only adds an issue where status was silent; it cannot clear one.
Checklist
just checkpasses locally.just checkverifies this).https://claude.ai/code/session_013MqwrF5NA179khDtEQdib5