Open DanielNetzer opened 2 years ago
Hi @DanielNetzer, the error occurs when semver tries to Git push the version, it seems like your repo is configured with https instead of ssh. You can find more details here.
@edbzn wdyt about supporting all different methods in semver
similar to what semantic-release does? try HTTP, HTTPS, and SSH?
Also another thing I noticed is that when the pipeline fails tags are kept on the origin which causes errors when running the version command again since the git tag already exists.
@edbznΒ wdyt about supporting all different methods inΒ semverΒ similar to what semantic-release does? try HTTP, HTTPS, and SSH?
It would need further investigation but could be a new feature.
Hey @edbzn attaching logs from the CI pipeline.
2022-05-26T19:13:25.8970223Z ##[section]Starting: Release
2022-05-26T19:13:25.8977181Z ==============================================================================
2022-05-26T19:13:25.8977495Z Task : Command line
2022-05-26T19:13:25.8977795Z Description : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
2022-05-26T19:13:25.8978087Z Version : 2.201.1
2022-05-26T19:13:25.8978394Z Author : Microsoft Corporation
2022-05-26T19:13:25.8978734Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
2022-05-26T19:13:25.8979081Z ==============================================================================
2022-05-26T19:13:26.0212207Z Generating script.
2022-05-26T19:13:26.0225487Z ========================== Starting Command Output ===========================
2022-05-26T19:13:26.0264772Z [command]/bin/bash --noprofile --norc /home/ubuntu/myagent/_work/_temp/c29a6628-dcb8-4b61-bc50-00b0be9554ff.sh
2022-05-26T19:13:26.3518500Z
2022-05-26T19:13:26.3520659Z > black-widow@0.0.0 release
2022-05-26T19:13:26.3523009Z > nx run-many --all --target version --verbose --base=origin/main~1 --head=HEAD --push --noVerify --trackDeps --skipRootChangelog --commitMessageFormat='chore(${projectName}): release version ${version} [skip-ci]'
2022-05-26T19:13:26.3524112Z
2022-05-26T19:13:26.8883268Z
2022-05-26T19:13:26.8893208Z > NX Running target version for 3 project(s):
2022-05-26T19:13:26.8894090Z
2022-05-26T19:13:26.8895391Z - extension
2022-05-26T19:13:26.8896565Z - core
2022-05-26T19:13:26.8897480Z - sdk
2022-05-26T19:13:26.8898074Z
2022-05-26T19:13:26.8898798Z With flags:
2022-05-26T19:13:26.8899746Z --verbose=true
2022-05-26T19:13:26.8900667Z --base=origin/main~1
2022-05-26T19:13:26.8901587Z --head=HEAD
2022-05-26T19:13:26.8902482Z --push=true
2022-05-26T19:13:26.8903424Z --noVerify=true
2022-05-26T19:13:26.8904309Z --trackDeps=true
2022-05-26T19:13:26.8905202Z --skipRootChangelog=true
2022-05-26T19:13:26.8906353Z --commitMessageFormat=chore(${projectName}): release version ${version} [skip-ci]
2022-05-26T19:13:26.8907164Z
2022-05-26T19:13:26.8907669Z
2022-05-26T19:13:27.8194320Z
2022-05-26T19:13:27.8196499Z > nx run sdk:version --verbose --base=origin/main~1 --head=HEAD --push --noVerify --trackDeps --skipRootChangelog --commitMessageFormat="chore(${projectName}): release version ${version} [skip-ci]"
2022-05-26T19:13:27.8197745Z
2022-05-26T19:13:27.8203776Z [sdk] π Calculated new version "0.1.1".
2022-05-26T19:13:27.8204928Z [sdk] π Generated CHANGELOG.md.
2022-05-26T19:13:27.8205918Z [sdk] π Updated package.json version.
2022-05-26T19:13:27.8207020Z [sdk] π¦ Committed "chore(sdk): release version 0.1.1 [skip-ci]".
2022-05-26T19:13:27.8208226Z [sdk] β Error: Failed to create "sdk-0.1.1", this tag already exists.
2022-05-26T19:13:27.8209138Z This occurs because you already versioned the changes, but on a different branch than the base branch.
2022-05-26T19:13:27.8210735Z Please delete the tag locally by running "git tag -d sdk-0.1.1", delete the tag from the remote repository as well, and run this command again.
2022-05-26T19:13:27.8211967Z at /home/ubuntu/myagent/_work/152/s/node_modules/@jscutlery/semver/src/executors/version/utils/git.js:75:49
2022-05-26T19:13:27.8213004Z at Observable.init [as _subscribe] (/home/ubuntu/myagent/_work/152/s/node_modules/rxjs/dist/cjs/internal/observable/throwError.js:8:64)
2022-05-26T19:13:27.8214402Z at Observable._trySubscribe (/home/ubuntu/myagent/_work/152/s/node_modules/rxjs/dist/cjs/internal/Observable.js:41:25)
2022-05-26T19:13:27.8215394Z at /home/ubuntu/myagent/_work/152/s/node_modules/rxjs/dist/cjs/internal/Observable.js:35:31
2022-05-26T19:13:27.8217330Z at Object.errorContext (/home/ubuntu/myagent/_work/152/s/node_modules/rxjs/dist/cjs/internal/util/errorContext.js:22:9)
2022-05-26T19:13:27.8218724Z at Observable.subscribe (/home/ubuntu/myagent/_work/152/s/node_modules/rxjs/dist/cjs/internal/Observable.js:26:24)
2022-05-26T19:13:27.8220096Z at /home/ubuntu/myagent/_work/152/s/node_modules/rxjs/dist/cjs/internal/operators/catchError.js:17:31
2022-05-26T19:13:27.8221141Z at OperatorSubscriber._this._error (/home/ubuntu/myagent/_work/152/s/node_modules/rxjs/dist/cjs/internal/operators/OperatorSubscriber.js:43:21)
2022-05-26T19:13:27.8222352Z at OperatorSubscriber.Subscriber.error (/home/ubuntu/myagent/_work/152/s/node_modules/rxjs/dist/cjs/internal/Subscriber.js:60:18)
2022-05-26T19:13:27.8223492Z at /home/ubuntu/myagent/_work/152/s/node_modules/@jscutlery/semver/src/executors/common/exec.js:10:28
2022-05-26T19:13:27.8224129Z
2022-05-26T19:13:27.8224663Z
2022-05-26T19:13:27.8225067Z
2022-05-26T19:13:27.8225694Z > NX Running target "version" failed
2022-05-26T19:13:27.8226183Z
2022-05-26T19:13:27.8227083Z Tasks not run because their dependencies failed:
2022-05-26T19:13:27.8227804Z
2022-05-26T19:13:27.8228886Z - extension:version
2022-05-26T19:13:27.8229893Z - core:version
2022-05-26T19:13:27.8230654Z
2022-05-26T19:13:27.8231243Z Failed tasks:
2022-05-26T19:13:27.8231829Z
2022-05-26T19:13:27.8232674Z - sdk:version
2022-05-26T19:13:27.8233111Z
2022-05-26T19:13:27.8420911Z ##[error]Bash exited with code '1'.
2022-05-26T19:13:27.8459499Z ##[section]Finishing: Release
to overcome this issue I've added full tag deletion to my release command. the pipeline fails because it tries to generate the same tag again as you can see.
What it looks like it happening in that second post is semver isn't seeing your previous tags on whichever branch is being used so it is calculating a version that already exists before pushing.
I had a similar issue when getting started. Do you merge your main branch back into the dev branches? If you don't connect those branches I think semver/git doesn't see them properly.
For example, here's what happens when I run semver on that test branch, even though the commit is after v7.9.0.
dereekb@dbMBP dbcomponents % nx run workspace:version --dryRun
> nx run workspace:version --dryRun
[workspace] π Calculated new version "7.9.0".
---
# [7.9.0](https://github.com/dereekb/dbx-components/compare/v7.8.1-dev...v7.9.0) (2022-06-11)
---
[workspace] π Generated CHANGELOG.md.
For some strange reason I keep getting the following error:
this error originated from an Azure DevOps agent, I tried to debug the code for the github.
the project.json for one of the projects is:
all of the other projects are configured in a similar manner. any help will be appreciated.