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

Subsequent releases are not tagged as latest #71

Closed
3 of 6 tasks
GeeWizWow opened this issue May 22, 2022 · 4 comments
Closed
3 of 6 tasks

Subsequent releases are not tagged as latest #71

GeeWizWow opened this issue May 22, 2022 · 4 comments

Comments

@GeeWizWow
Copy link
Contributor

Issue type

  • bug report
  • idea
  • question
  • other

Not sure if this would be an issue with multi-semantic-release, or semantic-release, but have not observed it when using the latter.

Expected behavior

Publishing a new package, should result in it's GitHub release being tagged as latest.

Actual behavior

An older release is still tagged as latest

  • I've read the docs. This case is not mentioned
  • Similar issue does not exist

Steps to reproduce

  1. Create a new project, with one or more published workspaces, let multi-semantic-release create an initial 1.0.0 release for all workspaces.
  2. Add a commit to a single workspace, E.G. feat: blue
  3. Let multi-semantic-release create a new releases for the workspace.

Observe:

  • The initial 1.0.0 release is tagged as latest
  • The 1.1.0 release is not tagged as latest
  • The 1.1.0 release appears down the list of releases
  • The 1.1.0 tag appears down the list of tags
  • Visiting <repo_url>/releases/latest displays the 1.0.0 release

Demo:

https://github.com/GeeWizWow/multi-semrel

Screenshots:

image
image

@antongolub
Copy link
Member

Hey, @GeeWizWow,

I'm afraid, all packages of monorepo use the same release channel. Thus only one of them could be marked as the latest.

@GeeWizWow
Copy link
Contributor Author

Hi @antongolub

In this case lib-b@1.1.0 was made after the 1.0.0 releases, in a separate "release cycle", but is still not marked as latest.

But... Having spent some time reading about tag and release sorting on github, it seems that this issue is widespread and affects anyone not using semver tags.

Going to close this as it's not an issue with multi-semantic-release and can most likely be fixed by using a different tagFormat

@antongolub
Copy link
Member

antongolub commented May 24, 2022

That's interesting. In theory, it seems possible to use tags like v1.0.0+@scope/package-name. It should be semver compliant.

  1. Here's how semrel applies tagFormat option for tag parsing:
  const tagRegexp = `^${escapeRegExp(template(tagFormat)({version: ' '})).replace(' ', '(.+)')}`;

  return pReduce(
    branches,
    async (branches, branch) => {
      const branchTags = await pReduce(
        await getTags(branch.name, {cwd, env}),
        async (branchTags, tag) => {
          const [, version] = tag.match(tagRegexp) || [];
          return version && semver.valid(semver.clean(version))
            ? [...branchTags, {gitTag: tag, version, channels: (await getNote(tag, {cwd, env})).channels || [null]}]
            : branchTags;
        },
        []
      );
  1. semver validation regex: https://github.com/sindresorhus/semver-regex/blob/main/index.js#L2
    UPD the regex looks broken. I've pushed the PR to fix: fix: reduce some false positive matches sindresorhus/semver-regex#23

  2. perhaps we also need to tweak up a bit this piece of msr:

const getVersionFromTag = (pkg, tag) => {
	if (!pkg.name) return tag || null;
	if (!tag) return null;

	const strMatch = tag.match(/[0-9].[0-9].[0-9].*/); // mb replace *./ → [^+]*
	return strMatch && strMatch[0] && semver.valid(strMatch[0]) ? strMatch[0] : null;
};

Could you share the results of your experiments later?

antongolub added a commit that referenced this issue May 24, 2022
github-actions bot pushed a commit that referenced this issue May 24, 2022
# [6.4.0](v6.3.0...v6.4.0) (2022-05-24)

### Features

* support `${version}+${name}` tag format ([c53fefb](c53fefb)), closes [#71](#71)
* support `release.config.cjs` ([a6b9370](a6b9370))
@GeeWizWow
Copy link
Contributor Author

Hey, @antongolub 👋

It will be a couple of days before I can do any thorough testing, but from just a single quick and dirty test, it does look like using v${version}+${name} does sort the tags correctly. Have only done prereleases, so can't confirm if it fixes the issue with release ordering, but I'd imagine it does given tags are now sorting correctly.

FYI. I was attempting to set tagFormat as an option from the root package.json, and noticed it was being ignored, instead it's only picked up as a CLI arg, this may be expected, but for me it was contrary to expectations.

Does not work

root/
    package.json
        "release": {
            "tagFormat": "v${version}+${name}",
            ...
        }

Works

multi-semantic-release --tag-format='v${version}+${name}'

prisis referenced this issue in anolilab/semantic-release Sep 28, 2023
### ⚠ BREAKING CHANGES

* semantic-release/semantic-release@v19.0.5...v21.0.5
* drop support for cycled monorepos
* require Node.js v12
* sequentialPrepare is set to true, to disable pass `--no-sequential-prepare` option
* semrel npm plugin calls local npm version semantic-release/npm#445
* **engine:** the latest semantic-release requires Node.js 10.18
* drop nodejs v8

### Features

* add --tag-version-format flag ([259864c](259864c))
* add debugger ([d2c090d](d2c090d))
* add dependencies updating controller ([0c9b040](0c9b040))
* add execa queued hook ([042933e](042933e))
* add execasync CLI flag to make execa calls be always synchronous ([693438c](693438c)), closes [#1](#1)
* add meow as cli provider ([6de93b9](6de93b9))
* add pnpm and bolt support ([91465de](91465de))
* add process.spawn arg watcher ([7699b6f](7699b6f))
* add sequential-init flag to avoid hypothetical concurrent initialization collisions ([348678e](348678e))
* add some debug messages ([ec792e1](ec792e1))
* added declarative config support ([c98ff10](c98ff10))
* allow to run prepare steps sequentially ([299748a](299748a))
* apply --first-parent filter to commits ([14a896b](14a896b))
* apply queuefy to plugin methods instead of execa ([9ae7d0d](9ae7d0d))
* bump semrel to v19 ([e6b8acb](e6b8acb))
* check that sequentialPrepare is not enabled on cyclic projects ([68c1198](68c1198))
* **debug:** attach pkg prefixes to debug notes ([25e111f](25e111f))
* **debug:** log manifest deps changes ([88b4077](88b4077)), closes [#27](#27)
* **debug:** print passed cli flags ([d720cd7](d720cd7))
* drop nodejs v8 support ([80f0a24](80f0a24))
* enable `sequentialPrepare` flag by default ([ad7e81f](ad7e81f))
* enable first-parent commits filtering by cli flag ([33306cc](33306cc))
* **engine:** up nodejs version ([10af385](10af385))
* handle .cjs configs ([38f657a](38f657a))
* ignore packages to be released with workspaces and CLI ([#42](#42)) ([b98e181](b98e181))
* Initial commit ([942ef94](942ef94))
* introduce `deps.prefix` flag to inject carets ([c3f4529](c3f4529))
* introduce `ignorePrivate` flag ([e4891c9](e4891c9)), closes [#66](#66)
* introduce `log-level` config option ([3fb6584](3fb6584))
* introduce a silent mode([#88](https://github.com/anolilab/multi-semantic-release/issues/88)) ([47a27d8](47a27d8))
* let publish step run in parallel ([4d5c451](4d5c451))
* log filtered commits in debug ([c64b8e1](c64b8e1))
* log manifest path ([db451e8](db451e8))
* new updated version of the multi-semantic-release lib ([54be8b7](54be8b7))
* prefer nested CLI flags ([1bf08cc](1bf08cc))
* provide pre-release flow ([6a9ce16](6a9ce16)), closes [#25](#25)
* replace synchronizer with @semrel-extra/topo ([ddd1032](ddd1032))
* support `${version}+${name}` tag format ([c53fefb](c53fefb)), closes [#71](https://github.com/anolilab/multi-semantic-release/issues/71)
* support `release.config.cjs` ([a6b9370](a6b9370))
* support workspace.packages notation ([4a606b2](4a606b2))
* tech release ([828a82d](828a82d))
* update semver from v19 to v21 ([6e4c378](6e4c378))
* uphold the prev package.json indents ([ac5832f](ac5832f))

### Bug Fixes

* add flag to enable sequentialPrepare mode ([70c2dc5](70c2dc5))
* add sync point for publish step ([adc823e](adc823e))
* allow any `todo` package to run the `generateNotes` queue ([26a87d7](26a87d7)), closes [#9](#9)
* apply deps update before npm's plugin prepare ([77b6ee2](77b6ee2))
* avoid non-updated local dependencies bump ([#33](#33)) ([9faeef6](9faeef6))
* beautify log labels ([78cbc8a](78cbc8a))
* bump-up of pre-version  ([02ef270](02ef270))
* **cli:** fix inner spawnhook call ([70aa292](70aa292))
* **cli:** restore watchspawn context ([56145aa](56145aa))
* **config:** fix `options` and `plugins` resolver ([56e974c](56e974c))
* correct global config use ([8e5fb99](8e5fb99))
* dont fetch tags if tags arg is empty array ([3a79558](3a79558))
* ensure msr cli flags take precedence over their semrel equivalents ([2be75fa](2be75fa))
* filter only tags that are valid ([59b61ad](59b61ad))
* filter queued packages on generateNotes stage ([e0625ce](e0625ce)), closes [#6](#6)
* fix cascade bumping when some dep belongs to several levels of the dep tree ([cf20dea](cf20dea))
* fix debug logging ([71527b2](71527b2))
* fix export point ([cf31425](cf31425))
* fix getNextVersion resolver ([7275ae7](7275ae7))
* fix globbing on Windows ([#57](#57)) ([1d71d21](1d71d21))
* fix internal flag ref filterParent → firstParent ([8c7400f](8c7400f))
* fix logger path ([232d2dc](232d2dc))
* fix nextType resolver ([606914b](606914b))
* fix pkgOptions resolver ([2a2f0cf](2a2f0cf))
* force a release ([1e3ece5](1e3ece5))
* getVersionFromTag tests to fix release process ([e7f1646](e7f1646))
* local dependencies correct bump from release to prerelease ([#34](#34)) ([6481a59](6481a59))
* make logger to be singleton ([1790794](1790794))
* missing @ in tagFormat ([3faa0f1](3faa0f1))
* more robust stream rescoping (to fix bug in npm module) ([34c7c62](34c7c62))
* override env.TRAVIS_PULL_REQUEST_BRANCH to fix PR checks on travis-ci ([e4b1929](e4b1929)), closes [#11](#11)
* **package:** add missed sem-rel plugins ([f3c9318](f3c9318))
* **package:** up deps, fix some vuls ([d8905b0](d8905b0))
* **package:** up deps, fix vulns ([5a4d91e](5a4d91e))
* **package:** update execa to be compatible with sem-rel 15.13.28 ([069bb4e](069bb4e)), closes [#7](#7)
* pass stderr and stdout into semantic's getConfig (bug in npm) ([cf596cb](cf596cb))
* pin npm as peer dep ([67d8b80](67d8b80))
* pin npm version to v8.4.1 ([22c89d1](22c89d1)), closes [#60](#60)
* preserve trailing whitespace in manifest ([06426ec](06426ec))
* print queued pkg count instead of total ([d893a7f](d893a7f))
* process optional deps during manifest update ([4b7066c](4b7066c))
* provide partial release ([898998a](898998a))
* publish updated deps ([791f55a](791f55a)), closes [#1](#1)
* rm npm from peer deps ([307e505](307e505))
* **sequential-prepare:** do not wait forever when a child package has no change ([713046a](713046a))
* specify used but forgotten dependencies ([73def7f](73def7f))
* sync pkg version after running the npm plugin ([1d24e45](1d24e45))
* trigger next pkg `prepare` after the prev `publish` ([f74d185](f74d185))
* try to prevent deps update rollback ([9108350](9108350))
* up deps, fix some vuls ([2d5cf86](2d5cf86))
* update deps, fix some vuls ([f3cafc8](f3cafc8))
* update manifest version before npm plugin prepare step ([a1ae4c3](a1ae4c3)), closes [#58](#58)
* **update-deps:** properly resolve next pre-versions ([62b348e](62b348e))
* wrong context.commits when have multiple releases commit ([f82f125](f82f125))

### Performance Improvements

* deps revision ([4f62817](4f62817))
* log improvements ([c45dccc](c45dccc))
* log multi-sem-rel flags ([75389e0](75389e0))
* log yarn paths ([3896d5c](3896d5c))
* **package:** up deps ([506a0e8](506a0e8))
* **package:** up deps ([6b903a7](6b903a7))
* **package:** up deps & tech release ([bf00b41](bf00b41))
* refactor nextPreVersion to reduce cognitive complexity ([#35](#35)) ([601bbd3](601bbd3))
* straighten plugins execution pipeline ([e57fe2f](e57fe2f)), closes [#4](#4)
* up deps ([f9e0c8a](f9e0c8a))
* up deps, minor code improvements ([a7aa625](a7aa625))
* various synchronizer optimizations ([87a7602](87a7602))

### Code Refactoring

* move to ESM ([99fffa9](99fffa9))
prisis referenced this issue in anolilab/semantic-release Sep 28, 2023
### ⚠ BREAKING CHANGES

* semantic-release/semantic-release@v19.0.5...v21.0.5
* drop support for cycled monorepos
* require Node.js v12
* sequentialPrepare is set to true, to disable pass `--no-sequential-prepare` option
* semrel npm plugin calls local npm version semantic-release/npm#445
* **engine:** the latest semantic-release requires Node.js 10.18
* drop nodejs v8

### Features

* add --tag-version-format flag ([259864c](259864c))
* add debugger ([d2c090d](d2c090d))
* add dependencies updating controller ([0c9b040](0c9b040))
* add execa queued hook ([042933e](042933e))
* add execasync CLI flag to make execa calls be always synchronous ([693438c](693438c)), closes [#1](#1)
* add meow as cli provider ([6de93b9](6de93b9))
* add pnpm and bolt support ([91465de](91465de))
* add process.spawn arg watcher ([7699b6f](7699b6f))
* add sequential-init flag to avoid hypothetical concurrent initialization collisions ([348678e](348678e))
* add some debug messages ([ec792e1](ec792e1))
* added declarative config support ([c98ff10](c98ff10))
* allow to run prepare steps sequentially ([299748a](299748a))
* apply --first-parent filter to commits ([14a896b](14a896b))
* apply queuefy to plugin methods instead of execa ([9ae7d0d](9ae7d0d))
* bump semrel to v19 ([e6b8acb](e6b8acb))
* check that sequentialPrepare is not enabled on cyclic projects ([68c1198](68c1198))
* **debug:** attach pkg prefixes to debug notes ([25e111f](25e111f))
* **debug:** log manifest deps changes ([88b4077](88b4077)), closes [#27](#27)
* **debug:** print passed cli flags ([d720cd7](d720cd7))
* drop nodejs v8 support ([80f0a24](80f0a24))
* enable `sequentialPrepare` flag by default ([ad7e81f](ad7e81f))
* enable first-parent commits filtering by cli flag ([33306cc](33306cc))
* **engine:** up nodejs version ([10af385](10af385))
* handle .cjs configs ([38f657a](38f657a))
* ignore packages to be released with workspaces and CLI ([#42](#42)) ([b98e181](b98e181))
* Initial commit ([942ef94](942ef94))
* introduce `deps.prefix` flag to inject carets ([c3f4529](c3f4529))
* introduce `ignorePrivate` flag ([e4891c9](e4891c9)), closes [#66](#66)
* introduce `log-level` config option ([3fb6584](3fb6584))
* introduce a silent mode([#88](https://github.com/anolilab/multi-semantic-release/issues/88)) ([47a27d8](47a27d8))
* let publish step run in parallel ([4d5c451](4d5c451))
* log filtered commits in debug ([c64b8e1](c64b8e1))
* log manifest path ([db451e8](db451e8))
* new updated version of the multi-semantic-release lib ([8bdc8be](8bdc8be))
* prefer nested CLI flags ([1bf08cc](1bf08cc))
* provide pre-release flow ([6a9ce16](6a9ce16)), closes [#25](#25)
* replace synchronizer with @semrel-extra/topo ([ddd1032](ddd1032))
* support `${version}+${name}` tag format ([c53fefb](c53fefb)), closes [#71](https://github.com/anolilab/multi-semantic-release/issues/71)
* support `release.config.cjs` ([a6b9370](a6b9370))
* support workspace.packages notation ([4a606b2](4a606b2))
* tech release ([828a82d](828a82d))
* update semver from v19 to v21 ([6e4c378](6e4c378))
* uphold the prev package.json indents ([ac5832f](ac5832f))

### Bug Fixes

* add flag to enable sequentialPrepare mode ([70c2dc5](70c2dc5))
* add sync point for publish step ([adc823e](adc823e))
* added missing publishConfig ([f00ea9a](f00ea9a))
* allow any `todo` package to run the `generateNotes` queue ([26a87d7](26a87d7)), closes [#9](#9)
* apply deps update before npm's plugin prepare ([77b6ee2](77b6ee2))
* avoid non-updated local dependencies bump ([#33](#33)) ([9faeef6](9faeef6))
* beautify log labels ([78cbc8a](78cbc8a))
* bump-up of pre-version  ([02ef270](02ef270))
* **cli:** fix inner spawnhook call ([70aa292](70aa292))
* **cli:** restore watchspawn context ([56145aa](56145aa))
* **config:** fix `options` and `plugins` resolver ([56e974c](56e974c))
* correct global config use ([8e5fb99](8e5fb99))
* dont fetch tags if tags arg is empty array ([3a79558](3a79558))
* ensure msr cli flags take precedence over their semrel equivalents ([2be75fa](2be75fa))
* filter only tags that are valid ([59b61ad](59b61ad))
* filter queued packages on generateNotes stage ([e0625ce](e0625ce)), closes [#6](#6)
* fix cascade bumping when some dep belongs to several levels of the dep tree ([cf20dea](cf20dea))
* fix debug logging ([71527b2](71527b2))
* fix export point ([cf31425](cf31425))
* fix getNextVersion resolver ([7275ae7](7275ae7))
* fix globbing on Windows ([#57](#57)) ([1d71d21](1d71d21))
* fix internal flag ref filterParent → firstParent ([8c7400f](8c7400f))
* fix logger path ([232d2dc](232d2dc))
* fix nextType resolver ([606914b](606914b))
* fix pkgOptions resolver ([2a2f0cf](2a2f0cf))
* force a release ([1e3ece5](1e3ece5))
* getVersionFromTag tests to fix release process ([e7f1646](e7f1646))
* local dependencies correct bump from release to prerelease ([#34](#34)) ([6481a59](6481a59))
* make logger to be singleton ([1790794](1790794))
* missing @ in tagFormat ([3faa0f1](3faa0f1))
* more robust stream rescoping (to fix bug in npm module) ([34c7c62](34c7c62))
* override env.TRAVIS_PULL_REQUEST_BRANCH to fix PR checks on travis-ci ([e4b1929](e4b1929)), closes [#11](#11)
* **package:** add missed sem-rel plugins ([f3c9318](f3c9318))
* **package:** up deps, fix some vuls ([d8905b0](d8905b0))
* **package:** up deps, fix vulns ([5a4d91e](5a4d91e))
* **package:** update execa to be compatible with sem-rel 15.13.28 ([069bb4e](069bb4e)), closes [#7](#7)
* pass stderr and stdout into semantic's getConfig (bug in npm) ([cf596cb](cf596cb))
* pin npm as peer dep ([67d8b80](67d8b80))
* pin npm version to v8.4.1 ([22c89d1](22c89d1)), closes [#60](#60)
* preserve trailing whitespace in manifest ([06426ec](06426ec))
* print queued pkg count instead of total ([d893a7f](d893a7f))
* process optional deps during manifest update ([4b7066c](4b7066c))
* provide partial release ([898998a](898998a))
* publish updated deps ([791f55a](791f55a)), closes [#1](#1)
* rm npm from peer deps ([307e505](307e505))
* **sequential-prepare:** do not wait forever when a child package has no change ([713046a](713046a))
* specify used but forgotten dependencies ([73def7f](73def7f))
* sync pkg version after running the npm plugin ([1d24e45](1d24e45))
* trigger next pkg `prepare` after the prev `publish` ([f74d185](f74d185))
* try to prevent deps update rollback ([9108350](9108350))
* up deps, fix some vuls ([2d5cf86](2d5cf86))
* update deps, fix some vuls ([f3cafc8](f3cafc8))
* update manifest version before npm plugin prepare step ([a1ae4c3](a1ae4c3)), closes [#58](#58)
* **update-deps:** properly resolve next pre-versions ([62b348e](62b348e))
* wrong context.commits when have multiple releases commit ([f82f125](f82f125))

### Performance Improvements

* deps revision ([4f62817](4f62817))
* log improvements ([c45dccc](c45dccc))
* log multi-sem-rel flags ([75389e0](75389e0))
* log yarn paths ([3896d5c](3896d5c))
* **package:** up deps ([506a0e8](506a0e8))
* **package:** up deps ([6b903a7](6b903a7))
* **package:** up deps & tech release ([bf00b41](bf00b41))
* refactor nextPreVersion to reduce cognitive complexity ([#35](#35)) ([601bbd3](601bbd3))
* straighten plugins execution pipeline ([e57fe2f](e57fe2f)), closes [#4](#4)
* up deps ([f9e0c8a](f9e0c8a))
* up deps, minor code improvements ([a7aa625](a7aa625))
* various synchronizer optimizations ([87a7602](87a7602))

### Code Refactoring

* move to ESM ([99fffa9](99fffa9))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants