Skip to content

[pull] master from OperationCode:master#4

Open
pull[bot] wants to merge 956 commits intosethbergman:masterfrom
OperationCode:master
Open

[pull] master from OperationCode:master#4
pull[bot] wants to merge 956 commits intosethbergman:masterfrom
OperationCode:master

Conversation

@pull
Copy link
Copy Markdown

@pull pull bot commented Jul 24, 2018

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

@pull pull bot added the ⤵️ pull label Jul 24, 2018
robbkidd and others added 29 commits September 13, 2018 09:57
* add a default sort order to the locations association on CodeSchool
* update CodeSchoolsController to include locations in the query result
  passed to the JSON rendering
* remove the custom locations() method from CodeSchoolSerializer to make
  the serializer rely on the association and default sort ordering
  already declared

* added a factory for creating a code school with 1-15 locations

Signed-off-by: Robb Kidd <[email protected]>
The web service in docker-compose.yml creates an image named
"operationcodebackend_web". Much like the bundle service is configured
to reuse that already-built image, this configures the sidekiq service
to also reuse web. No need to also build a sidekiq image which takes up
time and disk space.

Signed-off-by: Robb Kidd <[email protected]>
The web service is updated to bind port 3000 to the loopback interface
(e.g. localhost) only, not all interfaces. No need to share your
development backend API to the whole coffee shop.

Signed-off-by: Robb Kidd <[email protected]>
optimize N+1 query in retrieving CodeSchools with locations
Laziness in a factory lets an attr be random. Without putting these in
Ruby blocks, FactoryGirl will call Faker for an attribute once when a
factory is first used and then use that value for every create() and
build() thereafter. This is helpful in development for being able to
generate a bunch of sample data in the database that looks different. It
will also ensure that the records for the test suite are randomish to
make sure tests aren't passing because of some underlying, but
unintentional consistency.

Signed-off-by: Robb Kidd <[email protected]>
wrap some factory attrs in blocks to make them lazy
The default log level of DEBUG currently in application.rb generates so
much console output that deprecations and other warnings are lost in the
noise.

Signed-off-by: Robb Kidd <[email protected]>
This resolves a deprecation warning from MiniTest:

    Use assert_nil if expecting nil from <test>. This will fail in MT6.

Signed-off-by: Robb Kidd <[email protected]>
This fixes a race condition between the web process creating the user
record and a worker process picking up the job to use the user record to
add them to SendGrid.

The race shows itself in an error from Sidekiq:

    ActiveJob::DeserializationError: Error while trying to deserialize
    arguments: Couldn't find User with 'id'=1234

The `welcome_user()` method is the thing scheduling a job that is trying
to find a user. Making the ActiveRecord lifecycle callbacks responsible
for business processes can be painful to test and maintain. This change
removes the welcoming of a user from the User model's callbacks and
makes the controller action that creates users responsible for welcoming
them.Asserting that the job is enqueued is then possible in the User
model test without the double-enqueue that would occur before: once when
the test user instance was created (saved and committed) and again when
calling the `welcome_user()` method to test it.

Summary of changes:

* User's after_create callback to welcome_user is removed.
* User's tests are updated to only confirm that the job is enqueued when
  welcome_user() is called.
* UsersController now calls welcome_user after a user is successfully
  saved to the database which avoids the race condition between save and
  job execution.
* UsersController tests are updated to:
  * assert that User's welcome_user is called during create controller
    action
  * share a common set of valid user_params
  * dry the tests slightly by using the valid_user_params with a removal
    to test invalid user params

Signed-off-by: Robb Kidd <[email protected]>
…-to-db

schedule welcoming jobs after user has been saved to the database
apex-omontgomery and others added 29 commits April 20, 2019 20:03
…o master will update both staging and prod and not require kubectl access
Uses built-in system tools to parse the Gemfile.lock & pull out the
bundler version used to build the Gemfile.lock, ensuring that's the same
version of bundler used to bundle inside the container

Resolves the warning:

> Warning: the running version of Bundler (1.14.6) is older than the version that created the lockfile (1.17.1). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`."

Also helps prevent issues with bundle version conflicts/differences in
the future

Also updates rubygems to ensure we have all the latest patches and
updates. Per the output from inside the container, this includes a
number of patches dating back to 2017-03-16 which include at least five
(5) CVE fixes
Add bundle prefixes to rails/rake/rubocop commands
Install version of bundler from Gemfile
- Ruby 2.3.3 is EOL, update to the latest supported Ruby version
- Fixes on small bug in a rake task that broke specs

Tested with:

```
make minty-fresh
make setup
make test
```
removed the operationcode- prefix to match the infra changes
…ruby_update

Revert "Revert "Update to Ruby 2.6.3""
…pi-pybot

WIP: API request to PyBot for Slack invite
…ck-api

Remove previous Slack client that is no longer necessary
@pull pull bot added the merge-conflict Resolve conflicts manually label Feb 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⤵️ pull merge-conflict Resolve conflicts manually

Projects

None yet

Development

Successfully merging this pull request may close these issues.