Skip to content

Sync the release version into extra files during a release #948

Open

Description

@sentry-junior

A release unit often stores its version in more places than the one manifest Craft bumps automatically. Right now the only way to keep those files in sync is a custom preReleaseCommand, and setting one turns off Craft's automatic version bump for that unit.

Current behavior (3.6.0)

  • Automatic bumping only writes the release unit's own manifest. NpmTarget.bumpVersion runs npm version in the release unit directory, plus any npm workspaces under it. It doesn't update a package.json outside that directory, other JSON files, or Markdown/YAML frontmatter.
  • Automatic bumping only runs without a preReleaseCommand. A unit that needs to update one extra file has to take over the whole bump.

Example: getsentry/toolkit

The CLI's Craft workspace (packages/cli) runs packages/cli/script/bump-version.ts as both its pre- and post-release command. As of getsentry/toolkit#1731, the script:

  1. Sets packages/cli/package.json to the version. Craft can already do this.
  2. Sets packages/mcp-server/package.json to the same version. The MCP server ships with every CLI release, but its package lives outside the CLI workspace.
  3. Sets version in plugins/sentry-cli/.claude-plugin/plugin.json with the prerelease suffix removed.
  4. Rewrites the version: line in the YAML frontmatter of plugins/sentry-cli/skills/sentry-cli/SKILL.md and references/*.md. Today this only happens in the post-release step.

Proposal

Let a release unit list extra files to update with the new version, and keep the automatic manifest bump on. Roughly:

workspaces:
  packages/cli:
    versionFiles:
      - path: ../mcp-server/package.json          # JSON field (default: version)
      - path: plugins/sentry-cli/.claude-plugin/plugin.json
        stripPrerelease: true
      - path: plugins/sentry-cli/skills/sentry-cli/**/*.md
        format: frontmatter                       # YAML frontmatter `version:` key

With this in place, toolkit could drop the pre-release half of bump-version.ts.

Related

via @BYK.

--

View Session in Sentry

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions