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.

Add option to add `last-release` tag

See original GitHub issue

The last-release tag should always be on the commit with the latest (as in time, not version-number) release. The tag is used to calculate the changes since the last release.

Currently I’m setting the tag as an extra CI-step, but this has the disadvantage that the tag will be moved whether there is a new release or not.

The best way I came up with would be to set the last-release tag in the same step the version tag for the individual release is set. If wanted there could be a global config where this behavior could be enabled/disabled.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
ndrsgcommented, Jun 3, 2022

the downside of “moving” the “last-release” tag is that you always have to

git pull -t -f

before pushing, to update the tag locally.

To avoid that, im pushing a new tag, starting with release- , followed by a number, or a date and time like

git tag -f release-$(date '+%d-%m-%Y-%H-%M-%S')

to get the base for the next nx affected, im using

npx nx affected --target=prepare --base=$(git show-ref --tags | grep release- | tail -n 1 | sed 's~.* refs/tags/~~')

IMHO, this is a bit out of scope of versioning, and more an individual CI flow thing when / how to place a last-release tag.

Another possibility would be to “grep” for the newest version-tag (that depends on your configuration).

e.g. if you

{
 "tagPrefix": "release-${projectName}-"
}

you could also use

git show-ref --tags | grep release- | tail -n 1 | sed 's~.* refs/tags/~~')

to get you base, and you dont have to push an extra tag at all, BUT

if a library/app fails versioning for some reason (upload fails?), you cannot retry you build.

0reactions
yjaaidicommented, Jun 4, 2022

Exactly! This can only work at the workspace level. Also, what I meant is that this is beyond semver. All kind of workflows using affected need a way of marking the last success. We could even imagine multiple tags for multiple steps:

nx affected --target test --base last-test-success
nx affected --target version --base last-version-success

Actually, it should be an Nx feature. 🤔 just thinking out loud, what about a hook system that could allow us to trigger an executor after nx affected…

Or maybe, we just need an Nx wrapper for the CI. npx nx-affected-and-tag --target test

Read more comments on GitHub >

github_iconTop Results From Across the Web

A Tutorial for Tagging Releases in Git - DEV Community ‍ ‍
Executing this command you will create a new annotated tag identified with version v1.0.0. The command will then open up your commit editor ......
Read more >
Managing releases in a repository - GitHub Docs
To the right of the list of files, click Releases. ... Click Draft a new release. ... Click Choose a tag, type a...
Read more >
Git - Tagging - Git SCM
In this section, you'll learn how to list existing tags, how to create and delete tags, and what the different types of tags...
Read more >
How To Create Git Tags - devconnected
You might want to create new Git tags in order to have a reference to a given release of your software. In this...
Read more >
Managing releases using Git tags and semantic versioning
Setting up all the Development / Devops Tools for a New Drupal Projects: DrupalCon Portland 2022 · How to Manage Releases with Semantic ......
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