Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sofisl opened this issue Feb 1, 2024 · 3 comments
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@sofisl
Copy link
Contributor

sofisl commented Feb 1, 2024

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

@sofisl sofisl added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Feb 1, 2024
@sofisl
Copy link
Contributor Author

sofisl commented Feb 1, 2024

see: googleapis/gax-nodejs#1555

@jurijzahn8019
Copy link

Hi,

same behaviour with this config:
Somehow nothing helps.

After PR merge it does not gets released

{
  "packages": {
    ".": {
      "include-component-in-tag": false,
      "package-name": "verint-xmsdk"
    }
  },
  "separate-pull-requests": false,
  "pull-request-title-pattern": "chore${scope}: release ${component} ${version}",
  "group-pull-request-title-pattern": "chore${scope}: release ${component} ${version}",
  "changelog-path": "CHANGELOG.md",
  "bump-minor-pre-major": true,
  "bump-patch-for-minor-pre-major": true,
  "draft": false,
  "prerelease": false,
  "release-type": "node",
  "label": "release: pending :hourglass:",
  "release-label": "release: tagged :ship:",
  "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
}
Here Some Logs
Running release-please version: 16.5.0
❯ Fetching release-please-config.json from branch main
❯ Fetching .release-please-manifest.json from branch main
✔ Building releases
✔ Building strategies by path
❯ .: node
❯ Found pull request #242: 'chore(main): release  1.16.0'
✔ Building release for path: .
❯ type: node
❯ targetBranch: main
⚠ PR component: undefined does not match configured component: verint-xmsdk
❯ Fetching release-please-config.json from branch main
❯ Fetching .release-please-manifest.json from branch main
✔ Building pull requests
✔ Building strategies by path
❯ .: node
✔ Collecting release commit SHAs
❯ release search depth: 400

@jurijzahn8019
Copy link

I have fired it out:

setting separate-pull-requests: true does the trick

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

3 participants