Skip to content

gardener workflows-off: the daily report shows each keep-on entry (#867 part 2) - #1412

Merged
scuttletoby merged 2 commits into
mainfrom
fork/867-gardener-keep-on
Nov 29, 2026
Merged

scuttletoby merged 2 commits into
mainfrom
fork/867-gardener-keep-on

Conversation

@scuttletoby

@scuttletoby scuttletoby commented Nov 29, 2026 •

Copy link
Copy Markdown
Owner

What

Part 2 of #867: one place that shows every keep-on entry's status. Part 1 (#1276) left "a single place that shows the status of every entry". That place is now the gardener's daily report issue, through its existing workflows-off check.

With the new option keepOnStatus (the path of schedule-kick's keep-on-status.json, absolute or ~/...), workflows-off reads keep-on's last pass. It makes no API call for this. For the check's repos:

  • A keeper that stopped. A status that is missing, unreadable or of another version is workflows.keep-on-unreadable (warn). A last pass older than keepOnMaxAgeMinutes (1 to 10080, default 30; keep-on runs every 15 s) is workflows.keep-on-stale (warn). One dated more than 5 minutes in the future (a wrong clock) is workflows.keep-on-future (warn). Either way, a workflow switched off since then stays off. The plain off warnings still show.
  • A pass that failed as a whole. A status with a top-level error (the pass broke: targets empty; or the config was refused: entries, no targets) is one workflows.keep-on-failed warning that quotes the error, with no "no entry" notes. The off workflows are then reported as if keep-on were not configured.
  • An entry's errors, pauses and warnings. These are workflows.keep-on-error (warn), workflows.keep-on-paused (note) and workflows.keep-on-warning (note). A whole-entry error reads OWNER/REPO (every workflow).
  • A repository with workflow files that keep-on has no entry for is a note (workflows.keep-on-none), so a project repo left out of keep-on is noticed. A repository with no workflow files is not: an every entry for it writes no target.
  • No paths in the report (it may be a public issue): findings name the status file by its base name, an unreadable file's error text drops its path, and a failed pass's error shows the home folder as ~.
  • Off on purpose is not a warning. A workflow that an entry's off list names (matched without case, as keep-on matches) is a note with the reason (workflows.off-meant) instead of a workflows.off warning. A workflow held since an every entry's first pass stays a warning, and its text says keep-on holds it and why.
  • Targets of other repositories in the same status file are left out: the project that lists those repositories reports them.

Without keepOnStatus, nothing changes. Docs: the gardener README (workflows-off) and the schedule-kick README (Keep-on, "The daily report").

State question (runs again, stops half-way, old or empty state): the check only reads the status file and writes nothing, so a second run gives the same findings. An old status is the keep-on-stale finding. A future-dated status is keep-on-future. A status whose pass failed is keep-on-failed, and, as with an unreadable one, nothing is shown as "meant". An empty, partly written or missing file is keep-on-unreadable, and the off workflows are then reported as if keep-on were not configured (the safe side: nothing is hidden as "meant").

Tests (red, then green)

New class WorkflowsOffKeepOn in fork-kit/gardener/tests/checks.test.py. Run against origin/main's check, all 11 tests fail. With the change, they pass, and so does the whole file (91 tests, about 30 s).

  • test_an_off_workflow_keep_on_means_off_is_a_note_with_its_reason: is a workflow in keep-on's off list (Old.yml in the repository, old.yml in off) a note with its reason, while the other off workflows stay warnings?
  • test_a_held_workflow_says_keep_on_holds_it: does a held workflow's warning say keep-on holds it, and does its fix name both ways out?
  • test_errors_pauses_and_warnings_of_these_repositories_only: are another repository's errors and warnings left out?
  • test_a_repository_keep_on_has_no_entry_for_is_a_note
  • test_an_old_last_pass_means_keep_on_has_stopped: is the result silent at 29 minutes, a finding at 31, and silent again with keepOnMaxAgeMinutes: 60?
  • test_a_missing_or_broken_status_is_a_warning_and_the_off_workflows_still_show: is this true for a missing file, a half-written file and version 2?
  • test_bad_options_fail_the_check: a relative path, 0 minutes, a string.
  • test_a_pass_that_broke_or_a_refused_config_is_one_warning_with_its_error: both of schedule-kick's error shapes; the error is quoted with ~ for the home folder.
  • test_a_last_pass_in_the_future_is_a_warning: silent at 3 minutes ahead, a warning at 60.
  • test_the_status_path_is_never_shown: a missing file and an old status with a warning; no finding holds the folder.
  • test_a_repository_without_workflow_files_needs_no_entry
  • RedCheck gets 13 rows: the off-list note, matching without case, the held text, staleness, the repository filter for warnings, the no-entry note, the version check, the failed pass, its ~, the future date, the base name, the OSError text without its path and the no-workflow-files repository. For each row, its test fails without the rule.

.github/fork-ci-tests.txt: unchanged (the file still runs in about 30 s, its listed weight is ~31 s).

Checks

vp fmt / vp lint on the changed files. The fork-checks scripts (schema, upstream files, seams) pass against origin/main.

Left for #867

  • An every entry for each project repository in the machine's private schedule-kick config, and keepOnStatus in the gardener's private config. Both are config only and not in this repository.
  • Turning on every for this fork itself first needs an off line for each workflow that is off on purpose (part 1 counted 29).

Part of #867

🤖 Generated with Claude Code

With keepOnStatus, the check reads schedule-kick's keep-on-status.json: a
keeper that stopped (missing, unreadable, other version, or a last pass
older than keepOnMaxAgeMinutes), each entry's errors, pauses and warnings,
a repository keep-on has no entry for, and the off workflows as keep-on
sees them (off on purpose with the reason: a note; held: a warning that
says so).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@scuttletoby

Copy link
Copy Markdown
Owner Author

lens: code · reviewer: Claude Opus 5.5 (code lens, round 1) · read at: a8f0485

major: a pass that broke is reported as "keep-on has no entry for this repository" (a note), and the error is not shown. When keepon.run raises, schedule-kick keep-on writes {"version": 1, "at": now, "ok": false, "error": "...", "targets": {}} (kick.py, the "the pass broke" branch). That file is fresh and has a targets dict, so the check passes it: no unreadable/stale warning, and workflows.keep-on-none (info) for every repository. If keep-on breaks on every tick, the daily report says the entry is missing instead of saying keep-on is failing. Reproduced with the PR's own WorkflowsOffKeepOn helpers (status above, repos example-owner/app): the only keep-on finding is workflows.keep-on-none info. Fix: read ok/error. A status with a top-level error (or ok: false and no targets) should be a warn finding that quotes the error, with no keep-on-none notes. Add a test for it.
minor: a refused config (refuse(..., 'keep-on-status.json')) writes "entries": {} and no targets, so the report says "cannot be read (not a keep-on status)" and drops the real error text. Showing status.get('error') when there is one would say why.
minor: a last pass with at in the future (clock skew) gives a negative age and is always silent. abs(age), or treating an at far in the future as unreadable, would catch it.
minor: workflows.keep-on-warning and keep-on-unreadable/stale use the status path as given as where. If someone configures an absolute home path and the report issue is public, that path shows there. The README could suggest the ~/... form.
minor: an every entry whose repository has no workflow files left (all gone) writes no target key, so it reads as "no entry" (a note only, harmless).

What holds: repository matching is case-insensitive at both ends (key repo part, names map back to the configured spelling, file names lowercased on both sides, as keep-on lowercases off). Warnings are filtered by their OWNER/REPO: prefix, which keep-on always writes. Other repositories' targets are dropped. off results become off-meant notes. held (first pass and over maxPerPass) stays a warning. Without keepOnStatus, targets is None and the plain workflows.off text and fix are byte for byte the same as main. Option validation is fine.

State question: the check only reads, so a second run gives the same result. keep-on writes the status atomically (tmp file + os.replace), so a half-written file cannot be read in practice, and a truncated one gives "unreadable" anyway. A missing file, an old version or a bad at gives "unreadable" (warn), and every off workflow still shows as a plain warning (the safe side). An old file gives "stale" (warn), but its off/held results are still used, so an old "off on purpose" note can hide a workflow that was later taken out of off. That is acceptable because the stale warning sits next to it. The gap is the fresh status that has an error (the major above).

🤖 Generated with Claude Code

…#867 lens round 1)

- A keep-on status with a top-level error (the pass broke, or the config
  was refused) is one keep-on-failed warning that quotes the error, with
  no keep-on-none notes; the home folder shows as "~".
- A last pass dated more than 5 minutes in the future is keep-on-future
  (warn), as a stale one is.
- Findings name the status file by its base name, and an unreadable
  file's OSError text no longer carries its path.
- A repository with no workflow files is not "no entry" (an every entry
  for it writes no target).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@scuttletoby

Copy link
Copy Markdown
Owner Author

Fix round 1 for the code lens (read at a8f0485), now at d67d120.

  • major: a status with a top-level error (a pass that broke, targets empty), or ok: false with no targets, is one workflows.keep-on-failed warning that quotes the error. It gives no keep-on-none notes, and the off workflows show as plain warnings. Test: test_a_pass_that_broke_or_a_refused_config_is_one_warning_with_its_error.
  • minor, refused config: the same path covers it (entries, no targets), so the real error is quoted instead of "not a keep-on status". Same test.
  • minor, future at: more than 5 minutes ahead is workflows.keep-on-future (warn). Test: test_a_last_pass_in_the_future_is_a_warning (silent at 3 minutes ahead).
  • minor, path in where: findings name the status file by its base name only. An unreadable file's OSError text (which names the path) is cut to its strerror, and a failed pass's error shows the home folder as ~. Test: test_the_status_path_is_never_shown, and the ~ case is in the failed-pass test.
  • minor, every with no workflow files: keep-on-none is now decided after the repo's workflow list is read, and only for a repository that has workflow files (not deleted). Test: test_a_repository_without_workflow_files_needs_no_entry. The existing no-entry test now gives both repos a workflow.

RedCheck gets 6 more rows: the failed pass, its ~, the future date, the base name, the OSError text and the no-workflow-files repo. Red then green: the 5 new or changed tests fail on a8f0485's check. The whole fork-kit/gardener/tests/checks.test.py passes (91 tests, about 30 s). Only that file was run. vp fmt / vp lint pass (pre-commit).

State question: the check still only reads, so a second run gives the same findings. A failed pass returns before any target is used, so nothing is hidden as "meant" (the safe side). A future-dated status is like a stale one: its targets are still used, next to the warning. A status left over from a failed pass and then replaced by a good pass reads as the good pass (keep-on writes it whole, with os.replace). Moving keep-on-none after the API call means a repository whose gh api call fails stops the check (as on main) before its no-entry note. That is no new gap, because the check already fails as a whole there.

🤖 Generated with Claude Code

@scuttletoby scuttletoby added the fork:merge-ready Merge conveyor: lenses done, merge when green (PRs) label Nov 29, 2026
@scuttletoby
scuttletoby merged commit 58d5f60 into main Nov 29, 2026
49 of 51 checks passed
@scuttletoby
scuttletoby deleted the fork/867-gardener-keep-on branch November 29, 2026 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork:merge-ready Merge conveyor: lenses done, merge when green (PRs)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant