[Fix][CI] fix nightly wheel versioning and build reliability#3097
[Fix][CI] fix nightly wheel versioning and build reliability#3097sammshen merged 2 commits intoLMCache:devfrom
Conversation
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
7368d9b to
7bc01db
Compare
| fetch-depth: 0 | ||
|
|
||
| - name: Remove non-release tags | ||
| run: git tag -l | grep -v '^v' | xargs -r git tag -d |
There was a problem hiding this comment.
grep fails step when no non-release tags exist
High Severity
GitHub Actions uses bash -eo pipefail by default. When all local tags start with v (common after a successful --cleanup-tag or on a first run), grep -v '^v' matches nothing and exits with code 1. Due to pipefail, the pipeline inherits that non-zero exit code, and -e causes the step to fail immediately, aborting the entire nightly build. The grep needs to be wrapped (e.g., { grep -v '^v' || true; }) to handle the no-match case gracefully.
Reviewed by Cursor Bugbot for commit 5d51adb. Configure here.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c845bb6. Configure here.
| fetch-depth: 0 | ||
|
|
||
| - name: Remove non-release tags | ||
| run: git tag -l | grep -v '^v' | xargs -r git tag -d |
There was a problem hiding this comment.
Pipeline fails with pipefail when no non-release tags exist
Medium Severity
publish.yml sets shell: bash in its defaults (line 26), which enables pipefail. When all tags start with v (no non-release tags to remove), grep -v '^v' exits with code 1 (no matches). With pipefail, this non-zero exit propagates through the pipe, causing the step — and thus the entire build-artifacts or build-cli-artifacts job — to fail. Adding || true after the pipeline would prevent this.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit c845bb6. Configure here.
- Remove SETUPTOOLS_SCM_PRETEND_VERSION from CIBW_ENVIRONMENT: the 0.4.3.devDATE override sorted below the stable 0.4.3 release in PEP 440 order, so pip always preferred the stable wheel. Letting setuptools-scm derive the version from git (e.g. 0.4.4.dev63) gives a pre-release that correctly sorts above the last stable tag. - Replace `git push origin :refs/tags/nightly` with `gh release delete --cleanup-tag` so the tag is deleted via the GitHub API rather than a push to origin (which may point to a fork). - Add "Remove non-release tags" step after checkout: rolling release tags like `nightly` and `nightly-cu13` contain digits and match setuptools-scm's default *[0-9]* pattern. Without this step, `git describe` returns e.g. `nightly-cu13-0-gabcdef` which causes an AssertionError (or InvalidVersion) during the wheel build. - Add workflow_dispatch trigger to allow manual nightly wheel builds. Signed-off-by: deng451e <838677410@qq.com>
Same setuptools-scm fix as nightly_build.yml: rolling release tags (nightly, nightly-cu13) contain digits matching the default *[0-9]* pattern. This caused build-artifacts, build-cli-artifacts, and build-cu130-artifacts to fail with InvalidVersion when git describe returned 'nightly' and CU130_VERSION=nightly was passed as SETUPTOOLS_SCM_PRETEND_VERSION. Add "Remove non-release tags" after checkout in all three build jobs. Signed-off-by: deng451e <838677410@qq.com>
c845bb6 to
65da8db
Compare


The nightly version (
0.4.3.dev20260421) was less than stable (0.4.3)in PEP 440, so pip always resolved the stable PyPI release instead of
the nightly wheel.
SETUPTOOLS_SCM_PRETEND_VERSION— setuptools-scm now derives0.4.4.devNfrom git history, correctly higher than stable0.4.3v*tags after checkout — tags likenightly-cu13containdigits and match setuptools-scm's default
*[0-9]*pattern, causingan
AssertionErrorduring version parsinggit push origin :refs/tags/<tag>withgh release delete --cleanup-tag— deletes tags via API, no dependency onoriginworkflow_dispatchfor manual nightly triggersNote
Low Risk
Changes are limited to GitHub Actions workflows and release-tag handling; main risk is accidentally deleting or mis-naming Git tags/releases in automation.
Overview
Improves nightly wheel publishing reliability by adding
workflow_dispatch, stripping non-v*tags after checkout to avoidsetuptools-scmversion parsing failures, and relying onsetuptools-scm-derived versions (removesSETUPTOOLS_SCM_PRETEND_VERSIONand the custom nightly version computation).Simplifies nightly release cleanup by switching to
gh release delete --cleanup-taginstead of manual tag deletion viagit push, and applies the non-release tag cleanup step topublish.ymlbuild jobs as well.Reviewed by Cursor Bugbot for commit 65da8db. Bugbot is set up for automated code reviews on this repo. Configure here.