Skip to content

version-bump: a manual pre-release run fails with a stale lock #428

Open

Description

@saucer-boy

What happens

A manual run of version-bump.yml with the prerelease input set (for example bump_type=patch and prerelease=rc) fails in the step "Apply version bump" with:

error: The lockfile at uv.lock needs to be updated, but UV_LOCKED=1 was provided

Why

The pre-release path calls bump-my-version twice. The first call changes the version in pyproject.toml, which leaves the project's own entry in uv.lock at the old version. The second call runs through uv run, and with UV_LOCKED=1 uv refuses the stale lock. This happens on main today. The job split of version-bump.yml and docs.yml does not change it.

Expected

A pre-release run produces one version commit and no tag: both bump-my-version calls of this path use --no-tag, and the job that pushes refuses a pre-release bundle that carries a tag. The job that pushes accepts the commit. If pre-releases should get a tag (the --prerelease path of release.yml needs one), change those calls and that refusal together, in the pull request that fixes this.

Possible fix

  • Bring the lock's project version line up to date between the two calls, with the same one-line edit that the bump job already makes after a stable bump. Or compute the pre-release version first and call bump-my-version once, with --new-version.
  • Run the real job end to end, through the job that pushes: so far that job's pre-release rules have only met bundles made with git commands. Decide what a stable bump after a pre-release looks like: the job that pushes refuses X.Y.Z-rc.1 to X.Y.Z as not a step. Add a test of the path.

Related: #418

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingciContinuous Integration

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions