Skip to content

Fix malformed versions from push-triggered builds on release branches#250

Merged
AyodeAwe merged 2 commits intorapidsai:mainfrom
AyodeAwe:fix/generate-version-empty-stage
Mar 17, 2026
Merged

Fix malformed versions from push-triggered builds on release branches#250
AyodeAwe merged 2 commits intorapidsai:mainfrom
AyodeAwe:fix/generate-version-empty-stage

Conversation

@AyodeAwe
Copy link
Copy Markdown
Contributor

@AyodeAwe AyodeAwe commented Mar 16, 2026

Summary

  • Fix rapids-generate-version to handle the case where the nearest git tag has no stage (e.g., v25.10.00 instead of v25.10.00a)
  • When {stage} is empty, dunamai's {base}{stage}{distance} format produces garbage like 25.10.000 or 26.02.010
  • The fix detects an empty stage and defaults to a as the separator

Context

During the cucim v26.02.01 hotfix (ref: ops#4293), the push to release/26.02 triggered a build that produced packages with malformed versions (libcucim-26.02.010). The tag-triggered build produced the correct version (26.02.01).

This happens because push-triggered builds use {base}{stage}{distance} but when the nearest tag is a release/hotfix tag, {stage} is empty -- so distance concatenates directly onto base.

Verification

Tested locally against cucim (the repo where the bug was originally reported) and rmm:

cucim:

Scenario Tag Before After
Hotfix push (the original bug) v26.02.01 26.02.010 26.02.01a0
Release push v26.02.00 26.02.000 26.02.00a0
Nightly on main v26.04.00a +18 26.04.00a18 26.04.00a18

rmm:

Scenario Tag Before After
Release push v26.02.00 26.02.000 26.02.00a0
Release push v25.12.00 25.12.000 25.12.00a0
Nightly on main v26.04.00a +52 26.04.00a52 26.04.00a52

How to reproduce

# Test against cucim (where the bug was originally reported)
git clone git@github.com:rapidsai/cucim.git
cd cucim
pip install dunamai

# Bug: at the hotfix tag, {stage} is empty so distance concatenates onto base
git checkout v26.02.01
python -m dunamai from git --format "{base}{stage}{distance}"
# Output: 26.02.010 (wrong -- this is what James reported)

# Bug: same issue at a release tag
git checkout v26.02.00
python -m dunamai from git --format "{base}{stage}{distance}"
# Output: 26.02.000 (wrong)

# Fix: detect empty stage and default to "a"
git checkout v26.02.01
python -c "
from dunamai import Version
v = Version.from_git()
if v.stage:
    print(v.serialize(format='{base}{stage}{distance}'))
else:
    print(v.serialize(format='{base}a{distance}'))
"
# Output: 26.02.01a0 (correct)

@AyodeAwe AyodeAwe requested a review from a team as a code owner March 16, 2026 16:41
@AyodeAwe AyodeAwe requested review from bdice and jameslamb and removed request for a team March 16, 2026 16:41
Copy link
Copy Markdown
Member

@jameslamb jameslamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for investigating this! The description and comments helped me a lot.

I think applying a fix here is a good approach. I'm unsure if we need that one more nightly package pushed to the nightly indices, but it's not too expensive to have it (since CPU CI runners are relatively cheap and plentiful).

But I left one suggestion for a slightly different version for those.

@AyodeAwe
Copy link
Copy Markdown
Contributor Author

Thanks @jameslamb! Addressed!

Copy link
Copy Markdown
Member

@jameslamb jameslamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for considering it, let's merge this :shipit:

@AyodeAwe AyodeAwe merged commit 69ef090 into rapidsai:main Mar 17, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants