fix(ci): skip prereleases when picking openapi.json release#515
fix(ci): skip prereleases when picking openapi.json release#515myasnikovdaniil wants to merge 1 commit intomainfrom
Conversation
The build script picked v1.3.0-rc.1 over v1.3.0 for the v1.3 docs because GNU `sort -V` orders prerelease tags AFTER the matching stable version (opposite of semver), and the jq filter only excluded drafts. Add `prerelease == false` to the filter so prerelease tags are dropped before sorting. Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
✅ Deploy Preview for cozystack ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request updates the hack/download_openapi.sh script to ensure that only stable releases are selected by explicitly excluding prereleases in the jq filter. This modification prevents GNU sort -V from incorrectly identifying a release candidate as the latest version over a stable release. I have no feedback to provide.
Summary
hack/download_openapi.shwas downloadingopenapi.jsonfromv1.3.0-rc.1for the v1.3 docs, even though stablev1.3.0exists. Production currently showsapi/apps/v1alpha1/v1.3.0-rc.1-1-g12bf6b0eat/docs/v1.3/cozystack-api/api.json.Root cause
Two compounding issues:
sort -Vorders prerelease tags AFTER the stable release, opposite of semver:select(.draft == false)), not prereleases — sov1.3.0-rc.1(markedprerelease: trueon GitHub) survived to the sort.Combined,
tail -1picked the rc instead of the stable release.Fix
Add
and .prerelease == falseto the jq filter. Prereleases are dropped before sorting, sosort -V's quirk no longer matters.Verified locally against the live releases API:
v1.1andv1.2were unaffected only because no rc tag is currently newer than the matching stable for those minors — the bug was latent there.Test plan
./hack/download_openapi.sh && hugo --gc --minify) succeedshttps://cozystack.io/docs/v1.3/cozystack-api/api.jsonreports aversionfield derived fromv1.3.0(no-rc.1)Summary by CodeRabbit