Silent CI tool flaw: empty file sets falsely reported as passing checks
A software team discovered that one of their pre-commit checking tools was returning a PASS verdict even when it had scanned zero files, making a genuinely clean tree indistinguishable from one the tool had never actually read. The root cause was that running git ls-files inside a git archive export — which lacks a .git directory — caused the command to silently walk up to a parent repository, finding nothing and exiting without error. To fix the ambiguity, the team introduced a third verdict state, NOT RUN, which is triggered when the scanned file set is empty and includes the working directory and command used so reviewers can understand why no files were read. The team also uncovered a related issue where piping tool output through tail -6 silently dropped a key data line, causing recorded metrics in commit messages to reflect stale figures rather than the actual state of the codebase. Both fixes were verified to leave existing valid outputs byte-identical, and each tool's self-test suite was expanded to explicitly cover the empty-set scenario.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in