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

Version executor is failing to get version when merged to main #633

Open
minuz opened this issue Jan 12, 2023 · 1 comment
Open

Version executor is failing to get version when merged to main #633

minuz opened this issue Jan 12, 2023 · 1 comment

Comments

@minuz
Copy link

minuz commented Jan 12, 2023

Hi, I've been trying to implement the semver into my monorepo using nx and when running within a PR, it works fine and it calculates everything. Once the PR is merged, it's failing to calculate the new version.

The command sample is as follows:

nx affected --base=$(git rev-parse origin/main~1) --head=$(git rev-parse HEAD) --target=version -c=production
> nx run shared-util-feature-flag:version:production

[shared-util-feature-flag] 🆕 Calculated new version "null".
[shared-util-feature-flag] ❌ TypeError: Cannot read properties of null (reading 'toString')
    at /home/vsts/work/1/s/node_modules/@jscutlery/semver/src/executors/version/utils/template-string.js:9:81
    at Array.reduce (<anonymous>)
    at createTemplateString (/home/vsts/work/1/s/node_modules/@jscutlery/semver/src/executors/version/utils/template-string.js:7:33)
    at formatCommitMessage (/home/vsts/work/1/s/node_modules/@jscutlery/semver/src/executors/version/utils/commit.js:26:55)
    at /home/vsts/work/1/s/node_modules/@jscutlery/semver/src/executors/version/index.js:76:68
    at /home/vsts/work/1/s/node_modules/@jscutlery/semver/node_modules/rxjs/dist/cjs/internal/operators/switchMap.js:17:35
    at OperatorSubscriber._this._next (/home/vsts/work/1/s/node_modules/@jscutlery/semver/node_modules/rxjs/dist/cjs/internal/operators/OperatorSubscriber.js:33:21)
    at OperatorSubscriber.Subscriber.next (/home/vsts/work/1/s/node_modules/@jscutlery/semver/node_modules/rxjs/dist/cjs/internal/Subscriber.js:51:18)
    at /home/vsts/work/1/s/node_modules/@jscutlery/semver/node_modules/rxjs/dist/cjs/internal/operators/switchMap.js:17:192
    at OperatorSubscriber._this._next (/home/vsts/work/1/s/node_modules/@jscutlery/semver/node_modules/rxjs/dist/cjs/internal/operators/OperatorSubscriber.js:33:21)

> nx run shared-util-feature-flag:build

My target config is:

    "version": {
      "executor": "@jscutlery/semver:version",
      "options": {
        "tagPrefix": "@expedo/feature-flag-",
        "trackDeps": true,
        "noVerify": true
      },
      "configurations": {
        "development": {
          "releaseAs": "prerelease",
          "preid": "beta",
          "skipProjectChangelog": true,
          "skipCommit": true
        },
        "production": {
          "releaseAs": "release"
        }
      }
    },

Any help will be appreciated! Thanks :)

@edbzn
Copy link
Member

edbzn commented Jan 12, 2023

Hi, it is the same problem as I described here.

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