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

MSR cannot run own tests if PR based on project branch #11

Closed
antongolub opened this issue Jun 26, 2020 · 1 comment
Closed

MSR cannot run own tests if PR based on project branch #11

antongolub opened this issue Jun 26, 2020 · 1 comment
Assignees
Labels
bug Something isn't working released

Comments

@antongolub
Copy link
Member

env-ci relies on env=process.env and cwd, but the first has an advantage.

env-ci

configuration({env}) {
		// ...
		return {
                         ...
			prBranch: env.TRAVIS_PULL_REQUEST_BRANCH,
			slug: env.TRAVIS_REPO_SLUG,
			root: env.TRAVIS_BUILD_DIR,
		};

semantic-release

  const context = {
    cwd,
    env,
    stdout: stdout || process.stdout,
    stderr: stderr || process.stderr,
    envCi: envCi({env, cwd}),
  };
  // ...
  const {isCi, branch: ciBranch, isPr} = context.envCi;
  // ...
  // Verify config
  await verify(context);

  options.repositoryUrl = await getGitAuthUrl({...context, branch: {name: ciBranch}});
  context.branches = await getBranches(options.repositoryUrl, ciBranch, context);
  context.branch = context.branches.find(({name}) => name === ciBranch);

  if (!context.branch) {
    logger.log(
      `This test run was triggered on the branch ${ciBranch}, while semantic-release is configured to only publish from ${context.branches
        .map(({name}) => name)
        .join(', ')}, therefore a new version won’t be published.`
    );
    return false;
  }

jobs/353878770

FAIL test/lib/multiSemanticRelease.test.js
  ● multiSemanticRelease() › Initial commit (changes in all packages)
    expect(received).toMatch(expected)
    Expected substring: "Created tag msr-test-a@1.0.0"
    Received string:    "[9:52:11 AM] › 🎉  Started multirelease! Loading 4 packages...
    [9:52:11 AM] › ✔  Loaded package msr-test-a
    [9:52:11 AM] › ✔  Loaded package msr-test-b
    [9:52:11 AM] › ✔  Loaded package msr-test-c
    [9:52:11 AM] › ✔  Loaded package msr-test-d
    [9:52:11 AM] › 🎉  Queued 4 packages! Starting release...
    [9:52:11 AM] [msr-test-a] › ℹ  Running semantic-release version 17.1.1
    [9:52:11 AM] [msr-test-b] › ℹ  Running semantic-release version 17.1.1
    [9:52:11 AM] [msr-test-c] › ℹ  Running semantic-release version 17.1.1
    [9:52:11 AM] [msr-test-d] › ℹ  Running semantic-release version 17.1.1
    [9:52:12 AM] [msr-test-c] › ℹ  This test run was triggered on the branch upd, while semantic-release is configured to only publish from master, therefore a new version won’t be published.
    [9:52:12 AM] [msr-test-a] › ℹ  This test run was triggered on the branch upd, while semantic-release is configured to only publish from master, therefore a new version won’t be published.
    [9:52:12 AM] [msr-test-b] › ℹ  This test run was triggered on the branch upd, while semantic-release is configured to only publish from master, therefore a new version won’t be published.
    [9:52:12 AM] [msr-test-d] › ℹ  This test run was triggered on the branch upd, while semantic-release is configured to only publish from master, therefore a new version won’t be published.
    [9:52:12 AM] › 🎉  Released 0 of 4 packages, semantically!
@antongolub antongolub added the bug Something isn't working label Jun 26, 2020
@antongolub antongolub self-assigned this Jun 26, 2020
qiwibot added a commit that referenced this issue Jun 26, 2020
## [3.0.3](v3.0.2...v3.0.3) (2020-06-26)

### Bug Fixes

* override env.TRAVIS_PULL_REQUEST_BRANCH to fix PR checks on travis-ci ([e4b1929](e4b1929)), closes [#11](#11)
@qiwibot
Copy link
Member

qiwibot commented Jun 26, 2020

🎉 This issue has been resolved in version 3.0.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

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](#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](#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](#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](#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
bug Something isn't working released
Projects
None yet
Development

No branches or pull requests

2 participants