ci(release-please): promote graduated releases to GitHub full release - #14
Merged
Merged
Conversation
release-please marks every release it creates with prerelease=true because of the repo-level "prerelease": true flag (which is correct for rc tags but wrong for graduated vX.Y.Z tags). Add a post-release step in the dispatch-publish job that, for tags with no prerelease suffix (no '-' in the version string), flips the GitHub release's prerelease flag to false and — iff this is the highest stable semver — marks it as the repo's "Latest release". The highest-stable computation mirrors ci.yaml's versions job exactly (same tag glob, same '-' filter, same sort -V | tail), so the GitHub release's "Latest" flag stays in lockstep with the OCI ":latest" pointer on the image and chart. Co-Authored-By: kyle_hunter@bcit.ca <kyle_hunter@bcit.ca>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
⚙️ Control Options:
|
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.
Summary
Make graduated strict-D releases (e.g.
v0.3.0) appear as full releases in the GitHub UI — and, iff they're the highest stable semver, as the repo's "Latest release" — instead of being flagged as pre-releases.Why this exists
release-please-config.jsonsets repo-level"prerelease": truebecause rc tags (v0.3.0-rc1) should be marked pre-release on GitHub. The flag is uniform across all releases release-please creates, though, so graduated stable tags (v0.3.0) also end up pre-release in the UI — even though the OCI publish side correctly pushes:0.3.0,:stable,:latest(that path reads git tags, not GitHub release metadata).What this PR changes
Adds a new step to
release-please.yaml'sdispatch-publishjob, running after theworkflow_dispatchagainst the new tag. For each tag release-please creates:-, e.g.v0.3.0-rc1) → leave GitHub release flags untouched (remains pre-release).-in the version, e.g.v0.3.0) →gh release editto flipprerelease=false, and setlatest=true|falsebased on whether this is the highest stable semver.Highest-stable detection mirrors
ci.yaml'sversionsjob exactly:This keeps the GitHub release's "Latest" flag in lockstep with the OCI
:latestpointer on image + chart (same tag glob, same-filter, same semver sort). Correctly handles backports — e.g. releasingv1.1.9afterv1.2.0exists would mark the 1.1.9 release as a full release but NOT as "Latest", matching the moving-tag policy for the chart/image.The new step also gets
fetch-depth: 0on the existing checkout sogit tag -lsees the full tag list.Backfill for the existing
v0.3.0releaseDone manually via
gh release edit v0.3.0 --prerelease=false --latest=true. Confirmed via the API:So
v0.3.0is now the correct "Latest release" on the releases page. Future graduated releases will land that way automatically without the manual backfill.Review & Testing Checklist for Human
VERSION == HIGHEST_STABLEcomparison for backport cases (e.g., imaginev1.1.9released afterv1.2.0is out; the step should call--latest=false).dispatch-publishjob'sfetch-depth: 0bump is acceptable (tiny extra checkout cost; required sogit tag -lsees all tags).v0.3.1(or whatever the next stable is), verify it shows up as "Latest release" on the releases page and not as Pre-release.Notes
release-please-config.json— repo-level"prerelease": truestays because rc releases do need to be flagged pre-release.--latestpermits explicit opt-out of auto-detection; passing--latest=falseprevents accidentally bumping "Latest" on backport releases.releases_created == true(job-levelif:already gates this); safe no-op otherwise.Link to Devin session: https://app.devin.ai/sessions/8688f4d14a8f46839fd8ede494e61166
Requested by: @kphunter