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

Please could the bot support linking to Discussions, as with Issues/PRs? #13

Closed
matatk opened this issue Jan 30, 2024 · 1 comment
Closed

Comments

@matatk
Copy link

matatk commented Jan 30, 2024

We're using GitHub Discussions, and would like to benefit from the bot's helpful linking feature when referring to discussions.

E.g. if you join #adapt on IRC, and type in '#256' you don't get discussion thread #256 - you get an error, because the bot assumes we're talking about issues.

It does work with PRs (e.g. typing in '#239' works) - though the URL contains 'issues', I think GitHub redirects appropriately.

From an implementation standpoint, I understand this complicates things, because you can't assume the type of an item is issue/PR, but it would be helpful to be able to refer to issues, PRs, and discussions simply via their numbers.

bert-github referenced this issue Feb 2, 2024
This required replacing some more calls to the REST API with calls to
the GraphQL API.

URLs to pull requests and to discussions are now also recognized and
cause gb to look up a summary, just like for issues.

Added the get_github_id_and_type() function, because several other
functions need to look up the node ID of issues. (Unlike in the REST
API, in the GraphQL API the repo name and issue number are not enough
to change an issue. You need to look up the node ID and use that to
change the issue.)
@bert-github
Copy link
Contributor

You should now be able to look up discussions by their number. You can also close and reopen them, or add a comment to them, the same way as for issues.

But, unlike for issues, you cannot create a new discussion. If there is a need for that, I can probably add that, too.

(I had to change most of the calls to the GitHub REST API to calls to the GraphQL API, because discussions are not supported in the former. I hope I didn't introduce too many bugs…)

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

No branches or pull requests

2 participants