Repository navigation
feat(tools): check generated release notes without writing - #12880
Conversation
|
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.
|
malekaifa
left a comment
There was a problem hiding this comment.
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.
|
Follow-up on the review fixes at head 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. |
What
Add
prepare_release_notes.py --checkto 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
553855ae92eed801766c4dd5227044b11d298c41on current mainbb04a4f1ea0175e9e4f149f0359a764d62ff3296. 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
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)