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

GHPullRequest isn't reactable #1749

Closed
jmadureira opened this issue Nov 21, 2023 · 3 comments · Fixed by #1808
Closed

GHPullRequest isn't reactable #1749

jmadureira opened this issue Nov 21, 2023 · 3 comments · Fixed by #1808
Labels

Comments

@jmadureira
Copy link

Describe the bug
Trying to call Reactable.createAction(...) on a GHPullRequest throws a Not Found error.

To Reproduce
Steps to reproduce the behavior:

  1. Create a valid GHPullRequest instance
  2. Call the method createAction on that instance

Expected behavior
Not really certain. The URL the the client is trying to access: https://api.github.com/repos/OWNER/REPO/pulls/PR_NUMBER/reactions doesn't really exist so either:

  1. The GHPullRequest shouldn't be marked as Reactable or;
  2. The GHPullRequest should be calling the https://api.github.com/repos/OWNER/REPO/issues/ISSUE_NUMBER/reactions instead assuming it yields desired result

Desktop (please complete the following information):

  • OS: any
  • Browser N/A
  • Version 1.317 though earlier versions might also be affected

Additional context

@bitwiseman bitwiseman added the bug label Nov 21, 2023
@Haarolean
Copy link
Contributor

@jmadureira make sure you have the required permissions, github api also returns 404s in case you don't have the required permissions

@jmadureira
Copy link
Author

Hi @Haarolean. I ended up enabling all permissions just in case and still got the same error. The URL the client is trying to access is not listed anywhere in the Github documentation (at least I'm not able to find it).

gsmet added a commit to gsmet/github-api that referenced this issue Mar 9, 2024
Pull requests are sorta issues and for reactions, you need to use the
issues API to react.

Fixes hub4j#1749
@gsmet
Copy link
Contributor

gsmet commented Mar 9, 2024

You're totally right, there's a bug here. Pull requests should use the issues endpoint to create reactions (as pull requests are indeed issues with additional stuff).

I created #1808 to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants