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.

Changelog is missing tags with almost-semver syntax

See original GitHub issue

I am using v1.11.0.

I am generating the changelog for a project:

➜ auto-changelog
auto-changelog: 81 kB written to CHANGELOG.md

The changelog shows the following releases:

➜ grep "####" CHANGELOG.md | cut -d " " -f2 | cut -d "(" -f1 | head
[v0.52.1]
[v0.50.7]
[v0.50.6]
[v0.50.5]
[v0.50.4]
[v0.50.3]
[v0.50.2]
[v0.50.1]
[v0.49.8]
[v0.49.6]

However, some tags are completely missing:

➜ git tag --sort=v:refname | tail -r -n 10
v0.52.1
v0.52
v0.51
v0.50.7
v0.50.6
v0.50.5
v0.50.4
v0.50.3
v0.50.2
v0.50.1

I am completely missing v0.51 and v0.52. The tag exists, obviously:

➜ git show v0.51 | head
tag v0.51
Tagger: …
Date:   Mon Feb 18 12:37:53 2019 +0100

Tagging version 0.51

commit 98a186bcb9cd4ffcbd226535b8860f934c281aa7
Author: …
Date:   Mon Feb 18 12:37:53 2019 +0100

Any idea why these would be ignored by auto-changelog?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
cookpetecommented, Feb 28, 2019

I don’t think so, since semver.valid() will (my guess) return false for v0.52, since it (strictly) should be v0.52.0. So instead, it sorts by simply parsing the float values, which means v0.52 is “older” than v0.6

Apologies – just me not paying close enough attention.

That’s certainly possible, but it’d mean having to rewrite history and having all potential users prune old tags. Not saying that this is not possible, but it’s a bit of an inconvenience.

You don’t necessarily need to rewrite history. You could always add the correct semver tags at the same commits, then treat the incorrect tags as legacy/deprecated, and leave them for a certain amount of time before removing them?

I’m sure you could normalize the semver strings - ie, add the missing dot zeros - but that still wouldn’t handle anything additional but “partial semver versions"

I’m tempted to support this anyway as it seems to make sense. Given v0.50.7 and v0.51 you would expect it to be smart enough to know what came first.

1reaction
slhckcommented, Feb 28, 2019

You don’t necessarily need to rewrite history. You could always add the correct semver tags at the same commits, then treat the incorrect tags as legacy/deprecated, and leave them for a certain amount of time before removing them?

You’re right. That’d be a good alternative.

Thanks for considering supporting this additional format.

Maybe it could do that, but warn to stderr that nonstandard semver versions were found? That would help people catch this sooner.

That could be a possibility. Certainly I would’ve considered naming my tags differently had my changelog generation tool informed me (I was just using a rather simple script). Users should not be warned though if they use custom tag pattern.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Changelog is missing tags with almost-semver syntax #94
I am using v1.11.0. I am generating the changelog for a project: ➜ auto-changelog auto-changelog: 81 kB written to CHANGELOG.md The ...
Read more >
Automatic tagging of releases - git - Stack Overflow
Now I have each release identified by build number, but they increment even if there are no changes in the repo. My idea...
Read more >
ngx-semantic-version: enhance your git and release workflow
It will help you to keep your CHANGELOG.md file up to date and to release new tagged versions. All this is done by...
Read more >
git-tag Documentation - Git
Tag objects (created with -a , -s , or -u ) are called "annotated" tags; they contain a creation date, the tagger name...
Read more >
Changelog | Meteor API Docs
--apollo skeleton was missing client cache setup more ... The .meteor/packages file supports a new syntax for overriding problematic version constraints ...
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