Repository navigation
COMP: CI check that the remote-module list stays in sync (#4786) - #6410
jhlegarreta merged 1 commit into
Conversation
|
| Filename | Overview |
|---|---|
| .github/workflows/remote-module-list.yml | New CI workflow triggering on pull_request with correct path filters; the |
| Utilities/Maintenance/GenerateRemoteModuleList.py | New offline deterministic generator; two minor concerns: write_text without newline='\n' risks CRLF-vs-LF mismatches on Windows, and the greedy outer regex for itk_fetch_module(...) could produce an oversized inner string if a cmake file gains content with ) after the closing paren. |
| Documentation/remote_modules_classification.yaml | New YAML classification file; all kind values are documented and consistent with KIND_SECTIONS in the generator. No issues. |
| Documentation/docs/scientific_ecosystem/remote_modules.md | Generated documentation page with a 'do not edit by hand' banner, kept in sync by the new CI check. |
| Documentation/docs/index.md | Adds remote_modules.md to the TOC; one-line change, no issues. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[PR touches watched paths] --> B[remote-module-list.yml triggers]
B --> C[checkout and setup-python]
C --> D[pip install pyyaml]
D --> E[GenerateRemoteModuleList.py --check]
E --> F{Exit code?}
F -->|0| G[Step passes - file is up to date]
F -->|non-zero| H[echo error annotation and exit 1]
H --> I[CI step fails]
subgraph Generator internals
J[Modules/Remote/*.remote.cmake] --> K[parse_remote_cmake]
L[remote_modules_classification.yaml] --> M[load_classification]
K --> N[render]
M --> N
N --> O[generated content]
O --> P{compare with committed file}
P -->|match| Q[print OK and exit 0]
P -->|mismatch| R[raise SystemExit and exit 1]
end
E -.-> J
E -.-> L
Reviews (1): Last reviewed commit: "COMP: Add CI check that the remote-modul..." | Re-trigger Greptile
jhlegarreta
left a comment
There was a problem hiding this comment.
Thanks for doing this, Hans.
8e3a0b1 to
36ab16a
Compare
36ab16a to
6f408e7
Compare
6f408e7 to
07518c9
Compare
Run GenerateRemoteModuleList.py --check on pull requests that touch the remote-module sources or the generated page. The generator is offline and deterministic, so a stale page means a source (a *.remote.cmake file or the classification file) was edited without regenerating; the check fails with the regeneration command.
07518c9 to
6f9d678
Compare
|
@jhlegarreta This now incorporates all your requests. Let me know if you approve. |
Add a CI check that keeps the generated remote-module documentation page in sync with its sources, on top of the generator added in #6409 (now merged).
The generator is offline and deterministic, so the page can only drift when someone edits a
Modules/Remote/*.remote.cmakefile or the classification file without regenerating. This workflow runsGenerateRemoteModuleList.py --checkon PRs touching those paths and fails with the exact regeneration command if the committed page is stale.Why a PR check and not a scheduled regenerate job
The page depends only on in-repo files, so there is no external input for a periodic job to react to — a cron regenerate would always be a no-op. The PR-time check is the correct enforcement for the current offline design. A scheduled regenerate (and the bot PR it would open) becomes meaningful only once external data is introduced — the GitHub
itk-moduletopic scrape and per-repo CI status badges planned for the next PR — so it is deferred to that change.Validation
--checkexits 0.--checkexits 1 with the regeneration instruction.github.event.*input is interpolated into anyrun:step.