Repository navigation
ci(release): create the release commit and tag from the repo root - #392
Merged
Merged
Conversation
npm only commits and tags when it runs from the repository root, so since #388 moved the package into cli/ and this job got a job-level working-directory, npm version bumped package.json and stopped. Nothing was committed, nothing was tagged, and git describe --exact-match HEAD resolved to the docs-index tag that sits on a main commit, so the release pushed nothing, dispatched a publish for the wrong tag, and failed. Bump with --no-git-tag-version from the root, commit and tag there, and take the tag from package.json instead of git describe.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The release workflow could not land a release after #388 moved the package into
cli/.What broke
npm versiononly commits and tags when it runs from the repository root. The release job now has a job-levelworking-directory: cli, sonpm versionbumpedcli/package.jsonand skipped the git step. The next line,git describe --tags --exact-match HEAD, then resolved to thedocs-index-1-...tag that the docs snapshot workflow puts on a main commit.Result on run 41247763328 (release_type=major):
npm versionprintedv5.0.0,git push origin HEAD:main <docs-index tag>saidEverything up-to-date, publish-prod was dispatched with the docs-index tag, andgh release createfailed withRelease.tag_name already exists. Nothing was published. npm latest stayed 4.5.1.Fix
npm --prefix cli version <type> --no-git-tag-versionfrom the repo root, so the package files are updated and git is left alone.cli/package.jsonandcli/package-lock.jsonand tagv<version>from the root.package.jsoninstead ofgit describe, which can return any tag pointing at HEAD.Evidence
Reproduced locally, both cases from a clean
origin/main:cd cli && npm version patch --tag-version-prefix=vprintsv4.5.2, creates no commit and no tag, andgit describe --tags --exact-match HEADreturnsdocs-index-1-...-e630e345...version=5.0.0,tag=v5.0.0, commitchore: release v5.0.0,git tag --points-at HEADshowsv5.0.0, and publish-prod'stag == package.json versiongate passesnpm run lintincli/: exit 0npm testincli/: 1701 tests, 1699 pass, 1 fail, 1 skip. The failure ismidserver-linux-remote.test.jsrunning a realpython3subprocess under a fixtureHOME; it fails the same way on unmodified main in this environment and CI is green on main, so it is not related to this change.The 5.0.0 artifact also packs and installs clean:
jsn versionreports 5.0.0, andjsn --help,jsn docs --help,jsn setup --help,jsn auth statusall run.Merge danger
Limitations