Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

[PR review helper] Let user click reviewer name on list to request review #1

Open
mirekdlugosz opened this issue Mar 1, 2019 · 0 comments

Comments

@mirekdlugosz
Copy link
Contributor

On popular request, it would be nice if user could click name of reviewer on reviewers list to request review from that person. This way requesting reviews would require only some clicks, without any typing.

This is harder than it looks like.

Canonical way of requesting reviews is using GitHub API. This doesn't work, because being logged in on website doesn't make you authenticated to API.

There are two ways of authenticating user in API:

  1. send username and password. This would require prompting for password on each script load, or storing password permanently somehow. Will probably not work for users with 2 factor authentication enabled.
  2. send OAuth2 token. Tokens are specific to users and pose the same challenges as passwords. Storing them permanently would be a little more acceptable (user can revoke token anytime), but we still can't store them in script itself.

GitHub itself (website) doesn't use public API. Instead, they send POST with multiform data to special endpoint $PR_URL/review-requests. This endpoint does recognize user logged in in web browser, which means it doesn't require further authentication to use.

But it does require to identify users (requested reviewers) by their internal user id, which is not exposed anywhere on website. This can be worked around by clicking "Reviewers" header and then hiding list (technically possible, but really ugly), or by storing username / id map in user script.

Either way, this endpoint is not part of any public API, so it is subject to change without notice. We should use it only as very last resort.

Other ideas and solutions are very welcome.

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

No branches or pull requests

1 participant