Target repo: halos-org/docs-tools
Goal: translation-status can fail a build. This is the unit that makes the
gate possible; it does not turn it on anywhere.
Requirements: R6, R7, R8, R9
Dependencies: Unit 2
Files:
- Modify:
src/halos_docs_tools/translation_status.py
- Modify:
tests/test_translation_status.py
Approach:
- Default behaviour is unchanged and still exits 0, so nothing that calls the
command today changes meaning.
- The check mode exits non-zero when any entry is
stale, missing,
unstamped or orphaned, evaluated across the whole repository rather than a
subset of pages.
- The failure output must name what failed. A non-zero exit with only a summary
count forces the reader into the job log to learn anything.
- Consequence to document in the repo README, not to code around: adding a
locale to mkdocs.yml makes every page missing in that locale until its
pages land, so a new locale arrives in one pull request (R9).
Execution note: Test-first — each of the four failing states should have a
red test before the exit-status logic exists.
Test scenarios:
- Happy path: a fully current tree exits 0 in check mode.
- Error path: one
stale page exits non-zero.
- Error path: one
missing page exits non-zero.
- Error path: one
unstamped page exits non-zero.
- Error path: one
orphaned page exits non-zero.
- Edge case: a page that is
current in eight locales and stale in the ninth
still exits non-zero.
- Edge case:
--only-pages does not narrow what the check mode considers —
the gate stays repo-wide even when the report is filtered.
- Happy path: without the check flag, the same failing tree still exits 0.
Verification:
- Against a clone of
halpi2 at main, check mode exits 0. Against PR
#47's branch, it exits non-zero
and names 108 entries.
Target repo:
halos-org/docs-toolsGoal:
translation-statuscan fail a build. This is the unit that makes thegate possible; it does not turn it on anywhere.
Requirements: R6, R7, R8, R9
Dependencies: Unit 2
Files:
src/halos_docs_tools/translation_status.pytests/test_translation_status.pyApproach:
command today changes meaning.
stale,missing,unstampedororphaned, evaluated across the whole repository rather than asubset of pages.
count forces the reader into the job log to learn anything.
locale to
mkdocs.ymlmakes every pagemissingin that locale until itspages land, so a new locale arrives in one pull request (R9).
Execution note: Test-first — each of the four failing states should have a
red test before the exit-status logic exists.
Test scenarios:
stalepage exits non-zero.missingpage exits non-zero.unstampedpage exits non-zero.orphanedpage exits non-zero.currentin eight locales andstalein the ninthstill exits non-zero.
--only-pagesdoes not narrow what the check mode considers —the gate stays repo-wide even when the report is filtered.
Verification:
halpi2atmain, check mode exits 0. Against PR#47's branch, it exits non-zero
and names 108 entries.