Automate the upstream pin bump, derive the task table from source - #126
Merged
Conversation
…e pin bump Closes the two gaps left by the #124 fix, both of which would have let the same bug come back. 1. The pin had nothing moving it scripts/sources.toml claimed it was "bumped automatically by .github/workflows/romm-release-bump.yml", but that workflow never existed. That is why the pin sat on 5.1.0-beta.2 while upstream shipped 5.2.0, and why every env var added in between went undocumented. Adds the workflow it was already claiming to have. It polls daily for the latest rommapp/romm release, and also accepts a `romm-release` repository_dispatch so the romm repo can trigger it on publish, plus a manual dispatch for pinning a pre-release. On a new ref it regenerates all three snippets, formats them with the prettier version trunk pins, and opens a PR. The PR is opened with GITHUB_TOKEN, which does not trigger other workflows, so pr-checks will not run on it. The workflow therefore runs `mkdocs build --strict` inline, so a bump that breaks the docs never reaches review looking green. 2. The task table was hand-maintained gen_scheduled_tasks.py hardcoded its list, which is how every scheduled row's env var name came to be invented. It now reads the upstream registry: startup.py for what the scheduler init()s, endpoints/tasks.py for what the Tasks page can run by hand, and each task's own constructor for its title, enabled flag and cron default. Every env var name is resolved through env.template, and a task referencing a constant env.template does not define now fails the build instead of printing a guess. Anything the AST parser cannot resolve fails the same way rather than silently emitting something wrong. Watchers are not Task subclasses so they cannot be discovered this way. They stay declared, but their env vars go through the same env.template check. Task titles now match what the Administration -> Tasks page actually shows, since they come from the same constructor the UI reads. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
gantoine
force-pushed
the
docs/automate-source-sync
branch
from
August 31, 2026 12:06
695a13f to
065d609
Compare
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.
Stacked on #125. Review that one first — this PR's base is its branch, so the diff here is only the automation.
Closes the two gaps I flagged in #125. Both are the reason #124 happened, and both would let it happen again.
1. Nothing was moving the pin
scripts/sources.tomlclaimed it was "bumped automatically by.github/workflows/romm-release-bump.yml". That workflow never existed. The comment described an intent nobody implemented, which is exactly why the pin sat on5.1.0-beta.2while upstream shipped5.2.0, and why every variable added in between went undocumented.This adds the workflow the comment was already claiming. It:
rommapp/rommreleaseromm-releaserepository_dispatch, so the romm repo can trigger it on publish instead of waiting for the pollOne thing worth knowing: the PR is opened with
GITHUB_TOKEN, and PRs opened that way don't trigger other workflows, sopr-checkswon't run on the bump PR. Rather than leave that as a silent gap, the workflow runsmkdocs build --strictinline before opening. If you'd rather have the fullpr-checkssuite run, swapGITHUB_TOKENfor a PAT secret and the inline build becomes redundant.2. The task table was hand-maintained
gen_scheduled_tasks.pyhardcoded its list, which is how every scheduled row's env var name came to be invented. It now reads the upstream registry:backend/startup.pyinit()sbackend/endpoints/tasks.pybackend/tasks/**.pyenabledflag, cron defaultenv.templateThe important part is the guard: every env var name is resolved through
env.template, and a task referencing a constantenv.templatedoesn't define fails the build rather than printing a guess. Anything the AST parser can't resolve fails the same way instead of silently emitting something wrong. The*_INTERVAL_CRONnames fixed in #125 could not survive this check.Task titles now match what Administration → Tasks actually shows, since they come from the same constructor the UI reads. Watchers aren't
Tasksubclasses so they can't be discovered this way, and stay declared, but their env vars go through the sameenv.templatecheck.Testing
5.1.0-beta.2pin as well: it produces a correct, different table (9 scheduled, 4 manual) rather than erroring, confirming the guard fires on genuinely inconsistent input rather than on any change.mkdocs build --strictclean.trunk checkclean, includingactionlint,yamllintandcheckovon the new workflow.Note for #125
I also pushed a commit there optimizing the ZimaOS PNGs.
trunk checkrunsoxipngand flagged them, so as extracted from the PDF they would have failed that PR's own trunk-check. Lossless, 784K → 692K.🤖 Generated with Claude Code