0

Long story short: Lerna is not detecting the latest git tags after a successful publish. Can I recover from this without re-publishing all the packages which included several major version bumps via the conventional commit setting and duplicating changelogs?

Long story: I did a massive update of dependencies in a design system project I was assigned to after the maintainers left the company. When I was ready to release I created a release branch and ran lerna version --include-merged-tags and created a PR. Once it was merged the CI hooks picked it up and published all the packages to our internal npm registry using a bash script containing private registry config set and lerna publish from-package --yes. However, now when I run lerna updated --include-merged-tags on the up to date main branch I get all those packages listed again and lerna version wants to bump their versions.

git describe --abbrev=0 --tags shows a tag at the previously published version:

❯ git describe --abbrev=0 --tags
@design-system/[email protected]
# should be 6.0.0 ---^

git show @design-system/[email protected] shows an annotated tag with the publish commit message/diff:

❯ git show @design-system/[email protected]
tag @design-system/[email protected]
Tagger: Jared McAteer <[email protected]>
Date:   Wed Jan 8 08:42:40 2025 -0700

@design-system/[email protected]

commit f60e1679
Author: Jared McAteer <[email protected]>
Date:   Wed Jan 8 08:42:32 2025 -0700

    Publish

     - [email protected]
     <truncated>
     - @design-system/[email protected]
     <truncated>

git log on the main branch shows a different commit hash (the pr merge message):

❯ git log
commit 13a99886
Author: Jared McAteer <[email protected]>
Date:   Wed Jan 8 15:07:22 2025 -0700

    Publish (#297)

    - [email protected]
     <truncated>
     - @design-system/[email protected]
     <truncated>

The commit hash for the tag, f60e1679, is different from the latest commit in main, 13a99886. f60e1679 belongs to the commit in the release branch that was merged to main via github PR. I suspect this is the source of my woes, but I don't know how I can fix this without bumping versions and republishing all those packages.

Can I mass update the tags to point at f60e1679? Or is there a better way to recover?

FWIW There is no activity on this repository that isn't my teammate or I right now, so rewriting history isn't a huge concern if that's what it requires.


lerna info

  • version: 7.4.2

  • config:

{
  "packages": [
    "docs",
    "packages/components/*",
    "packages/icons/*",
    "packages/models/*",
    "packages/utils/*"
  ],
  "version": "independent",
  "useNx": true,
  "command": {
    "publish": {
      "conventionalCommits": true
    }
  },
  "ignoreChanges": [
    "**/*.mdx",
    "**/__snapshots__/*",
    "**/*.test.tsx"
  ]
}

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.