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