Repository navigation
fix(prepare): Run automatic version bumps in the selected workspace - #938
Merged
Merged
Conversation
Fixes #936 Co-Authored-By: Burak Yigit Kaya <126780+BYK@users.noreply.github.com>
Contributor
|
BYK
approved these changes
Oct 27, 2026
BYK
added a commit
that referenced
this pull request
Oct 27, 2026
…ings (#939) A glob release-workspace key gave every matched directory identical settings, so independently released packages each needed a near-copy literal entry that only differed by name (`tagPrefix`, `releaseBranchPrefix`, status contexts, artifact names, ...). String settings now expand placeholders for the selected workspace when the config is resolved: - `{{workspace}}`: the workspace path (`static/packages/scraps`) - `{{workspaceName}}`: its basename (`scraps`) - `{{packageName}}` / `{{packageSimpleName}}`: from the workspace's `package.json` (`@sentry/scraps` / `sentry-scraps`). Craft reads it only when one of these is used, and fails if the file or `name` is missing. Expansion covers inherited top-level settings too, so a top-level default like `releaseBranchPrefix: '{{workspaceName}}/release'` works for every workspace. The issue proposed `{{simpleName}}`. I used `{{packageSimpleName}}` because the npm target's `artifactTemplate` already uses `{{name}}`, `{{simpleName}}`, and `{{version}}` per package workspace, and expanding those at config time would break them. Unknown `{{...}}` markers are left alone. Combined with #938 (#936), a single `static/packages/*` entry can replace the three literal entries in getsentry/sentry, including the custom `preReleaseCommand`. Fixes #937 <!-- junior-request-attribution:start --> via @BYK. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:slack%3AC0CACQ70E8Z%3A1793137484.145799 --> -- [View Junior Session](https://junior-prod.sentry.dev/conversations/slack%3AC0CACQ70E8Z%3A1793137484.145799) [[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC0CACQ70E8Z%3A1793137484.145799/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: Burak Yigit Kaya <126780+BYK@users.noreply.github.com>
BYK
added a commit
that referenced
this pull request
Oct 27, 2026
…ace (#940) Follow-up to #938. With a release workspace selected, a NuGet target with `workspaces: true` still expanded every packable project in the solution, so releasing one workspace would publish all of them. Expansion now keeps only the projects inside the selected workspace's directory. The solution is still read from the repository root, so `solutionPath` keeps its documented meaning, and auto-discovery still looks there. This matches getsentry/sentry-dotnet: a single root `Sentry.slnx` lists `src/Sentry`, `src/Sentry.Maui`, and so on, so a `src/Sentry.Maui` workspace expands to just `Sentry.Maui`. The new tests use the existing `msbuild-solution` fixture, which has the same layout. The workspace filter runs before `includeWorkspaces`/`excludeWorkspaces`. If no packable project is inside the workspace, Craft fails with a configuration error. Workspaces that are not directories (aliases) and configs without workspaces behave as before. `expandWorkspaceTargets` passes the release unit directory to every expandable target as a third argument. Only NuGet uses it for now; npm expansion does not change. <!-- junior-request-attribution:start --> via @BYK. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:slack%3AC0CACQ70E8Z%3A1793137484.145799 --> -- [View Junior Session](https://junior-prod.sentry.dev/conversations/slack%3AC0CACQ70E8Z%3A1793137484.145799) [[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC0CACQ70E8Z%3A1793137484.145799/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: Burak Yigit Kaya <126780+BYK@users.noreply.github.com>
8 tasks done
sentry-junior Bot
added a commit
to getsentry/sentry
that referenced
this pull request
Oct 27, 2026
Craft 3.3.0 expands workspace placeholders and runs the automatic version bump in the selected workspace (getsentry/craft#938, #939). Replace the three literal static/packages entries with one static/packages/* entry, drop the custom preReleaseCommands, and fold the three pack workflows into one that derives the package from the release branch. The resolved Craft config for scraps, icons and search-syntax is unchanged apart from the artifact workflow name and the dropped preReleaseCommand. Bump the release workflow's Craft action to 3.3.0 and minVersion to match.
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.
With release workspaces, the automatic version bump (no
preReleaseCommand) ran from the directory containing.craft.yml. For an npm target in a pnpm monorepo, releasing one workspace bumped every non-private package in the rootpnpm-workspace.yaml.craft preparenow passes the selected workspace's directory to the automatic bumps, so every bumpable target (npm, pypi, crates, nuget, ...) reads project files from that workspace. Workspaces that are not directories (aliases likecli) keep using the config directory, the same rule the workspace changelog default already uses. That directory check is shared through a newgetReleaseUnitDir()helper.Custom
preReleaseCommands and publish-time target expansion (workspaces: trueon npm or nuget) do not change. NuGet documentssolutionPathas relative to the repo root, so changing expansion would be a separate, breaking decision.Fixes #936
via @BYK.
--
View Junior Session [Sentry]