code-corps-api icon indicating copy to clipboard operation
code-corps-api copied to clipboard

Sync assignees to GitHub

Open joshsmith opened this issue 8 years ago • 1 comments

Problem

When a task is assigned a user on Code Corps, we need to be able to sync that assignee to GitHub.

joshsmith avatar Nov 17 '17 23:11 joshsmith

When assigning:

  • In the UserTaskController create or update
  • Check if the task has a github_issue
  • Check the assignee can be assigned using GET /repos/:owner/:repo/assignees/:assignee
    • 204 response if yes
    • 404 response if no
  • then POST /repos/:owner/:repo/issues/:number/assignees with a key of "assignees" and value of an array of GitHub usernames

When unassigning:

  • In the UserTaskController update or delete
  • Check if the task has a github_issue
  • Check the assignee can be assigned using GET /repos/:owner/:repo/assignees/:assignee
    • 204 response if yes
    • 404 response if no
  • DELETE /repos/:owner/:repo/issues/:number/assignees with a key of "assignees" and value of an array of GitHub usernames

joshsmith avatar Nov 19 '17 00:11 joshsmith