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

Link references are filtered out from version entry #52

Closed
xt0rted opened this issue Feb 26, 2022 · 9 comments · Fixed by #58
Closed

Link references are filtered out from version entry #52

xt0rted opened this issue Feb 26, 2022 · 9 comments · Fixed by #58
Assignees
Labels
good first issue Good for newcomers severity: 1 (inconvenient) type: bug Something isn't working

Comments

@xt0rted
Copy link

xt0rted commented Feb 26, 2022

I'm working on automating the release process for https://github.com/yannickcr/eslint-plugin-react and ran into an issue where the changelog format used doesn't fully work with this action.

Example version entry:

## [7.29.1] - 2022.02.25

### Fixed

* [`jsx-key`]: prevent false "missing array key" warning ([#3215][] @ljharb)
* [`jsx-indent`]: avoid checking returns sans jsx ([#3218][] @ljharb)
* [`jsx-key`]: avoid a crash ([#3220][] @ljharb)
* version settings: avoid a crash with an invalid version ([#3219][] @ljharb)

[7.29.1]: https://github.com/yannickcr/eslint-plugin-react/compare/v7.29.0...v7.29.1
[#3220]: https://github.com/yannickcr/eslint-plugin-react/issues/3220
[#3219]: https://github.com/yannickcr/eslint-plugin-react/issues/3219
[#3218]: https://github.com/yannickcr/eslint-plugin-react/issues/3218
[#3215]: https://github.com/yannickcr/eslint-plugin-react/issues/3215

There's two issues due to using link references.

  1. Common links are referenced at the end of the file. In this example [`jsx-key`].
  2. Version specific links are referenced at the end of the section before the next version.

I worked around the first issue by pulling the common links out in another step and appending them to the release notes.

The second issue is happening because of this line

.filter(item => !/\[.*\]: http/.test(item))

What's the reason for excluding these? Would you be open to adding a new setting to skip this filter?

@mindsers
Copy link
Owner

mindsers commented Mar 9, 2022

Hi! Thanks for submitting this issue!

They are excluded because they are causing issues in cases where they are all listed at the end of the file. That being said, maybe we should make this a bit smarter. Instead of only excluding links, we could retrieve the links used in that section of the text.

@mindsers mindsers added good first issue Good for newcomers severity: 1 (inconvenient) type: bug Something isn't working labels Mar 9, 2022
@xt0rted
Copy link
Author

xt0rted commented Mar 9, 2022

For now I worked around this by pulling all links out, deduping them, and appending them to the end of the release notes. This works but results in a lot of unneeded links in the release notes which then somewhat breaks the release notes section of dependabot prs OctoLinker/OctoLinker#1510.

@mindsers
Copy link
Owner

Tried to fix it in #58. Please have a look and tell me if it solves your issue

@mindsers
Copy link
Owner

@all-contributors please add @xt0rted for bug

@allcontributors
Copy link
Contributor

@mindsers

I've put up a pull request to add @xt0rted! 🎉

@xt0rted
Copy link
Author

xt0rted commented May 10, 2022

@mindsers sorry I missed this, I'll give it a try sometime this week and report back.

@mindsers
Copy link
Owner

Great! Thank you!

@xt0rted
Copy link
Author

xt0rted commented Aug 13, 2022

@mindsers sorry for the late response. I just tested this and it seemed to work but there wasn't a blank line between the contents and list of links that are appended to it so they rendered incorrectly.

The format I had was:

# CHANGELOG

## Unreleased

## 0.2.0

### Added

- Link references are filtered out from version entry ([#52][])

## 0.1.0

- Blah blah blah

[#52]: https://github.com/mindsers/changelog-reader-action/issues/52

And this is what was added to the release notes:

### Added

- Link references are filtered out from version entry ([#52][])
[#52]: https://github.com/mindsers/changelog-reader-action/issues/52

Without the extra blank line #52 is autolinked and displays like this [#52][], and the link at the bottom is also displayed.

@mindsers
Copy link
Owner

mindsers commented Sep 1, 2022

@xt0rted Hi! It should be fixed in the new release deployed this morning. Can you try it again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers severity: 1 (inconvenient) type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants