Skip to content
This repository was archived by the owner on Jul 19, 2025. It is now read-only.

Conversation

noahd1
Copy link
Contributor

@noahd1 noahd1 commented Feb 4, 2015

Based on the configuration of the GH PR service, the "test" will check the permissions of the token to comment or post a status.

I attempted to use the same "no-op" API call style check for comments, but it didn't work in the same way: the API returns a 404 in both the case that the token has insufficient scope as well as the case the the case that the PR number doesn't exist (PR #0 is what I attempted to use, other PRs may not exist yet).

The alternative solution -- checking the headers for x-oauth-scopes -- is pretty good. However, I'm also not certain that it's a definitive solution: I believe there's at least one scenario -- a "machine user" with read-only repo access -- where you can have the proper header (with "repo" scope) but still not be able to post a comment.

/cc @brynary

@calavera
Copy link
Contributor

calavera commented Feb 4, 2015

It looks good. 👍

noahd1 added a commit that referenced this pull request Feb 4, 2015
Check config of GH PR service and test appropriately for status/comment ability
@noahd1 noahd1 merged commit 5a2a4a3 into master Feb 4, 2015
@noahd1 noahd1 deleted the nd-add-test-for-gh-pr-comment branch February 4, 2015 17:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants