Skip to content

Commit the upstream pin, and stop tests reading real checkouts - #39

Merged
tamnd merged 1 commit into
mainfrom
commit-the-upstream-pin
Aug 17, 2026
Merged

tamnd merged 1 commit into
mainfrom
commit-the-upstream-pin

Conversation

@tamnd

@tamnd tamnd commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Groundwork for the content repo's audit.yml, the last box on #11 before apply.

The pin has to be committed

S01 recounts the corpus against manifests/upstream.yaml and S02 needs the pinned upstream to say whether a msgid was edited. Both were reading the pin out of work/, which is run state and never leaves the machine that produced it. CI has no work/ directory and never will, so as it stood the two most important checks in the audit were the two that could only run where the answer was already known.

It moves to the content repo, which is where spec 02 §1 always had it, next to the glossary and for the reason already written on Paths.glossary: run state is disposable and this is not.

Paths.manifests is now that one directory, and the four glossary paths route through it rather than each spelling content / "manifests" again.

What the move found

Tests set PYDOCVI_UPSTREAM and PYDOCVI_WORK and left PYDOCVI_CONTENT alone. So:

  • The first pytest run after the config change wrote a four-entry fixture pin into the real content repo. Untracked, spotted in git status, removed.
  • Eleven TestTranslate tests had been reading the real checkout's manifests/glossary.yaml for as long as they have existed. They passed here and would fail on any machine without that checkout.

An autouse fixture in conftest.py now points all three paths at tmp_path before any test runs, and TestTranslate writes its own two-line contract. The failure mode this guards against is not a red suite. It is a green one that quietly wrote into a checkout nobody was looking at.

Checks

make check green: 1326 passed, 97.26% total. make secrets clean.

pydocvi sync re-run for real against the mirror, so the pin now in the content repo is the genuine one: tamnd/python-docs-vi@da475ff9, 548 files, 87,008 entries, 1,711,382 English words, 1,435 already translated. That lands in the content repo alongside the workflow.

The pin was written to work/manifests/upstream.yaml, which is run state and
never leaves the machine that produced it. S01 recounts the corpus against
that pin and S02 needs the pinned upstream to say whether a msgid was edited,
so a pin under work/ means the two checks that matter most are the two that
only ever run where the answer is already known. It goes to the content repo,
where spec 02 always had it, next to the glossary and for the same reason.

Paths.manifests is now that one directory and the four glossary paths route
through it, so a file cannot be written to one place and read from another.

The move surfaced what it was always going to surface. Tests set
PYDOCVI_UPSTREAM and PYDOCVI_WORK but left PYDOCVI_CONTENT alone, so the
first run after the move wrote a four-entry fixture pin into the real content
repo, and eleven translate tests turned out to have been reading the real
glossary all along. They passed on this machine and would fail anywhere else.
An autouse fixture now points all three at tmp_path before any test runs, and
TestTranslate writes its own contract. The failure mode this guards against
is not a red suite, it is a green one that wrote into a checkout nobody was
looking at.
@tamnd
tamnd merged commit c38c55a into main Aug 17, 2026
@tamnd
tamnd deleted the commit-the-upstream-pin branch August 17, 2026 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant