Conversation
gh release create is invoked without --prerelease, so every tag becomes a full GitHub release. GitHub then reports the newest such release as the repository "Latest release" and serves it from /releases/latest, so an rc supersedes the last stable release for anyone browsing the repo or reading that endpoint programmatically. This surfaced with v0.6.16rc3, the first rc to reach create-release (earlier rcs never got past the build jobs): it became "Latest release" and had to be re-flagged by hand. Derive the flag from the version string. Only PEP 440 pre-release suffixes (rc/a/b/alpha/beta/dev) qualify -- .postN is a post-release of a stable version and must remain a full release. Verified against 0.6.16rc3, 0.6.16, 0.6.16.post1, 0.6.16a1, 0.6.16b2, 0.6.16.dev1 and 1.2.3.post2. Nightly releases are created elsewhere and already set prerelease correctly. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
📝 WalkthroughWalkthroughThe release workflow now detects common pre-release version suffixes, conditionally adds the ChangesRelease workflow
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/release.yml:
- Around line 296-301: Update the prerelease-gating condition in the VERSION
release classification to recognize every suffix accepted by the tag regex,
including c, pre, and preview alongside the existing aliases. Ensure valid PEP
440 prerelease tags such as c1 set PRERELEASE_FLAG to --prerelease rather than
being classified as full releases.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: e3a64e1c-a42b-48c3-b181-8a81f10379ab
📒 Files selected for processing (1)
.github/workflows/release.yml
| if [[ "$VERSION" =~ \.?(rc|a|b|alpha|beta|dev)[0-9]*$ ]]; then | ||
| PRERELEASE_FLAG="--prerelease" | ||
| echo "✓ $VERSION is a pre-release; marking it accordingly" | ||
| else | ||
| echo "✓ $VERSION is a full release" | ||
| fi |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== release workflow version logic =="
sed -n '260,315p' .github/workflows/release.yml 2>/dev/null || true
echo
echo "== version assignment/validation references =="
rg -n "VERSION|GITHUB_REF|gh release|\.?(rc|c|pre|preview|alpha|beta|dev|a|b)[0-9]*" .github/workflows/release.yml .github/workflows || true
echo
echo "== all workflow refs to VERSION =="
rg -n '\$\{?\$?VERSION' .github/workflows/release.yml .github/workflows 2>/dev/null | head -80 || trueRepository: flashinfer-ai/flashinfer
Length of output: 50381
🌐 Web query:
PEP 440 pre-release segment canonical spellings a b alpha beta rc c pre preview
💡 Result:
According to PEP 440, the canonical pre-release identifiers are "a" (alpha), "b" (beta), and "rc" (release candidate) [1][2]. While these are the standard canonical forms, PEP 440 allows several additional spellings for these segments that normalize to the canonical versions [1][3]: - "alpha" and "a" normalize to "a" [1][4]. - "beta" and "b" normalize to "b" [1][4]. - "c", "pre", and "preview" are all treated as equivalent to "rc" and normalize to "rc" [1][4]. In practice, these additional spellings are considered equivalent to their canonical forms, meaning versions like 1.1alpha1, 1.1beta2, and 1.1c3 normalize to 1.1a1, 1.1b2, and 1.1rc3, respectively [1][5]. Published version identifiers are encouraged to use the canonical format [1][3].
Citations:
- 1: https://peps.python.org/pep-0440/
- 2: https://packaging.python.org/en/latest/specifications/version-specifiers/?highlight=version
- 3: https://github.com/python/peps/blob/main/peps/pep-0440.rst
- 4: https://github.com/pypa/packaging/blob/21.3/packaging/version.py
- 5: https://github.com/pypa/packaging.python.org/blob/main/source/specifications/version-specifiers.rst
🏁 Script executed:
#!/bin/bash
set -euo pipefail
python3 - <<'PY'
import re
tag_re = re.compile(r'^v[0-9]+\.[0-9]+\.[0-9]+(\.?[a-z][a-z0-9]*)?$')
pre_re = re.compile(r'^\.?(rc|a|b|alpha|beta|dev)[0-9]*$', re.I)
missing = []
examples = [
"v0.6.16c1",
"v0.6.16.pre1",
"v0.6.16.preview1",
"v0.6.16.post1",
]
for v in examples:
print(f"{v}: tag={tag_re.match(v).group() if tag_re.match(v) else 'NO'}, pre_re={bool(pre_re.search(v))}, all_rc_spellings={'c4c' in ['c' in v[2:] for v in [v]]}")
PY
echo
echo "== tag validation and prerelease matching with sample versions =="
python3 - <<'PY'
from pathlib import Path
from dataclasses import dataclass
`@dataclass`
class Case:
version: str
input_tag: str = ""
tag_re = re.compile(r'^v[0-9]+\.[0-9]+\.[0-9]+(\.?[a-z][a-z0-9]*)?$')
old_pre_re = re.compile(r'\.?(rc|a|b|alpha|beta|dev)[0-9]*$', re.I)
cases = [
Case("0.6.16c1", "v0.6.16c1"),
Case("1.2.3rc1"),
Case("1.2.3alpha1"),
Case("1.2.3beta1"),
Case("1.2.3pre1"),
Case("1.2.3preview1"),
Case("1.2.3.post1", "v1.2.3.post1"),
]
for c in cases:
tag = c.input_tag or f"v{c.version}"
tag_ok = bool(tag_re.match(tag))
prerelease_flag = "--prerelease" if old_pre_re.search(c.version) else ""
post_flag = "--prerelease" if re.search(r'\.?post[0-9]+$', c.version) else ""
print(f"version={c.version} tag={tag} tag_ok={tag_ok} prerelease={prerelease_flag} post_prerelease_flag={post_flag}")
PYRepository: flashinfer-ai/flashinfer
Length of output: 618
Handle the full set of accepted PEP 440 pre-release suffixes.
The tag regex accepts c, pre, and preview variants, but the prerelease-gating regex only includes rc, a, b, alpha, beta, and dev. A valid tag like v0.6.16c1 would be created as a stable release instead of using --prerelease, which can make it serve as /releases/latest. Add these aliases, or narrow the supported version contract instead of calling it a full “PEP 440 pre-release” contract.
Proposed fix
- if [[ "$VERSION" =~ \.?(rc|a|b|alpha|beta|dev)[0-9]*$ ]]; then
+ if [[ "$VERSION" =~ \.?(rc|c|pre、preview|a|b|alpha|beta|dev)[0-9]*$ ]]; then🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/release.yml around lines 296 - 301, Update the
prerelease-gating condition in the VERSION release classification to recognize
every suffix accepted by the tag regex, including c, pre, and preview alongside
the existing aliases. Ensure valid PEP 440 prerelease tags such as c1 set
PRERELEASE_FLAG to --prerelease rather than being classified as full releases.
📌 Description
create-releaseinvokes:with no
--prerelease, so every tag becomes a full GitHub release. GitHub then treats the newest such release as the repository's "Latest release" and serves it from/releases/latest— so a release candidate supersedes the last stable release both on the repo page and for anything reading that endpoint programmatically.This surfaced with
v0.6.16rc3, the first rc ever to reachcreate-release(earlier rcs never got past the build jobs). It became "Latest release" and had to be re-flagged by hand.Fix: derive the flag from the version string. Only PEP 440 pre-release suffixes (
rc/a/b/alpha/beta/dev) qualify —.postNis a post-release of a stable version and must remain a full release.Nightly releases are created elsewhere and already set
prereleasecorrectly, so they are unaffected.🔍 Related Issues
🚀 Pull Request Checklist
Thank you for contributing to FlashInfer! Before we review your pull request, please make sure the following items are complete.
✅ Pre-commit Checks
pre-commitby runningpip install pre-commit(or used your preferred method).pre-commit install.pre-commit run --all-filesand fixed any reported issues.🧪 Tests
This is a workflow-only change with no unit-testable surface, so no tests were added. Verified two ways instead:
0.6.16rc30.6.16a10.6.16b20.6.16.dev10.7.0rc10.6.160.6.150.6.16.post11.2.3.post2release.ymlre-parsed as YAML after the edit; all 7 jobs still present.Reviewer Notes
^v[0-9]+\.[0-9]+\.[0-9]+(\.?[a-z][a-z0-9]*)?$), so nothing that currently passes validation changes classification except actual pre-releases.--titlenow uses the\$VERSIONshell variable rather than re-expanding the workflow output twice; behaviour is identical.v0.6.16rc3has already been corrected manually, so this only prevents recurrence.🤖 Generated with Claude Code
Summary by CodeRabbit