Skip to content
This repository has been archived by the owner on Mar 29, 2022. It is now read-only.

Handle GitHub errors #431

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open

Conversation

jhaff
Copy link
Contributor

@jhaff jhaff commented Nov 12, 2019

Moved from #412


Description

Fixes #409

This PR consolidates error handling logic for the case when a user's account is suspended(Octokit::AccountSuspended) and when a user's account is missing from Github (GithubPullRequestService::UserNotFoundOnGithubError). This sits in a new service object which gets passed a user and a block, GithubErrorHandler.

For both of these errors, we handle by deactivating the user, putting them in the inactive state (a new state on the state machine specifically for these users no longer accounted for in GitHub) and deleting their associated UserStat, if they have one.

Test process

  • Test that a user causing this error gets deactivated and out in the inactive state
  • Test that that user's UserStat is deleted, if they had one
  • Test that if an unhandled error is passed to the GithubErrorHandler, it raises the error

Requirements to merge

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@jhaff jhaff mentioned this pull request Nov 12, 2019
9 tasks
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.

Handle Github Errors Appropriately
2 participants