github-api icon indicating copy to clipboard operation
github-api copied to clipboard

GHPullRequest isn't reactable

Open jmadureira opened this issue 2 years ago • 2 comments

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

jmadureira avatar Nov 21 '23 17:11 jmadureira

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

Haarolean avatar Nov 26 '23 08:11 Haarolean

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).

jmadureira avatar Nov 27 '23 16:11 jmadureira

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 https://github.com/hub4j/github-api/pull/1808 to fix it.

gsmet avatar Mar 09 '24 13:03 gsmet