Skip to content
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

Fix changelog where first release isn't first #76

Merged
merged 2 commits into from
May 24, 2021

Conversation

Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented May 24, 2021

auto-changelog will now correctly update and validate changelogs where the first release chronologically is different than the first release numerically.

A test has been added to ensure such a changelog is now validated correctly. This test fails on main.

Fixes #57

@Gudahtt Gudahtt requested a review from a team as a code owner May 24, 2021 13:56
rekmarks
rekmarks previously approved these changes May 24, 2021
Copy link
Member

@rekmarks rekmarks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Just one nit.

src/changelog.ts Outdated
@@ -139,20 +139,21 @@ function stringifyLinkReferenceDefinitions(
// patch releases on older releases can be accomodated.
const releaseLinkReferenceDefinitions = releases
.map(({ version }) => {
let diffUrl;
if (version === orderedReleases[orderedReleases.length - 1]) {
Copy link
Member

@rekmarks rekmarks May 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My only feedback is that orderedReleases (and really the releases param) could be documented / named such that it's immediately obvious that the releases are sorted in chronological order.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, I'll rename this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 027e394

`auto-changelog` will now correctly update and validate changelogs
where the first release chronologically is different than the first
release numerically.

A test has been added to ensure such a changelog is now validated
correctly. This test fails on `main`.

Fixes #57
@Gudahtt Gudahtt force-pushed the fix-backport-release-reference-link-definition branch from 69d433e to 027e394 Compare May 24, 2021 20:23
Copy link
Member

@rekmarks rekmarks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sold.

@Gudahtt Gudahtt merged commit 62b50fb into main May 24, 2021
@Gudahtt Gudahtt deleted the fix-backport-release-reference-link-definition branch May 24, 2021 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid reference link definition when new release is first numerically
2 participants