question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Do not tag version changes with flag like "--no-tags" but do commit version changes

See original GitHub issue

Expected Behavior

Needs an option not to tag but to commit in git.

Current Behavior

We have “–no-git-tag-version” option which will nethier commit nor tag version changes." Looking for a similar one

Possible Solution

Would be good if we have option like “–no-tags” in cli or in lerna.json

Context

Tagging versions in git is a better practice. But we need to do this only for actual release (patch, minor and major). For prerelease versions, we don’t want to flood our repo with tags during development.

This is how we currently (planned to) use

# Developers can run this anytime in local 
"npm run bump:prerelease" 
> "lerna version prerelease --no-tags -y" 
# Can run this only when needed (upon release branches)
"npm run bump -- patch"
> "lerna version patch" 

These are npm scripts are to be executed at root.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:14
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

27reactions
artem-zakharchenkocommented, Nov 21, 2019

Hello. Thanks for raising this issue.

Our team would have a great use of the ability to skip the tagging of the release. I’ve issued a Pull request (#2358) that splits the tagging/committing process during the lerna version command.

With the suggested changes you can now do:

$ lerna version --no-git-tag

This would create a release commit, but omit the tags.

Motivation

We’re looking for similar functionality to the original poster, our workflow is that all changes must undergo a peer-review, which includes releasing. We are using protected branches (master cannot be pushed directly to), changes can only land via a pull request.

Our process works like the following:

  1. A maintainer decides to cut a release.
  2. Update respective package.json’s, CHANGELOG, etc.
  3. Create a pull request with these changes.
  4. A release manager will review and approve the release and the pull request.
  5. The pull request can only be merged via fast-forward.
  6. Pull request is merged and the release is invoked -. Publish to NPM -. Create and publish git tags.

Using Lerna, we’ve managed to follow this workflow so far, with manual steps. We’d like to try and avoid manual intervention in the future and would like to propose code-changes to make this happen if Lerna maintainers would welcome the additional configuration.

Our current process with Lerna is roughly the following:

  1. npx lerna version --no-push --no-git-tag-version
  2. Stage and create commit
  3. Propose release as PR (such as with hub pull-request)
  4. PR is reviewed, and merged
  5. Merge will then:
  6. lerna publish from-package
  7. Merger runs git tag for all updated versions and then pushes the tags to the git remote.

I believe with the introduction of the --no-git-tag and --no-git-commit flags we are making the control over the lerna version process more granular, and can use those two options internally to substitute --no-git-tag-version (also included in the Pull request).

With the changes our workflow would look like this:

$ lerna version --no-git-tag # only creates a release commit
$ hub pull-request -m 'Release'

# Pull request gets merged
$ git checkout master
$ get-tags-command # only creates release tags
$ git push --tags

Suggested changes are backward-compatible.

Please let me know what you think about this and how can we proceed. Thank you.

3reactions
rambabusaravanancommented, May 21, 2019

Okay well. I got that git tags are fundamental for Lerna to operate.

We have the below consideration

  • only CI have access to publish. so jenkins runs publish command (usually for every commit)
  • only developers should bump the version from his local and changes will be commited

Since the --canary option is only available in lerna publish command and not in lerna version command, only Jenkins can publish canary build. But for every commit, new build will be published which we usually don’t prefer.

Currently we are doing manually as below (for development build)

  1. lerna version prerelease --no-push --preid 'dev' bump version without pushing anything
  2. git tag -d v0.0.1-dev.0 delete the tag in local
  3. git push and push commits to remote

By this, we push the version increment only as commit changes and not as tags. We are looking for a way to eliminate this manual process which we feel something like --no-tags may be helpful.


In a nutshell, we are looking a way which will not tag but will commit the version increment and push to remote

Read more comments on GitHub >

github_iconTop Results From Across the Web

What are Git Tags and How to create, remove, view ... - Tools QA
Tags in Git are the reference points in the Git history that denotes special events. It is not a rule to tag the...
Read more >
Git - Tagging - Git SCM
A lightweight tag is very much like a branch that doesn't change — it's just a pointer to a specific commit. Annotated tags,...
Read more >
Configuring runners - GitLab Docs
After the page is refreshed, expand the Runners settings section and check the registration token - it should be changed. From now on...
Read more >
What is git tag, How to create tags & How to checkout git ...
Although a tag may appear similar to a branch, a tag, however, does not change. It points directly to a specific commit in...
Read more >
Git - Jenkins Plugins
Changelog in GitHub Releases. Release notes are recorded in GitHub Releases since July 1, 2019 (git plugin 3.10.1 and later).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found