dblock / danger-changelog

A plugin that is OCD about your CHANGELOG format.
MIT License
29 stars 15 forks source link

Check if the GitHub PR and username exist #21

Open Antondomashnev opened 7 years ago

Antondomashnev commented 7 years ago

For example the CHANGELOG entry can contain a typo in username URL or in PR URL:

danger-changelog can potentially handle it, by checking if the URL doesn't return 404. Or maybe it can be checked via the GitHub API.

AliSoftware commented 6 years ago

I was ready to open that issue before seing it's already there, would love that feature too!

On SwiftGen we're still using a Rakefile to do those checks on demand (we plan to migrate to Danger but we have some work to do beforehand), but I use this bit of Ruby code / rake task to check that all links to PRs and issues at least seems valid. Could be a good starting point.

Maybe one mode for that check would be a light or quick mode (changelog.check_links(false)?) which only validates links based on if the URL looks correct compared to the title and issue/PR number, and another mode would be full (changelog.check_links(true)?) to do what @Antondomashnev suggests by trying to really hit the URL and see if it exists (either via a HEAD request or the GitHub API)?

dblock commented 6 years ago

Since I hope we're going to massively over-engineer this to make it awesome, I suggest implementing this in terms of link handlers, so generic danger-changelog code goes over the links, then invokes custom or built-in handlers that can be enabled/disabled (eg. for github, for everything else, etc.).

Antondomashnev commented 6 years ago

@AliSoftware thanks for your proposals 👍 I agree with @dblock that mode option could be too much, I think simple parser for the links would do the job 😄