[Bug]: release-notes preview reads the flip-utils version, and its changelog never generates - #926
Merged
Merged
Conversation
The release-notes preview read flip-utils/flip/__init__.py, but flip-utils ships to PyPI as `flip` and is versioned independently of the platform, so the preview described a different artefact than the one being released. Read the root pyproject.toml instead, exactly as release.yml does when it mints the tag. The two most recent release PRs both announced the wrong number: #924 said v0.4.1 for a v0.4.0 cut, #808 said v0.4.0 for v0.3.0. The changelog section never rendered either. generate-notes requires contents:write and the workflow granted contents:read, so every call failed with "Resource not accessible by integration" and the comment fell back to bare template text. Override to contents:write at the job level, matching release.yml, and keep the workflow default read-only. That fallback is why this survived two releases unnoticed: it read as an empty release rather than a broken workflow. Report the API error through core.warning and in the comment body so the next failure is legible. Signed-off-by: at24_bioeng625-pc <alexandre.triay_bagur@kcl.ac.uk>
Closed
4 tasks
|
✅ Acceptance criteria have been automatically imported from the linked issue(s) and added to the PR description. |
1 similar comment
|
✅ Acceptance criteria have been automatically imported from the linked issue(s) and added to the PR description. |
This was referenced Aug 7, 2026
10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The release-notes preview posted on every
develop→mainPR announced the wrong version, and itschangelog section had never rendered. Two independent faults, both in
.github/workflows/pr-release-notes-preview.yml, both pre-existing. Found while writing up #924.1 — It previewed flip-utils, not the platform release
The workflow read the flip-utils package version;
release.yml— which actually mints the tag — reads theroot manifest:
flip-utils ships to PyPI as
flipand is versioned independently of the platform(CONTRIBUTING → Versioning), so the preview was describing a
different artefact than the one being released. Both recent release PRs were wrong:
flip v0.4.1v0.4.0flip v0.4.0v0.3.0It escaped notice until now because the two numbers happened to look plausible; #917 split them apart and made
the mismatch obvious. The lowercase
flipin the comment heading against theFLIPinRELEASE_NOTES_TEMPLATE.mdis the same package-vs-platform conflation, so the heading is corrected too.2 — The changelog never generated
POST /repos/{owner}/{repo}/releases/generate-notesrequirescontents: write; the workflow grantedcontents: read. Every call failed, thecatchswallowed it, and the comment rendered the bare template with"Could not generate changelog preview at this time." in place of the changelog — so "PRs merged in this
release" and "Acknowledgements" have never populated. That is the preview's entire purpose.
Fixed by overriding to
contents: writeat the job level and leaving the workflow default read-only —the same shape
release.ymlalready uses for tag creation.On the permission bump
This is a
pull_requesttrigger, notpull_request_target, so a fork PR gets a read-onlyGITHUB_TOKENregardless of the
permissions:block. The write token therefore only exists for a same-repo branch, and thejob is additionally gated on
head.ref == 'develop'. The job runs no untrusted input through a shell: the onlyevent data reaching
run:ishead.sha, which is hex-constrained.3 — Why it survived two releases
The fallback text read as an empty release rather than a broken workflow, so nobody chased it. The error is
now reported through
core.warning(a run annotation) and inlined into the comment as a> [!WARNING]blocknaming the actual API message, so the next failure says what broke rather than shrugging.
Linked Issues
Fixes #925
Checklist
Type of Change
make -C docs/ docs.Testing
This workflow only fires on
pull_request→mainwithhead.ref == 'develop', so it cannot execute on thisPR. Verified by direct equivalence and static checks instead:
release.ymlbyte-for-byte. Running the new command against the current rootmanifest yields
VERSION=0.4.0/TAG=v0.4.0— identical torelease.yml's output, and the version develop -> main #924will actually tag. The old command yields
0.4.1.git tag --list 'v*.*.*' | sort -V | tail -n1→v0.3.0.permissionsresolves to{contents: write, pull-requests: write}with the workflow default still{contents: read, pull-requests: write}.github-scriptbody passesnode --check.contents: writefix cannot be proven short of a realdevelop→mainPR — the next release PR is thefirst live exercise. The failure mode if it is still wrong is unchanged from today (a warning block instead
of a populated changelog), and it cannot affect the release itself.
Additional Notes
Not a blocker for #924, and not fixable within it. The preview is a PR comment only;
release.ymlreadsthe correct source and will tag v0.4.0 either way. This lands on
developafter #924 merges, so thecorrected preview first appears on the next release PR. #924's description carries a note telling reviewers
to ignore the
v0.4.1in its own preview comment.Follow-up filed as #927 — the shared
v*tag namespace between platform and flip-utils releases (see Known limitation below).Separate, not addressed here: the changelog categories in
.github/release.ymlkey off labelsfeature,fix,docs,ci,build,chore— none of which exist in this repo's label set (onlybug,documentation,enhancementand
dependenciesoverlap). Once the changelog actually generates, most PRs will land under "Other Changes"until the labels are reconciled. Worth its own issue.
Known limitation: this does not resolve the shared tag namespace
release.yml(platform, rootpyproject.toml) andrelease-pypi.yml(flip-utils,flip.__version__) bothmint
v<version>tags and GitHub Releases into the samev*namespace, on the same push tomain, for twoindependently-versioned artefacts. This PR corrects which version the preview names; it does not touch that
collision. Two consequences worth knowing before merging:
PREV_TAGstays cross-contaminated.git tag --list 'v*.*.*' | sort -V | tail -n1takes the highest tagacross both artefacts, so once flip-utils starts tagging, a FLIP release PR can compare against a flip-utils
tag on an unrelated commit. Left as-is here deliberately — fixing it properly means separating the
namespaces, not special-casing the glob. The same line exists at
release-pypi.yml:120. Tracked in [Bug]: platform and flip-utils releases share one v* tag namespace and will silently suppress each other #927.maincan cut two releases; this commentdescribes one. Whether it should grow a second flip-utils section is a design question for the namespace
work, not this fix.
Neither is a regression: today the preview is wrong about the platform version and has no changelog at all.
Why nothing has collided yet:
release-pypi.ymlhas never completed a run, so all five existingv*tagsare
release.yml's. Its tag step also runs after the PyPI publish, so the current422 invalid-publisherfailure aborts before tagging. The collision arms itself the moment trusted publishing is configured — which
makes the namespace split worth doing before that, not after.
Acceptance Criteria
Imported from issue #925
develop→mainPR announces the version from the rootpyproject.toml—the same value
release.ymluses to create the tag..github/release.yml), not_Could not generate changelog preview at this time._. (Implemented; first live exercise is the nextrelease PR — see Testing.)
contents: writeis scoped to the job, not the workflow, matching the pattern inrelease.yml.FLIP), not the PyPI package (flip), consistent withRELEASE_NOTES_TEMPLATE.md.