googleapis / googleapis/release-please
getDefaultComponent doesn't find the right packageName if includeComponentInTag is set to false and it is for a nested path
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 588
- Avg merge
- 12h 16m
- Merged PRs (30d)
- 7
Description
I was investigating why release-please did not open a PR here: https://github.com/googleapis/gax-nodejs/pull/1553
The CLI does not tag the PR with the warning:
⚠ PR component: undefined does not match configured component: google-gax
(here):
[release-please/src/strategies/base.ts](https://github.com/googleapis/release-please/blob/72b0ab360c3d6635397e8b02f4d3f9f53932e23c/src/strategies/base.ts#L615)
Line 615 in [72b0ab3](https://github.com/googleapis/release-please/commit/72b0ab360c3d6635397e8b02f4d3f9f53932e23c)
`PR component: ${branchName.component} does not match configured component: ${branchComponent}`
That is true, since the branch does not contain the component:
There's a bug that occurs when setting the branchName in `buildPullRequests` in manifest, it will return empty [here](https://github.com/googleapis/release-please/blob/72b0ab360c3d6635397e8b02f4d3f9f53932e23c/src/strategies/base.ts#L302)
I think that's because `getBranchComponent` returns an empty string here: https://github.com/googleapis/release-please/blob/72b0ab360c3d6635397e8b02f4d3f9f53932e23c/src/strategies/base.ts#L176 because [getDefaultComponent](https://github.com/googleapis/release-please/blob/72b0ab360c3d6635397e8b02f4d3f9f53932e23c/src/strategies/base.ts#L169) is not grabbing the packageName correctly for nested packages that have includeComponentInTag set to false (as in my [config](https://github.com/googleapis/gax-nodejs/blob/main/release-please-config.json))
A workaround I'll try in the meantime is just to specify it in the config object explicitly - that should work. But I think the better functionality is to automatically grab it from the nearest package.json
Contributor guide
Assessment
This issue has not been assessed yet.