Scripts: replace coverage baselines atomically #2645

Open
github-bot wants to merge 1 commit from github-bot/gh-2645 into main AGit
Owner

@⁠luckyteagirl on GitHub · 2026-11-26 04:54 UTC · original
luckyteagirl:codex/coverage-atomic-baseline → main · +72 −3 · 2 files · 1 commits · open

The coverage gate opens the existing baseline for writing, which truncates it before the new JSON is written. An interrupted write can leave later comparisons without a readable baseline. Write the report to a temporary file beside the baseline and replace the destination after the write succeeds.

What is in it

  • Stage and replace the baseline atomically, with cleanup and an error message on failure.
  • Preserve the existing baseline's mode on POSIX.
  • Test preservation of mode and contents, cleanup after a failed replacement, and successful retry.

Tested

  • Windows 11 build 26200, Ryzen 9 5980HX, Python 3.11.9.
  • With the failed-replacement regression and the implementation from main at b49be183, coverage gate tests ran with 9 passed, 1 failed, 0 skipped. The update incorrectly returned success despite the injected replacement failure.
  • On this commit, python -B -m unittest discover -s scripts -p 'test_*.py' ran on Windows with 26 passed, 0 failed, 1 skipped (the POSIX mode test).
  • On Ubuntu under WSL with Python 3.14.4, the POSIX regression failed on the previous PR revision (10 passed, 1 failed, 0 skipped), which set mode 0600 instead of 0664. The full Python suite on this commit ran with 27 passed, 0 failed, 0 skipped.
  • The local PR description checker passed.

Regression run

  • Not applicable to this scripts-only change.

Not tested

  • Rust workspace suite, GPU tests, and retail title smoke runs.

AI use

  • Codex (GPT-6.2-Sol) implemented and tested the change and drafted this description.
**@⁠luckyteagirl** on GitHub · 2026-11-26 04:54 UTC · [original](https://github.com/xcl-dev/xcl/pull/2645) `luckyteagirl:codex/coverage-atomic-baseline` → `main` · +72 −3 · 2 files · 1 commits · open The coverage gate opens the existing baseline for writing, which truncates it before the new JSON is written. An interrupted write can leave later comparisons without a readable baseline. Write the report to a temporary file beside the baseline and replace the destination after the write succeeds. **What is in it** - Stage and replace the baseline atomically, with cleanup and an error message on failure. - Preserve the existing baseline's mode on POSIX. - Test preservation of mode and contents, cleanup after a failed replacement, and successful retry. **Tested** - Windows 11 build 26200, Ryzen 9 5980HX, Python 3.11.9. - With the failed-replacement regression and the implementation from main at b49be183, coverage gate tests ran with 9 passed, 1 failed, 0 skipped. The update incorrectly returned success despite the injected replacement failure. - On this commit, `python -B -m unittest discover -s scripts -p 'test_*.py'` ran on Windows with 26 passed, 0 failed, 1 skipped (the POSIX mode test). - On Ubuntu under WSL with Python 3.14.4, the POSIX regression failed on the previous PR revision (10 passed, 1 failed, 0 skipped), which set mode 0600 instead of 0664. The full Python suite on this commit ran with 27 passed, 0 failed, 0 skipped. - The local PR description checker passed. **Regression run** - Not applicable to this scripts-only change. **Not tested** - Rust workspace suite, GPU tests, and retail title smoke runs. **AI use** - Codex (GPT-6.2-Sol) implemented and tested the change and drafted this description.
Stage the complete coverage report beside the destination before replacing it. If the replacement fails, keep the previous baseline and clean up the temporary file. Preserve the existing baseline mode on POSIX.

Assisted-by: Codex (GPT-6.2-Sol)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:14:30 +00:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2645/head:github-bot/gh-2645'
git switch 'github-bot/gh-2645'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2645'
git switch 'github-bot/gh-2645'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2645'
git switch 'github-bot/gh-2645'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2645'
git switch 'main'
git merge --squash 'github-bot/gh-2645'
git switch 'main'
git merge --ff-only 'github-bot/gh-2645'
git switch 'main'
git merge 'github-bot/gh-2645'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.