GeezerVison is showing github.com — repos-janitor: the cross-repo check, every 6 hours · openlogix/.github@743dfd6
File treeExpand file treeCollapse file tree Open diff view settings remote-config/logix-engine
openlogix.github.io/files/docs/schemas
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .github/workflows/actions-test.yaml +13Lines changed: 13 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -118,6 +118,19 @@ jobs: | 118 | 118 | # -- check-remote-config: the checker on every case (with a fake gh that | 119 | 119 | # -- answers from fixture releases), then the action itself, passing on a | 120 | 120 | # -- good config and on a pre-release, failing on one with require-stable. | | 121 | + # -- repos-janitor: every check against a fixture org, with a fake gh. | | 122 | + test-repos-janitor: | | 123 | + runs-on: ubuntu-latest | | 124 | + steps: | | 125 | + - name: Checkout this repo | | 126 | + uses: actions/checkout@v7 | | 127 | + | | 128 | + - name: Run the janitor's tests | | 129 | + run: | | | 130 | + python3 -m venv "$RUNNER_TEMP/venv" | | 131 | + "$RUNNER_TEMP/venv/bin/pip" install --quiet jsonschema==4.26.0 | | 132 | + PATH="$RUNNER_TEMP/venv/bin:$PATH" tests/repos-janitor/run.sh | | 133 | +
| 121 | 134 | test-check-remote-config: | 122 | 135 | runs-on: ubuntu-latest | 123 | 136 | steps: | |
Collapse file Copy file name to clipboard +64Lines changed: 64 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +# repos-janitor: checks across the Open Logix repos what no single repo's CI | | 2 | +# can see (remote configs, expiring pre-releases, stale pins, rebuilt | | 3 | +# releases, schema copies, daily runs, releases) and reports it in this | | 4 | +# run's summary; the run fails on any failure, so its badge turns red. The | | 5 | +# design is in this repo's CLAUDE.md (repos-janitor). Read-only, with this | | 6 | +# run's own token: the repos are public. | | 7 | +# | | 8 | +# Every 6 hours, as Apio's janitor; the 03:00 run comes three hours after | | 9 | +# the 00:00 UTC daily builds and tests start. Not triggered by the product | | 10 | +# repos' builds: that would need a token in each of them that can write | | 11 | +# here. | | 12 | + | | 13 | +name: repos-janitor | | 14 | + | | 15 | +on: | | 16 | + schedule: | | 17 | + - cron: "0 3,9,15,21 * * *" | | 18 | + workflow_dispatch: | | 19 | + | | 20 | +permissions: | | 21 | + contents: read | | 22 | + actions: read | | 23 | + | | 24 | +concurrency: | | 25 | + group: repos-janitor | | 26 | + cancel-in-progress: false | | 27 | + | | 28 | +jobs: | | 29 | + janitor: | | 30 | + runs-on: ubuntu-latest | | 31 | + timeout-minutes: 15 | | 32 | + steps: | | 33 | + - name: Checkout this repo | | 34 | + uses: actions/checkout@v7 | | 35 | + | | 36 | + # In a venv of its own: runners refuse pip installs into the system | | 37 | + # Python. jsonschema is for check-remote-config's script, which check 1 | | 38 | + # runs. | | 39 | + - name: Install jsonschema | | 40 | + run: | | | 41 | + python3 -m venv "$RUNNER_TEMP/venv" | | 42 | + "$RUNNER_TEMP/venv/bin/pip" install --quiet --disable-pip-version-check jsonschema==4.26.0 | | 43 | +
| | 44 | + # The SHA-256s the last run saw (check 4: rebuilt releases). A new | | 45 | + # cache entry every run; restoring takes the newest. | | 46 | + - name: Restore the last run's state | | 47 | + uses: actions/cache/restore@v6 | | 48 | + with: | | 49 | + path: janitor-state.json | | 50 | + key: repos-janitor-state-${{ github.run_id }} | | 51 | + restore-keys: repos-janitor-state- | | 52 | + | | 53 | + - name: Check the repos | | 54 | + env: | | 55 | + GH_TOKEN: ${{ github.token }} | | 56 | + run: '"$RUNNER_TEMP/venv/bin/python" repos-janitor/janitor.py --state janitor-state.json' | | 57 | + | | 58 | + # Saved even when a check failed, so the next run compares with it. | | 59 | + - name: Save the state | | 60 | + if: always() | | 61 | + uses: actions/cache/save@v6 | | 62 | + with: | | 63 | + path: janitor-state.json | | 64 | + key: repos-janitor-state-${{ github.run_id }} |
Collapse file Copy file name to clipboard +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | .DS_Store | | 2 | +__pycache__/ |
Collapse file Copy file name to clipboardExpand all lines: CLAUDE.md +4-4Lines changed: 4 additions & 4 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -13,12 +13,12 @@ Guidance for Claude working in this repo, `openlogix/.github`. It is GitHub's sp | 13 | 13 |
| 14 | 14 | Don't put product-owned things here, such as the engine's tool schemas or catalog. They stay in their product repo. | 15 | 15 |
| 16 | | -## repos-janitor (designed 2026-11-12, not built yet) | | 16 | +## repos-janitor (built 2026-11-12) | 17 | 17 |
| 18 | 18 | A workflow here that checks what no single repo's CI can see and reports problems in one place, modeled on Apio's janitor. The user's decisions (from the proposal doc, now obsolete): | 19 | 19 |
| 20 | | -- **Name:** `repos-janitor`, also on its badge ("check" undersold it: it will also fix later). Files: `.github/workflows/repos-janitor.yaml` and `repos-janitor/janitor.py`. | 21 | | -- **When:** every 6 hours, at 03:00, 09:00, 15:00 and 21:00 UTC (as Apio's; the 03:00 run is three hours after the 00:00 UTC builds and tests start), right after each repo's daily build (its last step sends a `repository_dispatch` event here, which needs a token that can write to this repo: a GitHub App or a fine-grained token, as a secret in each repo), and manually. | | 20 | +- **Name:** `repos-janitor`, also on its badge ("check" undersold it: it will also fix later). Files: `.github/workflows/repos-janitor.yaml` and `repos-janitor/janitor.py` (Python, the gh CLI with the run's own token; `PLATFORMS`, the platforms configs must serve, gets Windows and Linux with Milestones 3 and 4; the thresholds are constants at its top; the pre-release count comes from `actions/release-policy.sh`). It skips its own workflow in check 6. The state for check 4 is `janitor-state.json`, restored from and saved to the Actions cache (a new key per run, saved even when the run fails). A full run takes about a minute. | | 21 | +- **When:** every 6 hours, at 03:00, 09:00, 15:00 and 21:00 UTC (as Apio's; the 03:00 run is three hours after the 00:00 UTC builds and tests start), and manually. It must stay quick (a few minutes): API reads only, no checkouts of other repos beyond the files it reads. Not after each repo's build (deferred indefinitely, the user's decision 2026-11-12): a `repository_dispatch` from the product repos would need a token that can write to this repo stored in each of them, giving every product repo's developers write access to the org repo. **Access rule** (the user's, 2026-11-12): this repo may get access to the product repos (such as a token or GitHub App for fixes later), never the other way around. | 22 | 22 | - **Which repos:** every public repo in the `openlogix` org, found through the API; each check applies to the repos that have what it checks (a `remote-config/` folder, scheduled workflows, releases), so a new repo needs no list edit. Read-only, with the workflow's own token (the repos are public). | 23 | 23 | - **Checks** (start with these seven; keep, drop or add later; a candidate to add: the org page's table and the website README's Status section list every repo and workflow). A failure is something broken now; a warning, something that breaks soon or needs a person: | 24 | 24 | 1. Remote configs on `main`: each repo's config files pass `check-remote-config` (runs that action's script, so there's one definition of a valid config). Fails: any doesn't. | @@ -29,7 +29,7 @@ A workflow here that checks what no single repo's CI can see and reports problem | 29 | 29 | 6. Daily runs: fails when a workflow's latest scheduled run on `main` failed; warns when it didn't run in the last 26 hours. | 30 | 30 | 7. Releases: fails when a day's pre-release lacks `SHA256SUMS` or `BUILD-INFO.json`, or lists a file it doesn't have. | 31 | 31 | - **Report:** a table in the run's summary page (repo, check, pass, warn or fail, the reason, a link); the run fails on any failure, so its badge turns red; the badge goes in the website README's Status section as `repos-janitor`. That's all for now: a GitHub issue here that it opens, updates and closes (GitHub emails the watchers), and email to developers (needs an SMTP account and a mail action) come after the public release. GitHub already emails a scheduled run's failure to whoever last changed its schedule. | 32 | | -- **Tests:** as `check-remote-config`'s: a fake `gh` with fixture releases and files, a case per check, run by `actions-test.yaml`. | | 32 | +- **Tests:** `tests/repos-janitor/run.sh`: a fake `gh` (`fake-gh/gh`, Python) answering from a fixture org (`org/repos/openlogix/<repo>/`: `files/`, `releases.json`, `sums/<tag>`, `runs/<workflow>.json`) where each check fires once, and a state file with a changed SHA-256; the output must be exactly the expected findings (sorted by result, repo, check). Run by `actions-test.yaml` (`test-repos-janitor`). | 33 | 33 | - **Not now: fixes**, including auto-repin (when check 2 warns, a pull request moving the config to the newest pre-release, tested by that repo's CI and merged only after review; needs a write token, a GitHub App). Fixing comes after the reports have proved right for a while. | 34 | 34 |
| 35 | 35 | ## Action rules | |
Collapse file Copy file name to clipboardExpand all lines: README.md +5Lines changed: 5 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| 8 | 8 | [](#license) | 9 | 9 |
| 10 | 10 | [](https://github.com/openlogix/.github/actions/workflows/actions-test.yaml) | | 11 | +[](https://github.com/openlogix/.github/actions/workflows/repos-janitor.yaml) | 11 | 12 |
| 12 | 13 | Shared GitHub Actions and org-wide files for the [Open Logix](https://www.openlogix.org) repos. | 13 | 14 |
| @@ -48,6 +49,10 @@ The pre-release policy (pre-releases are kept about 5 days unless made stable) i | 48 | 49 |
| 49 | 50 | [actions-test.yaml](.github/workflows/actions-test.yaml) tests every action on each change and daily. | 50 | 51 |
| | 52 | +## repos-janitor | | 53 | + | | 54 | +[repos-janitor.yaml](.github/workflows/repos-janitor.yaml) checks across the Open Logix repos every 6 hours what no single repo's CI can see: remote configs on `main`, pre-releases they name that are about to expire, stale pins, releases rebuilt under the same tag, the website's schema copies, every repo's daily runs, and that releases have their `SHA256SUMS` and `BUILD-INFO.json`. Its run summary lists what it found; the run, and its badge above, go red on any failure. It only reads, and only reports for now. | | 55 | + | 51 | 56 | ## Versions | 52 | 57 |
| 53 | 58 | Workflows use the latest version, `@main`, so a fix reaches every repo as soon as it's pushed. Changes are tested by [actions-test.yaml](.github/workflows/actions-test.yaml). | |
|