MIL-001: Stabilise the metadata sync #26

Merged
Tirsvad merged 2 commits from mil-001-stabilise-metadata-sync into main 2026-10-03 14:52:26 +02:00
Owner

Summary

MIL-001 tasks 1-6: stabilise the metadata sync.

  • Restructures the Python embedded in .gitea/scoped_workflows/sync-github-metadata.yml into testable functions and fixes the invalid exit 0. An invalid push mirror list now logs a warning and the run succeeds; zero, several or malformed GitHub mirrors still fail. Errors print ERROR: <message> and exit 1.
  • Adds offline pytest tests in tests/ (workflow YAML, embedded Python, credential and mirror parsing, sync flow against a fake API) and .gitea/workflows/validate-workflows.yml, which runs them in a virtual environment on pull requests and pushes to main.
  • Removes tests/test_.ps1 and the duplicate src/ copy of the workflow; the scoped workflow is the canonical copy.
  • Updates the README and records the decisions for tasks 1 and 3 in MIL-001.

Notes for the reviewer

  • Behaviour change: the committed workflow failed on an invalid mirror list; it now skips with a warning (decision recorded in MIL-001 task 1).
  • actions/checkout@v4 in the validation workflow is pinned by tag, not commit SHA.
  • Task 7 (live run on Gitea) is not done: it needs this merged and the workflow triggered manually.

Issue #7 stays open.

Refs #1
Refs #2
Refs #3
Refs #4
Refs #5
Refs #6
Refs #7

## Summary MIL-001 tasks 1-6: stabilise the metadata sync. - Restructures the Python embedded in `.gitea/scoped_workflows/sync-github-metadata.yml` into testable functions and fixes the invalid `exit 0`. An invalid push mirror list now logs a warning and the run succeeds; zero, several or malformed GitHub mirrors still fail. Errors print `ERROR: <message>` and exit 1. - Adds offline pytest tests in `tests/` (workflow YAML, embedded Python, credential and mirror parsing, sync flow against a fake API) and `.gitea/workflows/validate-workflows.yml`, which runs them in a virtual environment on pull requests and pushes to `main`. - Removes `tests/test_.ps1` and the duplicate `src/` copy of the workflow; the scoped workflow is the canonical copy. - Updates the README and records the decisions for tasks 1 and 3 in MIL-001. ## Notes for the reviewer - Behaviour change: the committed workflow failed on an invalid mirror list; it now skips with a warning (decision recorded in MIL-001 task 1). - `actions/checkout@v4` in the validation workflow is pinned by tag, not commit SHA. - Task 7 (live run on Gitea) is not done: it needs this merged and the workflow triggered manually. Issue #7 stays open. Refs #1 Refs #2 Refs #3 Refs #4 Refs #5 Refs #6 Refs #7
Tirsvad added 2 commits 2026-10-03 14:49:10 +02:00
Restructure the script embedded in the scoped sync workflow into testable
functions, fix the invalid `exit 0` (now a successful run with a visible
warning when Gitea returns an invalid push mirror list) and report errors as
`ERROR: <message>` with exit code 1. Zero, several or malformed GitHub mirrors
still fail.

Add pytest-based offline tests (workflow YAML, embedded Python, credential and
mirror parsing, sync flow against a fake API) that run in a virtual
environment, and a validation workflow that runs them on pull requests and
pushes to main. Remove the manual tests/test_.ps1 probe and the duplicate
src/ copy of the workflow. Update the README and record the decisions for
tasks 1 and 3 in MIL-001.

Task: MIL-001#1
Task: MIL-001#2
Task: MIL-001#3
Task: MIL-001#4
Task: MIL-001#5
Task: MIL-001#6
Refs #1
Refs #2
Refs #3
Refs #4
Refs #5
Refs #6

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Resolve pending commit link in MIL-001 version history
Validate workflows / validate (pull_request) Successful in 16s
2228c49f29
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Tirsvad merged commit 10074323f0 into main 2026-10-03 14:52:26 +02:00
Tirsvad deleted branch mil-001-stabilise-metadata-sync 2026-10-03 14:52:26 +02:00
Sign in to join this conversation.