[pull] master from OperationCode:master#4
Open
pull[bot] wants to merge 956 commits intosethbergman:masterfrom
Open
[pull] master from OperationCode:master#4pull[bot] wants to merge 956 commits intosethbergman:masterfrom
pull[bot] wants to merge 956 commits intosethbergman:masterfrom
Conversation
* 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]>
Update Documentation
refine the docker-compose config
optimize N+1 query in retrieving CodeSchools with locations
Update automated email (fixes #382)
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
Add bundle prefix to sidekiq
Update devise
…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
Master updates staging and prod
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
Update to Ruby 2.6.3
update codeschools to match prod
Revert "Update to Ruby 2.6.3"
…ruby_update Revert "Revert "Update to Ruby 2.6.3""
…/juliantrueflynn/operationcode_backend into be-repair/invite-slack-api-pybot
…pi-pybot WIP: API request to PyBot for Slack invite
…ck-api Remove previous Slack client that is no longer necessary
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 : )