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

Build an OSS Patch Allowlist From One Failing Test

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

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

Задача

Issue threads often lead to patches that touch unrelated code, causing future regressions. A single failing test can be used as a precise merge oracle, but relying on issue comments is unreliable.

Результат

The workflow ensures that a patch only touches code exercised by the failing test, reducing the risk of regressions and making the PR easier to review.

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

  • 1. Ensure a clean working tree and fetch the target branch.
  • 2. Create a single test that reproduces the bug and name it after the issue number.
  • 3. Run that test to confirm it fails as expected.
  • 4. Collect coverage for that test only and generate an allowlist of covered files.
  • 5. Add the test file itself to the allowlist.
  • 6. Run a script that compares the current diff against the allowlist and exits with an error if any extra paths are present.
  • 7. Edit only the files in the allowlist, re‑running the test after each change until it passes.

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

An OSS patch is ready only after one named test flips. That named failing test is the merge oracle.

Источник

Coverage names every path the test actually executes. Files outside that map stay out of the commit.

Источник

  • Дата записи: 2026-09-22T13:00:23.835Z