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

monorepo tags broken in v3 #457

Closed
wraithgar opened this issue Mar 31, 2022 · 2 comments · Fixed by #459 or #468
Closed

monorepo tags broken in v3 #457

wraithgar opened this issue Mar 31, 2022 · 2 comments · Fixed by #459 or #468

Comments

@wraithgar
Copy link

wraithgar commented Mar 31, 2022

TL;DR

When we use v3 of this action our workspace PRs pick up the version from our root project, not the workspace.

Expected behavior

PRs for workspaces correctly find the current version from monorepo tags.

Observed behavior

The PR that is made uses the version from the root tag. Here is an erroneous PR that correctly makes the changelog for arborist (a workspace) but tags it as if the root project (npm itself) is the version arborist is on

https://github.com/npm/cli/pull/4648/files

Action YAML

This file is automatically added by @npmcli/template-oss. Do not edit.

name: Release Please - @npmcli/arborist

on:
  push:
    paths:
      - workspaces/arborist/**
    branches:
      - main
      - latest

jobs:
  release-please:
    runs-on: ubuntu-latest
    steps:
      - uses: google-github-actions/release-please-action@v3
        id: release
        with:
          release-type: node
          monorepo-tags: true
          path: workspaces/arborist
          changelog-types: >
            [
              {"type":"feat","section":"Features","hidden":false},
              {"type":"fix","section":"Bug Fixes","hidden":false},
              {"type":"docs","section":"Documentation","hidden":false},
              {"type":"deps","section":"Dependencies","hidden":false},
              {"type":"chore","hidden":true}
            ]

Log output

No response

Additional information

If we downgrade to v2 in another repo that doesn't use workspaces, it is unable to see any of the releases v3 made.
If we pin to v3.0.0-v3.1.0, the pr it makes is always v1.0.0, it is in release-please-action v3.1.1 this behavior starts.

@wraithgar wraithgar added the bug label Mar 31, 2022
@lukekarrys
Copy link
Contributor

I'm working on this issue with @wraithgar and I wanted to update this with a npx release-please (running 13.8.0) command I was able to run that did seem to create the correct pull request for the same repo:

npx release-please release-pr \
  --release-type=node --token=XXX --path=workspaces/arborist \
  --monorepo-tags --package-name=@npmcli/arborist \
  --component=arborist --repo-url=npm/cli

(I'm not sure if the --component flag is necessary, as it worked without it when doing a --dry-run.)

I got this command from this issue: googleapis/release-please#1132. The only difference I can see is that I am explicitly supplying the name instead of letting release-please-action detect it automatically.

@lukekarrys
Copy link
Contributor

Here are some logs I collected that I haven't had a chance to look through fully yet:

Release Please Action Logs

2022-03-31T00:43:22.7114803Z Requested labels: ubuntu-latest
2022-03-31T00:43:22.7114855Z Job defined at: npm/cli/.github/workflows/release-please-npmcli-arborist.yml@refs/heads/latest
2022-03-31T00:43:22.7114907Z Waiting for a runner to pick up this job...
2022-03-31T00:43:25.9286825Z Job is waiting for a hosted runner to come online.
2022-03-31T00:43:27.5429463Z Job is about to start running on the hosted runner: GitHub Actions 5 (hosted)
2022-03-31T00:43:32.1451642Z Current runner version: '2.289.1'
2022-03-31T00:43:32.1482648Z ##[group]Operating System
2022-03-31T00:43:32.1483261Z Ubuntu
2022-03-31T00:43:32.1483618Z 20.04.4
2022-03-31T00:43:32.1484073Z LTS
2022-03-31T00:43:32.1484388Z ##[endgroup]
2022-03-31T00:43:32.1484793Z ##[group]Virtual Environment
2022-03-31T00:43:32.1485245Z Environment: ubuntu-20.04
2022-03-31T00:43:32.1485604Z Version: 20220227.1
2022-03-31T00:43:32.1486295Z Included Software: https://github.com/actions/virtual-environments/blob/ubuntu20/20220227.1/images/linux/Ubuntu2004-Readme.md
2022-03-31T00:43:32.1487110Z Image Release: https://github.com/actions/virtual-environments/releases/tag/ubuntu20%2F20220227.1
2022-03-31T00:43:32.1487616Z ##[endgroup]
2022-03-31T00:43:32.1488053Z ##[group]Virtual Environment Provisioner
2022-03-31T00:43:32.1488520Z 1.0.0.0-main-20220307-1
2022-03-31T00:43:32.1488883Z ##[endgroup]
2022-03-31T00:43:32.1490059Z ##[group]GITHUB_TOKEN Permissions
2022-03-31T00:43:32.1490767Z Actions: write
2022-03-31T00:43:32.1491387Z Checks: write
2022-03-31T00:43:32.1491813Z Contents: write
2022-03-31T00:43:32.1492208Z Deployments: write
2022-03-31T00:43:32.1492630Z Discussions: write
2022-03-31T00:43:32.1492967Z Issues: write
2022-03-31T00:43:32.1493374Z Metadata: read
2022-03-31T00:43:32.1493762Z Packages: write
2022-03-31T00:43:32.1494090Z Pages: write
2022-03-31T00:43:32.1494486Z PullRequests: write
2022-03-31T00:43:32.1494949Z RepositoryProjects: write
2022-03-31T00:43:32.1495334Z SecurityEvents: write
2022-03-31T00:43:32.1495732Z Statuses: write
2022-03-31T00:43:32.1496126Z ##[endgroup]
2022-03-31T00:43:32.1500759Z Secret source: Actions
2022-03-31T00:43:32.1501474Z Prepare workflow directory
2022-03-31T00:43:32.2482210Z Prepare all required actions
2022-03-31T00:43:32.2700963Z Getting action download info
2022-03-31T00:43:32.5068671Z Download action repository 'google-github-actions/release-please-action@v3' (SHA:ce55e20fcc8f44138d1b6d8dc45953d377d833cd)
2022-03-31T00:43:33.6566335Z ##[group]Run google-github-actions/release-please-action@v3
2022-03-31T00:43:33.6566897Z with:
2022-03-31T00:43:33.6567211Z   release-type: node
2022-03-31T00:43:33.6567567Z   monorepo-tags: true
2022-03-31T00:43:33.6567935Z   path: workspaces/arborist
2022-03-31T00:43:33.6568758Z   changelog-types: [
  {"type":"feat","section":"Features","hidden":false},
  {"type":"fix","section":"Bug Fixes","hidden":false},
  {"type":"docs","section":"Documentation","hidden":false},
  {"type":"deps","section":"Dependencies","hidden":false},
  {"type":"chore","hidden":true}
]

2022-03-31T00:43:33.6569868Z   token: ***
2022-03-31T00:43:33.6570175Z   fork: false
2022-03-31T00:43:33.6570478Z   clean: true
2022-03-31T00:43:33.6570829Z   bump-minor-pre-major: false
2022-03-31T00:43:33.6571301Z   bump-patch-for-minor-pre-major: false
2022-03-31T00:43:33.6571718Z   draft: false
2022-03-31T00:43:33.6572074Z   draft-pull-request: false
2022-03-31T00:43:33.6572416Z ##[endgroup]
2022-03-31T00:43:34.4269766Z ✔ Looking for latest release on branch: latest with prefix: 
2022-03-31T00:43:57.8956604Z ✔ Building releases
2022-03-31T00:43:57.8983747Z ✔ Building strategies by path
2022-03-31T00:44:15.2631860Z 
2022-03-31T00:44:15.2699487Z ✔ Looking for latest release on branch: latest with prefix: 
2022-03-31T00:44:36.5079884Z ✔ Building pull requests
2022-03-31T00:44:36.5081816Z ✔ Building strategies by path
2022-03-31T00:44:36.5083348Z ✔ Collecting release commit SHAs
2022-03-31T00:44:36.8896115Z ✔ Collecting commits since all latest releases
2022-03-31T00:44:38.5878156Z ✔ PR #4628 has many files, backfilling
2022-03-31T00:44:45.9035843Z ✔ Splitting 40 commits by path
2022-03-31T00:44:45.9062576Z ✔ Building candidate release pull request for path: workspaces/arborist
2022-03-31T00:44:45.9129194Z ✔ Considering: 7 commits
2022-03-31T00:44:59.8504753Z ✔ Looking for open release pull requests
2022-03-31T00:45:01.3812983Z ✔ found 1 open release pull requests.
2022-03-31T00:45:02.0311850Z ⚠ file workspaces/arborist/package-lock.json did not exist
2022-03-31T00:45:02.0322860Z ⚠ file workspaces/arborist/npm-shrinkwrap.json did not exist
2022-03-31T00:45:02.0333241Z ⚠ file workspaces/arborist/samples/package.json did not exist
2022-03-31T00:45:02.5030166Z ✔ updating from 5.0.3 to 8.5.6
2022-03-31T00:45:02.5055848Z ⚠ file .release-please-manifest.json did not exist
2022-03-31T00:45:02.5061782Z ✔ Starting GitHub PR workflow...
2022-03-31T00:45:02.8275529Z ✔ Successfully found branch HEAD sha "668ec7f33b7a76f5e86a59f7e5a6c0e068a242b1".
2022-03-31T00:45:03.5274237Z ✔ Successfully created branch at https://api.github.com/repos/npm/cli/git/refs/heads/release-please--branches--latest
2022-03-31T00:45:03.8738862Z ✔ Got the latest commit tree
2022-03-31T00:45:04.4676078Z ✔ Successfully created a tree with the desired changes with SHA fb46baca294efd13ccdca75b56b2b608b062a7ca
2022-03-31T00:45:04.8440560Z ✔ Successfully created commit. See commit at https://api.github.com/repos/npm/cli/git/commits/b86505e26128b4f1ea6c92987197cb8da6b2d708
2022-03-31T00:45:05.2439487Z ✔ Successfully updated reference release-please--branches--latest to b86505e26128b4f1ea6c92987197cb8da6b2d708
2022-03-31T00:45:06.8802027Z ✔ Successfully opened pull request available at url: https://api.github.com/repos/npm/cli/pulls/4648.
2022-03-31T00:45:06.8803733Z ✔ Successfully opened pull request: 4648.
2022-03-31T00:45:07.5755028Z ✔ Successfully added labels autorelease: pending to issue: 4648
2022-03-31T00:45:07.9468145Z 
2022-03-31T00:45:07.9475376Z 
2022-03-31T00:45:07.9897289Z Cleaning up orphan processes

release-please cli logs

❯ npx release-please release-pr --release-type=node --token=XXX --path=workspaces/arborist --monorepo-tags --package-name=@npmcli/arborist --component=arborist --repo-url=npm/cli --dry-run --trace
✔ Looking for latest release on branch: latest with prefix: arborist
❯ Fetching merge commits on branch latest with cursor: undefined
❯ Fetching merge commits on branch latest with cursor: 668ec7f33b7a76f5e86a59f7e5a6c0e068a242b1 24
❯ Fetching merge commits on branch latest with cursor: 668ec7f33b7a76f5e86a59f7e5a6c0e068a242b1 49
❯ Fetching merge commits on branch latest with cursor: 668ec7f33b7a76f5e86a59f7e5a6c0e068a242b1 74
❯ Fetching merge commits on branch latest with cursor: 668ec7f33b7a76f5e86a59f7e5a6c0e068a242b1 99
❯ Fetching merge commits on branch latest with cursor: 668ec7f33b7a76f5e86a59f7e5a6c0e068a242b1 124
❯ Fetching merge commits on branch latest with cursor: 668ec7f33b7a76f5e86a59f7e5a6c0e068a242b1 149
❯ Fetching merge commits on branch latest with cursor: 668ec7f33b7a76f5e86a59f7e5a6c0e068a242b1 174
❯ Fetching merge commits on branch latest with cursor: 668ec7f33b7a76f5e86a59f7e5a6c0e068a242b1 199
❯ Fetching merge commits on branch latest with cursor: 668ec7f33b7a76f5e86a59f7e5a6c0e068a242b1 224
❯ Fetching releases with cursor undefined
❯ found release for arborist Version {
  major: 5,
  minor: 0,
  patch: 3,
  preRelease: undefined,
  build: undefined
}
❯ found release for arborist Version {
  major: 5,
  minor: 0,
  patch: 2,
  preRelease: undefined,
  build: undefined
}
❯ found release for arborist Version {
  major: 5,
  minor: 0,
  patch: 1,
  preRelease: undefined,
  build: undefined
}
❯ Fetching releases with cursor Y3Vyc29yOnYyOpK5MjAyMi0wMy0wOFQxMzo0MjowMC0wNzowMM4Dp5ds
❯ Fetching releases with cursor Y3Vyc29yOnYyOpK5MjAyMS0wOC0xOVQxMDoxMjowOS0wNzowMM4C3m8l
❯ Fetching releases with cursor Y3Vyc29yOnYyOpK5MjAyMS0wNC0wOVQxMDozMDoxMC0wNzowMM4Cdf4G
❯ Fetching releases with cursor Y3Vyc29yOnYyOpK5MjAyMS0wMS0wN1QxODo0MTowMC0wNzowMM4CJzL8
❯ Fetching releases with cursor Y3Vyc29yOnYyOpK5MjAyMC0xMC0wOVQxMTo0NjozMC0wNzowMM4B7i1p
❯ Fetching releases with cursor Y3Vyc29yOnYyOpK5MjAyMC0wMS0wOVQxMzo1MzozMy0wNzowMM4BWsWA
❯ Fetching releases with cursor Y3Vyc29yOnYyOpK5MjAxOS0wMi0wNlQxNDo0NDo0NC0wNzowMM4A6yb4
❯ found 3 possible releases. [
  Version {
    major: 5,
    minor: 0,
    patch: 3,
    preRelease: undefined,
    build: undefined
  },
  Version {
    major: 5,
    minor: 0,
    patch: 2,
    preRelease: undefined,
    build: undefined
  },
  Version {
    major: 5,
    minor: 0,
    patch: 1,
    preRelease: undefined,
    build: undefined
  }
]
✔ Building pull requests
✔ Building strategies by path
❯ workspaces/arborist: node
✔ Collecting release commit SHAs
❯ Fetching releases with cursor undefined
⚠ Found release tag with component '', but not configured in manifest
⚠ Found release tag with component 'libnpmexec', but not configured in manifest
⚠ Found release tag with component 'libnpmdiff', but not configured in manifest
❯ Found release for path workspaces/arborist, arborist-v5.0.3
❯ release for path: workspaces/arborist, version: 5.0.3, sha: 9d2b5776445124ee0d483c2e10674d8d04050775
✔ Collecting commits since all latest releases
❯ Set(1) { '9d2b5776445124ee0d483c2e10674d8d04050775' }
❯ Fetching merge commits on branch latest with cursor: undefined
❯ Backfilling file list for commit: 86eff5dccb9bce2eb8d80706e8dea855faf753b3
❯ Found 9 files
❯ Backfilling file list for commit: 9778a5387771256fc81e3587922c12ec47f750ea
❯ Found 12 files
✔ PR #4628 has many files, backfilling
❯ Backfilling file list for commit: aac01b89caf6336a2eb34d696296303cdadd5c08
❯ Found 114 files
❯ Backfilling file list for commit: 57dfae91f27ae4788d33a43e1f27b6445e4f2361
❯ Found 3 files
❯ Backfilling file list for commit: 726a8a07afeb3bd24979307679ce7e63c73b178e
❯ Found 3 files
❯ Backfilling file list for commit: 9593c783375eefb62f2f4d2bea83f81e6cf7fff0
❯ Found 2 files
❯ Backfilling file list for commit: 3e95536c01e50d7d9c8509b5bdb9c80822487eb4
❯ Found 8 files
❯ Backfilling file list for commit: da377eed5cba72185b90f5fc32ef288331c856ef
❯ Found 8 files
❯ Backfilling file list for commit: 0f1cd60a1cdb643782ae86a5a7fce84e357dbf10
❯ Found 3 files
❯ Backfilling file list for commit: 6e0a131d2ff3143856f388bb42c6568d5312c451
❯ Found 3 files
❯ Backfilling file list for commit: 0a957f5e2fbcce51c407d22b19e38004d09c51af
❯ Found 5 files
❯ Backfilling file list for commit: 57d8f75eb864486f6aa17bb3dd2f213b5c148073
❯ Found 4 files
❯ Backfilling file list for commit: f76d4f2f661bcc2534f541ee0e7d683155372baf
❯ Found 16 files
❯ Backfilling file list for commit: d8dcc02cfd354c1314c45d6530ec926cd138210c
❯ Found 15 files
❯ Backfilling file list for commit: a64acc0bf01e4bc68b26ead5b2d5c6db47ef16c2
❯ Found 3 files
❯ Fetching merge commits on branch latest with cursor: 668ec7f33b7a76f5e86a59f7e5a6c0e068a242b1 24
❯ Backfilling file list for commit: 45dd8b8615bb1d7a93e1733746581049a1f399e6
❯ Found 10 files
❯ Backfilling file list for commit: bd96ae4071f9cc8a65e741f414db12e98537971d
❯ Found 3 files
❯ Backfilling file list for commit: 6df061ec2a52882693ed86a3524ac6af0f88acd8
❯ Found 4 files
❯ Backfilling file list for commit: cc6c09431d7fe2db8ac1dc7a707f2dab7a7a1f83
❯ Found 70 files
❯ Backfilling file list for commit: 98bfd9a8cc23930e6becd15fffabadd1c269b0a2
❯ Found 1 files
❯ Backfilling file list for commit: e372636aa9c84ca596415463186931c72e4702ec
❯ Found 1 files
❯ Backfilling file list for commit: 92d2e192397ab4fd9587153cb541a7641e95320c
❯ Found 1 files
❯ Backfilling file list for commit: e328f0e80ca4e2447ce85f036b859f127a9d9d71
❯ Found 1 files
❯ Backfilling file list for commit: 5d91201d1c69e3c095a4eedf0f1d702f35b0d8c1
❯ Found 2 files
❯ Backfilling file list for commit: b40136bcaf32232e4cacdb517ce40f61871da159
❯ Found 2 files
❯ Backfilling file list for commit: aad53327f23b123d0e017338a9a1b65d40f21efe
❯ Found 2 files
✔ Splitting 49 commits by path
✔ Building candidate release pull request for path: workspaces/arborist
❯ type: node
❯ targetBranch: latest
❯ commits: 7
✔ Considering: 7 commits
❯ component: arborist
❯ pull request title pattern: undefined
Would open 1 pull requests
fork: false
title: chore(latest): release arborist 5.0.4
branch: release-please--branches--latest--components--arborist
draft: false
body: :robot: I have created a release *beep* *boop*
---


### [5.0.4](https://github.com/npm/cli/compare/arborist-v5.0.3...arborist-v5.0.4) (2022-03-31)


### Bug Fixes

* **arborist:** handle link nodes in old lockfiles correctly ([6f9cb49](https://github.com/npm/cli/commit/6f9cb490e7299976c43c6a118036c130671fe188))
* **arborist:** identify and repair invalid nodes in the virtual tree ([bd96ae4](https://github.com/npm/cli/commit/bd96ae4071f9cc8a65e741f414db12e98537971d))
* **arborist:** make sure resolveParent exists before checking props ([18b8b94](https://github.com/npm/cli/commit/18b8b94357d8f57301fbaa0f1e5dc2cf1128bf3e))
* make sure we loadOverrides on the root node in loadVirtual() ([99d8845](https://github.com/npm/cli/commit/99d88454248f950b82652b592fe2b4d019c1060b))
* only call npmlog progress methods if explicitly requested ([#4644](https://github.com/npm/cli/issues/4644)) ([668ec7f](https://github.com/npm/cli/commit/668ec7f33b7a76f5e86a59f7e5a6c0e068a242b1)), closes [#3314](https://github.com/npm/cli/issues/3314)

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
updates: 6
  workspaces/arborist/package-lock.json:  [class PackageLockJson extends DefaultUpdater]
  workspaces/arborist/npm-shrinkwrap.json:  [class PackageLockJson extends DefaultUpdater]
  workspaces/arborist/samples/package.json:  [class SamplesPackageJson extends DefaultUpdater]
  workspaces/arborist/CHANGELOG.md:  [class Changelog extends DefaultUpdater]
  workspaces/arborist/package.json:  [class PackageJson extends DefaultUpdater]
  .release-please-manifest.json:  [class ReleasePleaseManifest extends DefaultUpdater]

@bcoe bcoe closed this as completed in #459 Apr 20, 2022
bcoe added a commit that referenced this issue Apr 20, 2022
This allows for release-please to fallback to the deault value since it
uses the nullish coalescing operator for that check.

Fixes #457

Co-authored-by: Benjamin E. Coe <bencoe@google.com>
This was referenced Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment