opened
svenfuchs
username_0
This cleans out several parts of (vendored) travis-core, and moves some parts of it to `lib`.
cleanup core
issue
created
svenfuchs
username_0
tested on staging. looks alright!
comment
created
svenfuchs
username_0
Rolled production back. It doesn't seem to properly update the oauth scopes from GitHub when set to an empty Array on the console.
comment
created
joecorcoran
username_1
PR looks sensible, as much as it possibly can with such a big diff. Is there any part of it you'd like to draw my attention to?
comment
created
svenfuchs
username_0
@username_1 the only commits that sort of change logic are these. they pull things out of the `User` activerecord callbacks, and move these calls to the endpoint instead:

* https://github.com/travis-ci/travis-api/pull/277/commits/84ebb6b24ed5dcec499356c8be7aaaac226bcd58
* https://github.com/travis-ci/travis-api/pull/277/commits/6603990fe4aa43beb932e90d7071b3e2894f4646

this is the only commit that changes actual behaviour (as seen from the outside) ... which i briefly discussed in slack https://travisci.slack.com/archives/teal/p1466509669000832

* https://github.com/travis-ci/travis-api/pull/277/commits/25f74defe5e0d96371842bbe78561bde2cf37a2d

all the rest is basically just:

* moving around files
* changing the namespace `Travis::Api` to `Travis::Api::Serialize` for the serializers that have been in core (we've kinda messed with that namespace by using the same one in travis-api and travis-core for different purposes, so i fixed that now)
* changing test setups so that both suites can run in the same process
comment
created
svenfuchs
username_0
For the sake of documenting this ... my motivation for moving the user sync and oauth scope tracking stuff out of the model was that:

During merging the test suites for some reason that I haven't been able to understand the test suite suddenly started calling the GitHub API several times per test setup/teardown ... which I only noticed because the test runtimes suddenly quadrupled. I tracked this down to `track_github_oauth_scopes` being triggered all the time (per user created as part of the test setup) ... which then called the GitHub API to ask for the scopes.

I figured it was both easier and cleaner to move this stuff out of the `User` model callbacks, and into the respective API endpoint.
comment