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

Lerna-lite fails to create github tags and releases #759

Closed
5 tasks done
waldronmatt opened this issue Nov 12, 2023 · 7 comments
Closed
5 tasks done

Lerna-lite fails to create github tags and releases #759

waldronmatt opened this issue Nov 12, 2023 · 7 comments

Comments

@waldronmatt
Copy link

waldronmatt commented Nov 12, 2023

Describe the bug

Thanks so much for your contributions to this project. I came across an odd issue in my repo via https://github.com/waldronmatt/pnpm-nx-lerna-lite-boilerplate where running lerna changed and lerna version successfully identifies packages needing to be versioned, but fails to generate the github tags and releases. Everything was working fine for auto versioning on November 7th and since then I haven't been able to trigger a release.

I tried:

  • Downgrading to node v16
  • Verifying my github token is not expired
  • Verified that all lerna-lite packages are up-to-date

Expectation

Lerna-lite auto publishes github tags and releases

Reproduction

  • Update any package using conventional commits via pnpm commit

https://github.com/waldronmatt/pnpm-nx-lerna-lite-boilerplate

Lerna config and logs

lerna.json

{
  "$schema": "node_modules/@lerna-lite/cli/schemas/lerna-schema.json",
  "packages": ["apps/*", "configs/*", "docs/*", "packages/*"],
  "npmClient": "pnpm",
  "loglevel": "verbose",
  "version": "independent",
  "command": {
    "publish": {
      "cleanupTempFiles": true,
      "registry": "https://registry.npmjs.org"
    },
    "version": {
      "allowBranch": "main",
      "changelogIncludeCommitsClientLogin": " - by @%l",
      "conventionalCommits": true,
      "createRelease": "github",
      "ignoreChanges": ["**/CHANGELOG.md", "**/node_modules/**"],
      "message": "chore(release): publish",
      "syncWorkspaceLock": true
    }
  },
  "changelogPreset": "conventional-changelog-conventionalcommits"
}

lerna-debug.log

lerna-lite notice cli v2.6.0
lerna-lite verb rootPath /home/runner/work/pnpm-nx-lerna-lite-boilerplate/pnpm-nx-lerna-lite-boilerplate
lerna-lite info versioning independent
lerna-lite info ci enabled
lerna-lite verb project packages apps/* configs/* docs/* packages/*
lerna-lite verb isAnythingCommitted 1
lerna-lite verb currentBranch main
lerna-lite verb git-describe.sync "*@*" => "@waldronmatt/basic-math@2.0.15-10-g9c259a3"
lerna-lite verb exec git log @waldronmatt/basic-math@2.0.15..HEAD --format="%h %aI" --reverse
lerna-lite info oldestCommitSinceLastTag commit found since last tag: @waldronmatt/basic-math@2.0.15 - (SHA) 8f9d135 - [20](https://github.com/waldronmatt/pnpm-nx-lerna-lite-boilerplate/actions/runs/6842724656/job/18604516824#step:13:21)23-11-07T[22](https://github.com/waldronmatt/pnpm-nx-lerna-lite-boilerplate/actions/runs/6842724656/job/18604516824#step:13:23):14:13+00:00
lerna-lite verb git config --get remote.origin.url
lerna-lite verb github found 12 commits since last release timestamp 20[23](https://github.com/waldronmatt/pnpm-nx-lerna-lite-boilerplate/actions/runs/6842724656/job/18604516824#step:13:24)-11-07T22:14:13+00:00
lerna-lite verb hasTags filter for tags with '*@*' pattern
lerna-lite verb hasTags true
lerna-lite verb git-describe.sync "*@*" => "@waldronmatt/basic-math@2.0.15-10-g9c[25](https://github.com/waldronmatt/pnpm-nx-lerna-lite-boilerplate/actions/runs/6842724656/job/18604516824#step:13:26)9a3"
lerna-lite info Looking for changed packages since @waldronmatt/basic-math@2.0.15
lerna-lite info ignoring diff in paths matching **/CHANGELOG.md **/node_modules/**
lerna-lite verb filtered diff configs/eslint-config-custom/package.json
lerna-lite verb filtered diff configs/jest-config/package.json
lerna-lite verb filtered diff docs/repo/COMMANDS.md docs/repo/README.md docs/repo/TOOLS.md docs/repo/WORKSPACE.md
lerna-lite verb updated vite-project
lerna-lite verb updated eslint-config-custom
lerna-lite verb updated jest-config
lerna-lite verb updated monorepo-docs
lerna-lite verb updated demo-ui-storybook
lerna-lite verb updated @waldronmatt/basic-math
lerna-lite verb updated @waldronmatt/parity
lerna-lite verb updated @waldronmatt/demo-ui
lerna-lite verb getChangelogConfig using preset "conventional-changelog-conventionalcommits"
lerna-lite verb getChangelogConfig Attempting to resolve preset "conventional-changelog-conventionalcommits"
lerna-lite info getChangelogConfig Successfully resolved preset "conventional-changelog-conventionalcommits"

Environment Info

System:
OS: Windows 11 10.0.22621
CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
Memory: 7.58 GB / 15.80 GB
Binaries:
Node: 18.12.1 - ~.nvm\versions\node\v18.12.1\bin\node.EXE
Yarn: 1.22.18 - ~\AppData\Roaming\npm\yarn.CMD
npm: 8.19.2 - ~.nvm\versions\node\v18.12.1\bin\npm.CMD
pnpm: 8.6.12 - ~\AppData\Roaming\npm\pnpm.CMD
Browsers:
Edge: Chromium
Internet Explorer

Used Package Manager

pnpm

Validations

@ghiscoding
Copy link
Member

ghiscoding commented Nov 12, 2023

Everything was working fine for auto versioning on November 7th and since then I haven't been able to trigger a release.

hmm sorry but that's like going to garage and saying my car is broken without providing much more info. 😮

If it's related to conventional changelog then maybe try to downgrade to an earlier version of Lerna-Lite maybe 2.0 (without using ^ to make it a fixed version) to see if there's a regression, there were a lot of conventional-changelog changes in the past year and they aren't providing much info on how to upgrade to their latest versions. I also couldn't keep up with their latest version, the orignal Lerna made it work with latest and I will try to replicate their PR and hope that it works. I'll be working on the next major 3.0 in a month or so that will include the upgrade to conventional changelog PR that I just mentioned, I will drop Node 16 too and any Nx related stuff (that is the lerna exec --useNx), you can also see Roadmap 3.0.

Side note, I'm doing my best to keep this project updated but I have to admit there's a lot of pieces that I don't understand from this project, especially the git stuff since I mostly use VSCode UI for that.

The project works fine for me here and I also used it in 2 other monorepos of mine just a couple days ago without any issues. However, I did notice the lerna version to be very slow, I thought it hanged, and it turns out to be that my project was really out of date for unknown reasons and Lerna runs git remote update before creating the version itself... anyway, I managed to find it by using "loglevel": "silly" in my Lerna config, this might help you find where it hangs if that is the case.

I don't think I can help much more than that, you could try to debug it yourself, try to read the troubleshooting Wiki

@waldronmatt
Copy link
Author

thanks for your reply @ghiscoding, I tried your suggestions. I tried downgrading to V2 without success. Also tried pulling the latesttags in my cicd and even tested #701 to see if this was the issue. I would provide more details if I could, but this has me pretty stumped. I included my lerna config and cicd output above, but not sure how helpful this is to you. Once other thing I could try is disabling kodiak since I introduced that around the same time the issue was occurring.

Also, really looking forward to when you release v3 of this project. I'll be sure to test out the new updates

@ghiscoding
Copy link
Member

ghiscoding commented Nov 12, 2023

anyway, I managed to find it by using "loglevel": "silly" in my Lerna config, this might help you find where it hangs if that is the case.

I think this is about the only thing I could suggest to find out what last command is being called. You can try to run the command yourself and see what happens. I'm afraid I can't help more than that, it looks like it's a problem that is only on your side though

@waldronmatt
Copy link
Author

thanks for your help @ghiscoding . After logging using "silly", I traced the issue to here lerna/lerna#2138. Removing this line fixed the issue and now versioning is working as expected.

"changelogPreset": "conventional-changelog-conventionalcommits"

@ghiscoding
Copy link
Member

ghiscoding commented Nov 13, 2023

Great happy to know you resolved it, I found the silly logs to be quite helpful too :)

BTW, it might be because you were using the latest version conventional-changelog-conventionalcommits but it's not yet compatible in Lerna-Lite at least not until I address the PR that I mentioned above which is to update all conventional-changelog dependencies, whenever I'm able to do that, then you'll be able to use the latest version... a simpler way of saying that if you use an older version conventional-changelog-conventionalcommits then it will probably work (maybe v5.0.0), anyway this will hopefully work soon in my next major, I can ping you back when that happens.

@waldronmatt
Copy link
Author

Sounds great thank you! I'm subscribed to this project so I'll be able to test right away when version 3 drops. Appreciate the help

@ghiscoding
Copy link
Member

I've published v2.7.1, that should help with conventional-changelog-conventionalcommits since that is what the Lerna's PR was categorized as fixing. Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants