Skip to content

Change versioning strategies from Fixed/Locked mode to Independent mode throw body is too long #3833

@msobiecki

Description

@msobiecki

Current Behavior

Changing the way packages are published in the repository from fixed/blocked mode to independent mode causes an error when trying to publish packages in independent mode.

This problem occurs when the changelog for packages already contained many entries, when trying to publish in Independent mode, Lerna tries to release the GitHub Tags for each package with the entire changelog since the repository was created, which causes an error "body is too long (maximum is 125000 characters)".

lerna info auto-confirmed 
lerna info execute Creating releases...
lerna info git Pushing tags...
lerna ERR! HttpError: Validation Failed: {"resource":"Release","code":"custom","field":"body","message":"body is too long (maximum is 125000 characters)"}
lerna ERR!     at /home/project/node_modules/.pnpm/@octokit+request@6.2.8/node_modules/@octokit/request/dist-node/index.js:122:21
lerna ERR!     at processTicksAndRejections (node:internal/process/task_queues:96:5)
lerna ERR! HttpError: Validation Failed: {"resource":"Release","code":"custom","field":"body","message":"body is too long (maximum is 125000 characters)"}
lerna ERR!     at /home/project/node_modules/.pnpm/@octokit+request@6.2.8/node_modules/@octokit/request/dist-node/index.js:122:21
lerna ERR!     at processTicksAndRejections (node:internal/process/task_queues:96:5)
lerna ERR! lerna Validation Failed: {"resource":"Release","code":"custom","field":"body","message":"body is too long (maximum is 125000 characters)"}
 ELIFECYCLE  Command failed with exit code 1.

Expected Behavior

Lerna should trim body appropriately and allow packages to be published when migrating from Fixed/Locked mode to Independent mode?

Steps to Reproduce

I'm not entirely sure what the problem is and how to reproduce the error exactly.

But I noticed that after changing to Independent mode, release GitHub Tags tries to generate a body from the last release of this package, in this case, if there was no such package before, it tries to generate a body from the beginning in fixed/blocked mode:
https://github.com/msobiecki/repro-lerna/releases/tag/test%400.0.171

Failure Logs / Configuration

lerna.json

{
  "exact": true,
  "npmClient": "pnpm",
  "version": "independent",
  "command": {
    "init": {
      "exact": true
    },
    "version": {
      "exact": true,
      "changelogPreset": "eslint",
      "conventionalCommits": true,
      "message": "release [skip ci] NO_CI",
      "noCommitHooks": true
    }
  }
}

Environment

 Environment info:

  System:
    OS: Linux 5.15 Ubuntu 20.04.3 LTS (Focal Fossa)
    CPU: (16) x64 11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz
  Binaries:
    Node: 16.18.0 - ~/.nvm/versions/node/v16.18.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v16.18.0/bin/yarn
    npm: 8.19.2 - ~/.nvm/versions/node/v16.18.0/bin/npm
  Utilities:
    Git: 2.25.1 - /usr/bin/git
  npmPackages:
    lerna: ^7.2.0 => 7.2.0 

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting-prsWe would gladly receive a PR to resolve this issuetype: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions