Keepalive for living dataset jobs: result
Keepalive for living dataset jobs: result
Choice and why
A small native workflow, keepalive.yml, in each living repo. Once a month (03rd, 04:41 UTC, plus manual dispatch) it calls PUT /repos/<repo>/actions/workflows/<id>/enable for every workflow in the repo except ones disabled by hand, using the job's own GITHUB_TOKEN with actions: write.
- No secrets, no junk commits: the job's own token is enough, and nothing is written to the data history. A monthly empty commit was ruled out because it adds commits to the data history.
- No third-party action:
gautamkrishnar/keepalive-workflow(the same API re-enable approach) is blocked by GitHub for a terms-of-service breach (Repository access blocked, since 2025-04-21), souses:would fail. Writing the step ourselves also keeps outside code away from a write-scoped token. There is no version to pin: the step usesgh, which is preinstalled on runners. - Not a central job: one workflow re-enabling every repo would need a PAT or app secret with write access across the org. A per-repo job needs nothing extra.
- Residual risk: that re-enabling an already active workflow restarts GitHub's 60-day clock is how keepalive-workflow v2 works and is widely reported, but we can't prove it until about 27 Jan. The backstop is the nightly commons-check, which now reports any disabled workflow.
DataPressr (commit 064ba43, pushed to main)
templates/commons-dataset/.github/workflows/keepalive.yml: the template (living datasets only; a frozen dataset deletes it). The template README is updated.scripts/dataset-check.mjs:- A living dataset without a keepalive is an error if declared living and a warning if inferred.
- The keepalive is never counted as the refresh job, so a frozen repo is not inferred living because of it.
- The stock (org) run lists every workflow GitHub has disabled: an error if the dataset is declared living, a warning if inferred, a note if frozen.
docs/dataset-standard.md: rule 7 and the upkeep section now cover the keepalive.- Tests: 2 new; dataset-check 15/15 and the full suite 646/646 pass. There is a changelog entry. The
datapressr-dagbead has a note (item 6 done).
Repos changed (each commit adds only .github/workflows/keepalive.yml, pushed to main)
The 19 repos with upkeep.mode: living, plus eu-emissions-trading-system (unresolved, workflow left enabled):
| Repo | Commit |
|---|---|
| gdp-uk (pilot) | 86947a2 |
| inflation | 1d905ca |
| cash-surplus-deficit | b9edac4 |
| smdg-master-terminal-facilities-list | d88cc38 |
| gini-index | 1ccee42 |
| commodity-prices | 31b1181 |
| cpi | 575e577 |
| membership-to-copyright-treaties | ed15852 |
| gdp-us | 646ac84 |
| house-prices-us | f59489e |
| house-prices-uk | a091f00 |
| crime-uk | fffee79 |
| london-median-housing-affordability | 5c32fc8 |
| london-transport | fccb794 |
| house-prices-global | 06ae291 |
| interest-rates-gb | 2fd053a |
| cpi-change | 2f36cbc |
| us-measles-cases | 4395681 |
| us-drug-overdose-deaths | acfa17f |
| eu-emissions-trading-system | c474bd6 |
Frozen repos were not touched.
Verification (29 Nov)
- Workflow states:
gh api repos/datasets/<name>/actions/workflowsshows every workflowactivein all 20 repos, keepalive included. - Keepalive runs: a manual keepalive run succeeded in all 20. The gdp-uk log shows
enabled .github/workflows/actions.ymlandenabled .github/workflows/keepalive.yml, which proves the token has the permission it needs. - Push-triggered runs: the refresh and check runs set off by the push were green in every repo but eu-emissions-trading-system, which still fails because the EEA host is down (known; freeze if it is still down by the date in factory-but.10.30).
- Checker: the updated checker, run as the org (stock) run over the 20 repos, gave 19 with 0 errors (2 pass, 17 warn on old metadata) and 1 fail: eu-emissions-trading-system, for its failing refresh job only. None reported a missing keepalive or a disabled workflow.
Left
- Undeclared repos: about 50 repos have no
upkeepbut do have workflows. Those with a cron now get a "no keepalive" warning in the nightly. Fix: declare their upkeep first (living gets the keepalive, frozen drops the cron), not a blanket rollout. - Already disabled: 5 repos have a workflow GitHub has already disabled: covid-19, fips-10-4, co2-ppm-daily, socrata-opendata and opented. They were not in the 28 Nov triage; the nightly will now list them.
- Proof the clock resets: check the nightly in early February. Zero disabled workflows among the living repos means it works.
- Factory bead: factory-but.10.31.6.1 has a note and is ready to close.