Skip to content

feat(tools): check generated release notes without writing - #12880

Merged
oneandonlydean merged 3 commits into
boykopovar:mainfrom
StoneDC:b41/release-notes-check
Nov 2, 2026
Merged

oneandonlydean merged 3 commits into
boykopovar:mainfrom
StoneDC:b41/release-notes-check

Conversation

@StoneDC

@StoneDC StoneDC commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

What

Add prepare_release_notes.py --check to compare both generated release-note outputs byte for byte. It returns 0 when both match, 1 when either is missing or stale, and preserves the existing usage-error status for malformed inputs. Check mode does not create or rewrite outputs.

Addresses the second-output coverage review: restore a matching body, then independently stale and remove only the full notes. Each case must return 1 while preserving all remaining file bytes and modification times. The review follow-up changes only the fixture; the correct production comparison is retained.

Tested

Exact tested head 553855ae92eed801766c4dd5227044b11d298c41 on current main bb04a4f1ea0175e9e4f149f0359a764d62ff3296. Windows / MinGW GCC 15.2, CMake 4.3.1, Python 3.14.3; Ubuntu/WSL / GCC 15.2, CMake 4.2.3, Python 3.14.4. Python-only checks do not claim a C++ build.

ctest --test-dir <build> -R "^(release_package|tools_release_notes_check)$" --parallel 2 -V: both groups pass on each platform, executing 2 check-mode tests and 65 existing packaging/release tests. The existing packaging suite reports 14 platform/environment skips on Windows and 5 on Linux. No CTest groups skip; check-mode tests have no skips.

On each OS, remove only the full-output comparison from the real production tool while retaining the current fixture: it fails the new stale-full assertion. Both stale-full and missing-full checks verify unchanged bytes and mtimes for every remaining file. No release publication, generated release upload or product build was performed.

Current-main conventions with this complete description, whitespace, script registration and Python 3.9 grammar checks pass. Actual unittest discovery retains every test from the previously published head, with no duplicate classes or methods in changed files. Linux source archives are initialized as local Git snapshots for checks that require a file index/current revision. No test timeout was raised. New hosted CI starts after publication; previous-head passes are not substituted for the updated head.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 1835 CMakeLists.txt
PR 5021 CMakeLists.txt
PR 7642 CMakeLists.txt
PR 9539 CMakeLists.txt
PR 10193 CMakeLists.txt
PR 13578 CMakeLists.txt
PR 13928 CMakeLists.txt
PR 13929 CMakeLists.txt
PR 14212 CMakeLists.txt
PR 14264 CMakeLists.txt

@malekaifa malekaifa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed exact head 68828a4645f21cca24bdb3cd40f15adc4daf942d. The production path is appropriately byte-oriented: generation stages UTF-8 through binary xb writes, and --check compares raw bytes, so there is no Windows newline-translation mismatch. The focused suite passes 2/2 on Windows Python 3.12 and WSL Python 3.12.3, including no-write/mtime preservation and malformed-input status handling.

I found one focused contract-test gap before approval. The feature promises to check both generated outputs, but the fixture independently stales only body. I replaced

return body.read_bytes() == body_text.encode("utf-8") and full.read_bytes() == notes.encode("utf-8")

with just the body comparison, and both new tests still pass. That mutant would let a stale or missing full output report success whenever body is current.

The implementation itself is correct; please pin the second output independently in the existing fixture (e.g. restore a matching body, make full stale and expect status 1 without modification, and/or delete only full and expect status 1). That should kill the mutant without expanding the production diff.

@oneandonlydean oneandonlydean self-assigned this Oct 29, 2026
@StoneDC

StoneDC commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up on the review fixes at head 553855ae92eed801766c4dd5227044b11d298c41.

Addressed the independent full-output coverage gap without changing the correct production comparison. With the body restored to matching bytes, the existing fixture now separately stales and deletes only the full notes; each check must return 1 while preserving all remaining file bytes and mtimes.

Validation at this exact head: both packaging/check-mode CTest groups pass on Windows/Linux (2 check-mode + 65 existing packaging/release tests). The old packaging suite has 14 Windows and 5 Linux platform/environment skips; the check-mode tests have none. Removing only the full-output comparison now fails the new stale-full assertion on both OSes. Conventions/whitespace/registration checks pass. No release publication or upload was performed.

Hosted-check snapshot checked on 2026-10-30 for this head: 4 passed, 5 pending, 3 skipped; no failures. Current checks. Pending and skipped checks are not counted as passes.

The PR description contains the detailed validation scope and limitations. Please re-review the updated head when convenient.

AI-assisted: yes.

@github-actions github-actions Bot added the build label Oct 29, 2026
@oneandonlydean
oneandonlydean merged commit aa1c88f into boykopovar:main Nov 2, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants