monty-python
monty-python copied to clipboard
feat(github): support `<repo>/discussions/<id>` links, expanding discussions
trafficstars
Adds |discussions to the url regex, and slightly refactors the handling in fetch_issues to save an unnecessary REST call if we already know it won't succeed.
Additionally adds all the required fields to the GQL query to support expanding discussions, like issues/PRs.
That being said, /issues/<discussion_id> still works as before and links the discussion with that ID, despite the url being /issues/. This currently does a REST + GQL call.
It would be trivial to change this to only do the REST call, dropping support for linking discussions via the /issues/ url. GitHub itself correctly redirects these links to /discussions/, so I'm not sure if dropping support would be a good idea.