nbbrd / heylogs

Set of tools to deal with the keep-a-changelog format
European Union Public License 1.2
6 stars 1 forks source link

Checker for arbitrary issue tracker links #207

Open koppor opened 9 months ago

koppor commented 9 months ago

In https://github.com/nbbrd/heylogs/blob/develop/heylogs-api/src/main/java/internal/heylogs/ExtendedRules.java, there is a check for GitHub links. Other links should also work.

Example from https://github.com/openjdk/jtreg/:

[CODETOOLS-7902754](https://bugs.openjdk.org/browse/CODETOOLS-7902754)

I think, JIRA has a similar pattern. Maybe, one can use a kind of regex?

[{tag1}-{number1}]({some-characters}/{tag2}-{number2})

If tag1 and tag2 are equal, number1 and number2 have to be equal.

To support GitHub enterprise, one could even extend

[{prefxi1}{number1}]({some-characters}/{prefix2}{number2})

If prefix1 and prefix2 are equal, number1 and number2 have to be equal.

charphi commented 6 months ago

Requires #224

charphi commented 6 months ago

Related solution : https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/managing-repository-settings/configuring-autolinks-to-reference-external-resources#configuring-autolinks-to-reference-external-resources

koppor commented 6 months ago

Related solution : docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/managing-repository-settings/configuring-autolinks-to-reference-external-resources#configuring-autolinks-to-reference-external-resources

You mean, heylogs will use GitHub's API to fetch the configuration and then check the links according to it? 😅🤩🤣🤣

My solution was a "simple" pattern matching approach not requiring any configuration.

charphi commented 6 months ago

You mean, heylogs will use GitHub's API to fetch the configuration and then check the links according to it?

That's a good idea but it would render the check unreliable and a bit slower.

koppor commented 6 months ago

You mean, heylogs will use GitHub's API to fetch the configuration and then check the links according to it?

That's a good idea but it would render the check unreliable and a bit slower.

You mean, you will cache the API result? 🤣🤣

(I am in creative mood, don't take too serious 😅)