{"action":"created","issue":{"url":"https://api.github.com/repos/education/classroom/issues/1499","repository_url":"https://api.github.com/repos/education/classroom","labels_url":"https://api.github.com/repos/education/classroom/issues/1499/labels{/name}","comments_url":"https://api.github.com/repos/education/classroom/issues/1499/comments","events_url":"https://api.github.com/repos/education/classroom/issues/1499/events","html_url":"https://github.com/education/classroom/pull/1499","id":353808936,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEwNzU4OTQ1","number":1499,"title":"Redeem with group import resiliency","user":{"login":"BenEmdon","id":11095731,"node_id":"MDQ6VXNlcjExMDk1NzMx","avatar_url":"https://avatars0.githubusercontent.com/u/11095731?v=4","gravatar_id":"","url":"https://api.github.com/users/BenEmdon","html_url":"https://github.com/BenEmdon","followers_url":"https://api.github.com/users/BenEmdon/followers","following_url":"https://api.github.com/users/BenEmdon/following{/other_user}","gists_url":"https://api.github.com/users/BenEmdon/gists{/gist_id}","starred_url":"https://api.github.com/users/BenEmdon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BenEmdon/subscriptions","organizations_url":"https://api.github.com/users/BenEmdon/orgs","repos_url":"https://api.github.com/users/BenEmdon/repos","events_url":"https://api.github.com/users/BenEmdon/events{/privacy}","received_events_url":"https://api.github.com/users/BenEmdon/received_events","type":"User","site_admin":false},"labels":[{"id":307505416,"node_id":"MDU6TGFiZWwzMDc1MDU0MTY=","url":"https://api.github.com/repos/education/classroom/labels/:rocket:%20ready%20for%20review","name":":rocket: ready for review","color":"30cc83","default":false},{"id":993240577,"node_id":"MDU6TGFiZWw5OTMyNDA1Nzc=","url":"https://api.github.com/repos/education/classroom/labels/create/import%20repo%20flow","name":"create/import repo flow","color":"96f2bf","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-24T14:34:32Z","updated_at":"2018-08-29T14:34:17Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/education/classroom/pulls/1499","html_url":"https://github.com/education/classroom/pull/1499","diff_url":"https://github.com/education/classroom/pull/1499.diff","patch_url":"https://github.com/education/classroom/pull/1499.patch"},"body":"## What ✨ \r\nThis PR proposes a new flow for group assignment redemption. \r\n\r\nSteps that happen happen in `GroupAssignmentInvitation#redeem_for`:\r\n```diff\r\n+ fail early if invitation is no longer enabled\r\ncreate a RepoAccess for the invitee\r\nif Group does not exist -> create Group\r\nif GroupAssignmentRepo exists -> return GroupAssignmentRepo\r\n- if GroupAssignmentRepo does not exist -> create GroupAssignmentRepo\r\n+ if GroupInviteStatus is unaccepted? -> set GroupInviteStatus to accepted\r\n+ return pending state\r\n```\r\n\r\nInstead of creating a `GroupAssignmentRepo` in `GroupAssignmentInvitation#redeem_for` we defer the repo creation so that it can be done in a background job (coming in a later PR).\r\n\r\nI introduced the class `GroupAssignmentInvitation::Result` so that the `redeem_for` could return either of the following states:\r\n```ruby\r\n.success(repo) # redeem_for succeeded and an AssignmentRepo already exists\r\n.failed(error) # redeem_for failed with an error\r\n.pending       # redeem_for succeeded and a repo is not yet created\r\n```\r\n\r\n\r\n\r\nThis new flow is behind the `group_import_resiliency_enabled?` feature flag.\r\n\r\n--- \r\nCloses #1492 "},"comment":{"url":"https://api.github.com/repos/education/classroom/issues/comments/416976427","html_url":"https://github.com/education/classroom/pull/1499#issuecomment-416976427","issue_url":"https://api.github.com/repos/education/classroom/issues/1499","id":416976427,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNjk3NjQyNw==","user":{"login":"BenEmdon","id":11095731,"node_id":"MDQ6VXNlcjExMDk1NzMx","avatar_url":"https://avatars0.githubusercontent.com/u/11095731?v=4","gravatar_id":"","url":"https://api.github.com/users/BenEmdon","html_url":"https://github.com/BenEmdon","followers_url":"https://api.github.com/users/BenEmdon/followers","following_url":"https://api.github.com/users/BenEmdon/following{/other_user}","gists_url":"https://api.github.com/users/BenEmdon/gists{/gist_id}","starred_url":"https://api.github.com/users/BenEmdon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BenEmdon/subscriptions","organizations_url":"https://api.github.com/users/BenEmdon/orgs","repos_url":"https://api.github.com/users/BenEmdon/repos","events_url":"https://api.github.com/users/BenEmdon/events{/privacy}","received_events_url":"https://api.github.com/users/BenEmdon/received_events","type":"User","site_admin":false},"created_at":"2018-08-29T14:34:17Z","updated_at":"2018-08-29T14:34:17Z","author_association":"MEMBER","body":"Addressed @srinjoym's comments. Could I get another 👀 "}}
{"actor":{"display_login":"BenEmdon"}}