googleapis / googleapis/release-please

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

Open
#2,686 0 comments 1 reaction 1 assignee Claimed by @chingor13 View on GitHub
priority: p3 type: bug
Dominant language
TypeScript
Stars
7.5k
Forks
588
Avg merge
12h 16m
Merged PRs (30d)
7

Description

#### 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:

```json
{
"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' }
}
```

- [Workflow log](https://github.com/seven332/release-please-merge-bug-repro/actions/runs/22258122760/job/64392019430)

#### 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`:

```typescript
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](https://github.com/seven332/release-please/tree/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`:

- [Workflow log (with fix)](https://github.com/seven332/release-please-merge-bug-repro/actions/runs/22258188682)
- [Release PR (with fix)](https://github.com/seven332/release-please-merge-bug-repro/pull/2)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.