Repository navigation
feat(prepare): Bump untagged release units from their project files' version - #947
Merged
Merged
Conversation
…rsion Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
Contributor
|
BYK
requested changes
Nov 1, 2026
BYK
approved these changes
Nov 1, 2026
BYK
marked this pull request as ready for review
November 1, 2026 16:06
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c71749b. Configure here.
8 tasks done
sentry-junior Bot
added a commit
to getsentry/toolkit
that referenced
this pull request
Nov 2, 2026
The Release workflow bumped the version in package.json itself, with `semver -i`. package.json holds the next `-dev` version, so a patch from `0.48.0-dev.0` gave `0.48.0` instead of `0.47.1`. Pass the bump type to `craft prepare` instead. Since Craft 3.6.0 (getsentry/craft#947) it bumps from the workspace's latest release tag (`cli@0.47.0` gives patch 0.47.1, minor 0.48.0, major 1.0.0), and before the first tag from the version in package.json (logger `1.0.0-dev.0` gives 1.0.0 for any bump). Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Refs #946
craft prepare patch|minor|major(andauto) bump the latest tag for the release unit's tag prefix, and fall back to0.0.0when there is none. So a workspace's first release ignored its manifest:packages/cliat1.0.0-dev.0with nocli@tag released0.1.0forminor, which is why getsentry/toolkit's release workflow computes the version itself withsemver -i.When there's no matching tag, the bump now starts from the version declared in the release unit's project files (the selected workspace's directory, or the config directory without one).
1.0.0-dev.0becomes1.0.0for any bump, matchingsemver -i. Tags still win when they exist.Reading the version lives next to automatic version bumping: targets that implement
bumpVersion()can also implement a staticreadVersion(), andreadProjectVersion()asks each configured target in config order, taking the first valid semver above0.0.0. Placeholders such as0.0.0-development(every bump of which is0.0.0) are skipped, and with no readable version the old0.0.0fallback applies. All seven bumpable targets read the same files they bump:npm:package.jsonpypi: staticversioninpyproject.toml(none for setuptools_scm, whose version comes from tags)crates:Cargo.tomlgem: the gemspec, orlib/**/version.rbwhen the gemspec uses a constantpub-dev:pubspec.yamlhex:mix.exsnuget:Directory.Build.props, then*.csprojThe bump regexes in pypi, gem, and hex moved to module constants so reading and bumping use the same pattern. PEP 440 versions that aren't valid semver (e.g.
1.0.0a1) are skipped.This also applies to repos without workspaces: an untagged repo, or one checked out without its tags, now bumps from its targets' project files instead of
0.0.0.Open question: the second half of #946, letting
--workspace cliresolve topackages/cliso workflows don't need acasemapping, isn't in this PR. Matching on the directory basename has an ambiguity question (two globs can each yield acli) that seems worth deciding on its own.--
View Session in Sentry