Skip to content

getDefaultComponent doesn't find the right packageName if includeComponentInTag is set to false and it is for a nested path #2214

@sofisl

Description

@sofisl

I was investigating why release-please did not open a PR here: googleapis/gax-nodejs#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

Line 615 in 72b0ab3

PR component: ${branchName.component} does not match configured component: ${branchComponent}
That is true, since the branch does not contain the component:
Screenshot 2024-02-01 at 1 44 57 AM

There's a bug that occurs when setting the branchName in buildPullRequests in manifest, it will return empty here

I think that's because getBranchComponent returns an empty string here:

return this.component || (await this.getDefaultComponent());
because getDefaultComponent is not grabbing the packageName correctly for nested packages that have includeComponentInTag set to false (as in my config)

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

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