You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Automatic version bump ignores the selected release workspace #936
When a repository defines release workspaces in .craft.yml, Craft's automatic version bump (no preReleaseCommand) still runs against the directory that contains .craft.yml, not against the selected workspace. For an npm target in a pnpm monorepo, releasing one workspace bumps every non-private workspace package to that version.
src/commands/prepare.ts passes rootDir = getConfigFileDir() || process.cwd() to runPreReleaseCommand → runAutomaticVersionBumps, whatever --workspace is selected.
NpmTarget.bumpVersion runs npm version in rootDir and then discoverWorkspaces(rootDir). That picks up the repo-root pnpm-workspace.yaml and bumps every non-private package in it.
Example
getsentry/sentry has release workspaces static/packages/scraps and static/packages/icons, and getsentry/sentry#128514 adds static/packages/search-syntax. Each one is versioned on its own (scraps@, icons@, search-syntax@ tags). The root pnpm-workspace.yaml lists all three plus the app packages.
With auto bump, craft prepare auto --workspace static/packages/search-syntax would rewrite @sentry/scraps and @sentry/icons (and the root package.json) to the search-syntax version. So every workspace there sets its own preReleaseCommand:
preReleaseCommand: >- sh -c 'npm --prefix static/packages/search-syntax --no-git-tag-version --package-lock=false --allow-same-version version "$CRAFT_NEW_VERSION"'
Expected
When a release workspace is selected, the automatic bump should run in that workspace's directory, so only that package (and its package workspaces, if the npm target sets workspaces: true) is bumped. Then workspaces like the ones above could drop their custom preReleaseCommand.
The same probably applies to the other bumpable targets (pypi, crates, nuget, ...) that read project files from rootDir.
Activity
fix(prepare): Run automatic version bumps in the selected workspace (#…
feat(config): Expand workspace placeholders in release workspace sett…