Make the wiki publisher a scoped workflow with an opt-in gate #62

Merged
Tirsvad merged 1 commits from mil-006-scoped-publisher into main 2026-10-10 05:39:34 +02:00
Owner

Makes the wiki publisher a scoped workflow with the opt-in gate decided in ADR-0004 (MIL-006 tasks 2 and 3, issues #57 and #58).

Changes

  • .gitea/scoped_workflows/publish-wiki.yml: the publish script is embedded (as in the metadata sync), so it needs nothing from tools/. Runs on push to main when wiki/** changes, and by dispatch; read-only permissions.
  • Removed: .gitea/workflows/publish-wiki.yml and tools/publish_wiki.py, so the workflow has one source.
  • wiki/.publish containing prune: this repository opts in, and its wiki must equal wiki/.
  • Behaviour:
    • no marker: the run ends successfully with one log line, no request, and the secret is not needed;
    • marker alone: pages are created and updated, others are kept and the log says how to remove them;
    • marker with prune: pages not in wiki/ are deleted;
    • any other marker content: refused before any request;
    • an empty wiki/ never deletes anything;
    • the secret is TOKEN_FOR_GITEA_WIKI of the organisation, with no fallback to TOKEN_FOR_GITEA; missing in an opted-in repository gives a configuration error.
  • Tests (144 pass): tests/test_publish_wiki.py runs the embedded script against a fake Gitea (opt-in, prune, no-prune, secret handling, error categories, token shape, workflow triggers and permissions); tests/workflow_source.py loads it.

Wiki pages changed (rule 8)

None.

Notes

  • Not yet verified on the instance: that the scoped workflow honours the paths: filter. If it does not, it runs in repositories without the marker and skips quickly. The pilot (issue #59) will confirm it.
  • Docs are stale until #60: the README and credentials guide still describe the TOKEN_FOR_GITEA fallback, which no longer applies. That is MIL-006 task 5 (issue #60), which also regenerates three wiki pages and their translations.
  • After this merges, ADR-0003 should be marked as superseded in part by ADR-0004 (RC-018 action item).
  • The first run on main publishes with prune, equal to today's behaviour.

Closes #57
Closes #58

Makes the wiki publisher a scoped workflow with the opt-in gate decided in ADR-0004 (MIL-006 tasks 2 and 3, issues #57 and #58). ## Changes - `.gitea/scoped_workflows/publish-wiki.yml`: the publish script is embedded (as in the metadata sync), so it needs nothing from `tools/`. Runs on push to `main` when `wiki/**` changes, and by dispatch; read-only permissions. - Removed: `.gitea/workflows/publish-wiki.yml` and `tools/publish_wiki.py`, so the workflow has one source. - `wiki/.publish` containing `prune`: this repository opts in, and its wiki must equal `wiki/`. - Behaviour: - no marker: the run ends successfully with one log line, no request, and the secret is not needed; - marker alone: pages are created and updated, others are kept and the log says how to remove them; - marker with `prune`: pages not in `wiki/` are deleted; - any other marker content: refused before any request; - an empty `wiki/` never deletes anything; - the secret is `TOKEN_FOR_GITEA_WIKI` of the organisation, with no fallback to `TOKEN_FOR_GITEA`; missing in an opted-in repository gives a configuration error. - Tests (144 pass): `tests/test_publish_wiki.py` runs the embedded script against a fake Gitea (opt-in, prune, no-prune, secret handling, error categories, token shape, workflow triggers and permissions); `tests/workflow_source.py` loads it. ## Wiki pages changed (rule 8) None. ## Notes - **Not yet verified on the instance:** that the scoped workflow honours the `paths:` filter. If it does not, it runs in repositories without the marker and skips quickly. The pilot (issue #59) will confirm it. - **Docs are stale until #60:** the README and credentials guide still describe the `TOKEN_FOR_GITEA` fallback, which no longer applies. That is MIL-006 task 5 (issue #60), which also regenerates three wiki pages and their translations. - After this merges, ADR-0003 should be marked as superseded in part by ADR-0004 (RC-018 action item). - The first run on `main` publishes with `prune`, equal to today's behaviour. Closes #57 Closes #58
Tirsvad added 1 commit 2026-10-10 05:39:17 +02:00
Make the wiki publisher a scoped workflow with an opt-in gate
Validate workflows / validate (pull_request) Successful in 12s
c4bbea4a2b
Embed the publish script in .gitea/scoped_workflows/publish-wiki.yml and
remove the repository workflow and tools/publish_wiki.py. A repository
publishes only when wiki/.publish exists; the word prune in it is the only
thing that lets the workflow delete pages. The organisation's
TOKEN_FOR_GITEA_WIKI is used with no fallback. This repository opts in with
prune. Tests run the embedded script against a fake Gitea.

Task: MIL-006#2
Task: MIL-006#3
Tirsvad merged commit e530ecd99d into main 2026-10-10 05:39:34 +02:00
Tirsvad deleted branch mil-006-scoped-publisher 2026-10-10 05:39:34 +02:00
Sign in to join this conversation.