You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it's possible for an assignment to fail if the repo is public & the person creating the issue is not in the org. For example, parabolmatt can create an issue on a public repo, but cannot assign himself because he's not an admin.
Per GH docs:
If you have write access to a repository, you can assign issues and pull requests to yourself, collaborators on personal projects, or members of your organization with read permissions on the repository.
The above isn't entirely accurate because the GitHub website allows you to additionally assign contributors (not only collaborators), to personal repos if they created the issue in question. However, their checkAssignee endpoint still says they can't be assigned, even though they can be.
This actually gets fairly complicated. First, we need to check to see if the person creating the issue has write/admin access. Then, we need to see if the person they are adding is either a collaborator or a member. We can take care of the latter check by tightening up who can join/leave a repo. so that just leaves us with the write/admin access check.
get repo admin (the guy who created the integration)
with the admin's token, see if the issue creator has write or admin access
if write+ access, create the issue
assignee may still come back blank if the assignee no longer has read access to the repo. this could happen if they were removed from the org or as a collaborator. org hooks are not guaranteed since that requires admin access on the org. in the future, we should have membership hooks on the repo itself to guarantee success.
if only read access, create the issue & use the admin's token to update the assignee. @jordanh please confirm that this feels OK
The text was updated successfully, but these errors were encountered:
it's possible for an assignment to fail if the repo is public & the person creating the issue is not in the org. For example, parabolmatt can create an issue on a public repo, but cannot assign himself because he's not an admin.
Per GH docs:
The above isn't entirely accurate because the GitHub website allows you to additionally assign contributors (not only collaborators), to personal repos if they created the issue in question. However, their checkAssignee endpoint still says they can't be assigned, even though they can be.
This actually gets fairly complicated. First, we need to check to see if the person creating the issue has write/admin access. Then, we need to see if the person they are adding is either a collaborator or a member. We can take care of the latter check by tightening up who can join/leave a repo. so that just leaves us with the write/admin access check.
The text was updated successfully, but these errors were encountered: