code-corps / code-corps-api

Elixir/Phoenix API for Code Corps.
https://www.codecorps.org
MIT License
234 stars 86 forks source link

Clean up GitHub Sync with some minor documentation and spec changes #1370

Closed joshsmith closed 6 years ago

joshsmith commented 6 years ago

What's in this PR?

Just some minor cleanup of the GitHub sync code.

begedin commented 6 years ago

As a recap of what I did

Ditched the intermediary modules

My reasoning was, we want things completely flat and as explicit as possible, for an easier switch to a queue system.

Added test coverage for all reachable outcomes of Sync.issue_event and Sync.issue_comment_event. There are still the 3 remaining events, but we can do that separately.

Found and fixed a "bug" (in that it's wrong, but I don't think it was technically causing issues), where, when handling an issue comment event, a GithubComment was created, not associated to a GithubUser or a GithubRepo.

The fix also allowed me to consolidate Sync.GithubComment further.

Renamed all Sync. modules so they follow normal conventions.

begedin commented 6 years ago

The work required to keep this PR up to date as other, smaller PR's are getting merged is becoming costly.

Since this cleans up existing code and adds test, but does not remove any existing features, nor does it change their behavior, I'm merging to avoid further issues.