-
-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changelog is missing tags with almost-semver syntax #94
Comments
Oh, I see that this may be due to the tags not strictly following semver syntax, since |
Alternatively could you fix your tags to be the proper |
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. That said, I see there is some handling of non-semver tags in https://github.com/CookPete/auto-changelog/blob/master/src/releases.js#L51 and that with a custom tag pattern this could be handled, which would be in this branch: https://github.com/CookPete/auto-changelog/blob/master/src/commits.js#L83 If I run with a custom tag pattern, the sorting breaks:
|
Using So this looks like a bug around that sorting logic. |
I don't think so, since A good fix would be to change this line: https://github.com/CookPete/auto-changelog/blob/e12a5404abfc1bfc76942286b22fa84d0d387439/src/releases.js#L52 I'm not well-versed in the Node ecosystem; probably there's a package that properly compares these version strings but doesn't require strict |
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” |
It'll actually be not as straightforward — if you get a string that is I'm starting to think that the only real solution will be to stick to strict semver versioning. |
I mean, there’s literally no scenario i can conceive of where anyone would omit the major version - only trailing dot-zeros - but I’m also fine sticking to strict semver versioning since that’s the almost universal convention for non-multirepo git tags (and the universal suffix convention for multirepo git tags). |
Apologies – just me not paying close enough attention.
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 tempted to support this anyway as it seems to make sense. Given |
Maybe it could do that, but warn to stderr that nonstandard semver versions were found? That would help people catch this sooner. |
You're right. That'd be a good alternative. Thanks for considering supporting this additional format.
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. |
Partial semver tags are now sorted correctly as of |
That is awesome, thank you! |
I am using v1.11.0.
I am generating the changelog for a project:
The changelog shows the following releases:
However, some tags are completely missing:
I am completely missing v0.51 and v0.52. The tag exists, obviously:
Any idea why these would be ignored by
auto-changelog
?The text was updated successfully, but these errors were encountered: