Skip to content

[REL]: Add a workflow to tag a release#1610

Draft
mdboom wants to merge 2 commits intoNVIDIA:mainfrom
mdboom:add-tagging-workflow
Draft

[REL]: Add a workflow to tag a release#1610
mdboom wants to merge 2 commits intoNVIDIA:mainfrom
mdboom:add-tagging-workflow

Conversation

@mdboom
Copy link
Contributor

@mdboom mdboom commented Feb 12, 2026

This is a suggested solution to workaround the issue we ran into with the recent cuda_pathfinder release.

(Initial revision created with Claude -- be extra cautious about its errors).

This adds a tag to the repo by first creating a new empty commit and then tagging that. This will force CI to rerun with a tagged commit and create wheels and tarballs that have a proper tagged version, which then should be handled correctly when the CI: Release workflow is used to upload to PyPI etc.

This also acts as a starting point to put more automation steps for things we want to do when we tag a release.

An important downside of this approach is that you can't specify a specific commit to tag for release -- it needs to be the tip of main right now. (Because we need to create a new commit, and we need to put the new commit somewhere). This is a subtle "race condition" because things could be merged during the moment the user is trying to tag a release. I thought I would put this up to create some discussion around this. One nice solution would be to create a branch, then create the new commit and tag on that branch, which leaves a nice branch around to create bug fix releases from in the future. But that would no longer put tags on main as we currently do.

This also updates the CI: Release task so it takes a component and a version, rather than a git tag, to be inline with this new workflow and reduce the ability to create an invalid tag. I thought having these two workflows be different would cause a lot of confusion.

@copy-pr-bot
Copy link
Contributor

copy-pr-bot bot commented Feb 12, 2026

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@mdboom mdboom requested review from cpcloud, leofang and rwgk and removed request for leofang February 12, 2026 17:12
@mdboom
Copy link
Contributor Author

mdboom commented Feb 12, 2026

Test run of this on my own fork here: https://github.com/mdboom/cuda-python/actions/runs/21956196329/job/63420782798

@rwgk
Copy link
Collaborator

rwgk commented Feb 12, 2026

Hm, did you see the PR #1606 that I posted yesterday (Cursor-generated)?

That adds a tag-push-trigger, so we don't need an empty commit.

Do we want an empty commit?

(Note that #1606 also adds extra safety, ci/tools/validate-release-wheels; without that it'd just be a small surgical PR.)

@rwgk
Copy link
Collaborator

rwgk commented Feb 12, 2026

An important downside of this approach is that you can't specify a specific commit to tag for release -- it needs to be the tip of main right now.

The tag-push-trigger approach doesn't have that downside. According to what Cursor explained to me, we can even tag cuda-pathfinder, cuda-bindings, cuda-core concurrently and it'll all work.

@mdboom
Copy link
Contributor Author

mdboom commented Feb 12, 2026

Sorry, @rwgk, I didn't see #1606. Let me look...

@mdboom mdboom closed this Feb 12, 2026
Copy link
Member

Choose a reason for hiding this comment

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

@mdboom @rwgk I like this file. Can we keep it so that no members on the team would ever need to manually push a tag to this repo?

Copy link
Member

Choose a reason for hiding this comment

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

I think this file alone (without the change in the other file) is composable with #1606.

  • We run this new workflow to generate a tag
  • The tag creation triggers the CI

Copy link
Collaborator

Choose a reason for hiding this comment

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

That works for me. It's a bit on the heavy-handed side just for the tagging, but if we fold in some easy safety features I can see good value:

  • pull-down for: cuda-pathfinder, cuda-bindings, cuda-core
  • pull-down for: bump patch, bump minor, bump major
  • compute the version number
  • validate that X.Y.Z-notes.rst exists
  • validate that corresponding the nv-versions.json entry exits

That would prevent oversights like we had in the release of cuda-bindings 13.1.0 (missing release notes under cuda-python).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@leofang: At a minimum we need to update this so it doesn't create an empty commit (which is no longer needed after #1606). And if we do that, we also have ways to fix the race condition problem.

The race condition is: I wanted to create a release, so I go to the page to trigger this workflow, and then someone else merges a PR while the workflow is waiting to run. Now we've made a release with unintended content.

If we require the user of this workflow to specify a commit hash to tag, we avoid the race condition.

FWIW, even those the GitHub UI for creating a release tag doesn't do everything we need, has the ability to specify a commit in their design since it's a real issue:

image

And then the other thing to test is:

  • The tag creation triggers the CI

There are a bunch of rules about GitHub workflows triggering other workflows (to prevent infinite loops etc). This may not work -- we will need to test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As I think about this further, another downside is that this workflow could only ever /validate/ the kinds of things @rwgk is suggesting. (If it needs to add a commit to add content to the repo, we are back to the problems outlined in the OP). Is it really useful to have a workflow just to validate these things when instead we could write a local script that could actually /do/ those things and then add the tag? (and the push would correctly and helpfully fail if main had been updated in the meantime)?

Copy link
Member

Choose a reason for hiding this comment

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

  • The tag creation triggers the CI

There are a bunch of rules about GitHub workflows triggering other workflows (to prevent infinite loops etc). This may not work -- we will need to test.

Isn't this just handled by #1606?

@leofang leofang reopened this Feb 13, 2026
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.

3 participants