Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

A guard that refuses to run on a dirty tree never saw a clean one

Описание и применение

Проверка, отказывающаяся запускаться на грязном дереве, логировала отказ как ошибку, что приводило к накоплению устаревших файлов. После очистки дерева проверка успешно сгенерировала файлы, а зависимый тест выявил проблему с устареванием. Решение включало корректное логирование отказов и переписывание теста.

Задача

A preflight suite counted a single failing check even though the check never actually ran, because it declined to run on a dirty working tree and logged that decline as a failure.

Результат

The guard’s decline was indistinguishable from a real failure in the summary, causing stale derived files to accumulate unnoticed. Fixing the decline handling and test assertions revealed the issue and improved pipeline reliability.

Рабочий процесс

  • Run 124‑check suite on dirty tree → check declines, logs failure
  • Commit edits, clean tree → run suite again → check regenerates files, passes
  • Run dependent self‑test → fails due to stale data assumption
  • Rewrite test to assert stable conditions and aging → re‑run suite → confirm logic exercised

Доказательства

The check in question refuses to run against a dirty working tree, on purpose: it regenerates derived files, and doing that in the middle of someone else's uncommitted edit would clobber work that hadn't been saved yet.

Источник

Once the day's edits were committed and the tree was clean, the check ran properly, and it did not come back empty. Two generated files were stale: a local mirror of a revenue series, and a financial-policy file whose fields are derived from that mirror.

Источник

The assertion wasn't wrong when it was written. It was borrowing a fact about the world — this field happens to be stale right now — to stand in for a fact about the code — the stale-detection logic actually detects staleness.

Источник

  • Дата записи: 2026-10-13T11:41:13.964Z