ci(docs): enumerate tracked files instead of walking the filesystem#260
Merged
Conversation
docs:validate walked the working tree with a hardcoded skip list and never consulted .gitignore, so a required check reported a different verdict depending on what happened to be lying around on the developer's disk: docs:validate OK (12 Markdown files) <- locally docs:validate OK (8 Markdown files) <- CI, clean checkout The four extra files were scratch notes under .local/, deliberately untracked. That made the gate irreproducible, made it read files kept out of version control on purpose, and inverted its failure mode: a local note saved with CRLF or holding a conflict marker failed the gate on the author's machine while CI — which never had the file — passed. Ask git for the file set instead. The local result and the clean-checkout result are now the same set by construction rather than by coincidence of the skip list keeping pace with the directory layout. The fixtures become real repositories, because writing a file to disk no longer makes it visible to the gate. That is the property under test, so it is now asserted directly: untracked Markdown is ignored, and violations inside an untracked local note do not fail the run.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
docs:validatewalked the filesystem with a hardcoded skip list (.git,coverage,node_modules,reports) and never consulted.gitignore. Arequired check therefore returned a different answer depending on the
developer's disk:
The extras were scratch notes under
.local/, deliberately untracked.Three consequences, in increasing order of how much they matter:
a conflict marker fails
docs:validateon the author's machine while CIpasses, because CI never had the file. The gate fails the one person who
cannot see why, and passes for everyone who can.
Change
Enumerate with
git ls-files -z -- '*.md'.--rootsupport is kept for tests.The local set and the clean-checkout set are now identical by construction,
rather than by the skip list happening to keep pace with the directory layout —
which it had already stopped doing.
Acceptance
With
.local/present on disk:Note on the fixtures
They are now real git repositories. Writing a file to disk no longer makes it
visible to the gate — which is exactly the property being fixed, so it is
asserted directly rather than assumed: untracked Markdown is ignored, and
violations inside an untracked local note no longer fail the run. That last test
is the local-vs-CI inversion above, pinned so it cannot come back.
The drift this exposed, for the record: the audit measured 11 files, and it was
12 by the time the fix landed — a new untracked note had appeared in between.
The moving number is the argument.