Skip to content

Merge plugin drops version field, causing second workspace plugin to silently discard candidates #2686

@seven332

Description

@seven332

Environment details

  • googleapis/release-please-action@v4 on ubuntu-latest

Steps to reproduce

Minimal reproduction repo: https://github.com/seven332/release-please-merge-bug-repro

  1. Set up a monorepo with two workspace plugins (e.g., node-workspace + cargo-workspace), where all packages are in subdirectories:

    {
      "packages": {
        "packages/cli": { "release-type": "node", "component": "cli" },
        "mylib": { "release-type": "rust", "component": "mylib" }
      },
      "plugins": [
        { "type": "node-workspace" },
        { "type": "cargo-workspace" }
      ]
    }
  2. Make a conventional commit that triggers a release for the Node.js package (e.g., fix(cli): example bug fix).

  3. Run release-please. The release PR is created but cli is missing — only mylib appears.

Expected behavior

The release PR should contain both cli: 1.0.1 and mylib: 0.1.1.

Actual behavior

The release PR only contains mylib: 0.1.1. The cli release is silently dropped. The logs show the Merge plugin output has version: undefined:

⚠ pull request missing version {
  path: '.',
  pullRequest: {
    title: PullRequestTitle { version: undefined, component: undefined, ... },
    ...
  },
  config: { releaseType: 'node' }
}

Analysis

The Merge plugin (src/plugins/merge.ts) does not set version on the merged pull request. It only reads component/version from rootRelease (candidates with path === '.'), which is null when all packages are in subdirectories. The second workspace plugin inherits from WorkspacePlugin (src/plugins/workspace.ts), which drops candidates without version:

if (!candidate.pullRequest.version) {
  this.logger.warn('pull request missing version', candidate);
  return collection;
}

So the merged result from the first workspace plugin gets silently discarded by the second.

Fix

I have a fix with tests at seven332/release-please@fix/merge-plugin-missing-version. After applying the fix, the same repo correctly produces a release PR containing both cli: 1.0.1 and mylib: 0.1.1:

Metadata

Metadata

Assignees

Labels

priority: p3Desirable enhancement or fix. May not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions