This is a temporary fix to avoid having invalid query
parameters documented in the request schemas.
Also, this change makes the yaml file names match the
controller name instead of using the first part of
the url, since so many of our endpoints start with
/accounts.
test plan:
- Run `OPENAPI=1 rspec spec/controllers/lti/registrations_controller_spec.rb`
- See that a file was created in spec/openapi/lti/registrations.yaml
- It would have been in spec/openapi/accounts.yaml without this change
- See that the word "bad" does not show up in the yaml file (several tests
use "bad" as an example of an invalid query parameter)
Change-Id: Ib7c0093bc8b36fc42bdbb13edb910c61449359f5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/352231
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Tucker Mcknight <tmcknight@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
and apply new cop 99% Style/SuperArguments
and a couple Layout/EmptyComment and Style/ArgumentsForwarding that
are found by fixes in those cops
Change-Id: Icc0af9c8065f035bca43868b564f73e8776052f2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/348626
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jake Oeding <jake.oeding@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Build-Review: Cody Cutrer <cody@instructure.com>
instead of complaining that they need to be run
also fix the migration check to look at actual versions, not just count of
migrations, in case a migration has been renamed or deleted - throwing
off counts
Change-Id: Ifefdf5783cc908db4053ed79fa54f767dcb61514
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/339251
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
test plan:
- run some controller tests with the environment variable
OPENAPI=1
- see that some files have been put in the spec/openapi
directory
- e.g.: delete spec/openapi/lti/registration_token.yaml, then run
OPENAPI=1 bundle exec rspec \
spec/controllers/lti/ims/dynamic_registration_controller_spec.rb
refs INTEROP-8389
Change-Id: I3008a4079013e547bf264808aa7b2f092db8b6a6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/323583
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Paul Gray <paul.gray@instructure.com>
QA-Review: Paul Gray <paul.gray@instructure.com>
Product-Review: Paul Gray <paul.gray@instructure.com>
Build-Review: Aaron Ogata <aogata@instructure.com>
When updating gems we want to ensure a full
suite of specs is run.
flag = none
Change-Id: Ic2d12e2cc7f464021120837cac1ed78609417109
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/325788
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
plugin builds are not getting accurate predictions,
override some of crystalball's methods to fit the way
Canvas-LMS handles plugins.
fixes: DE-1596
flag = none
[force-crystalball]
Change-Id: Ib347737f9e7f65660830ce0ffaaa6b3bc0a27f86
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/324830
QA-Review: James Butters <jbutters@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
manually done. the big one was the explicit locale assignment
in set_locale_with_localizer needs undone in a controller callback
then using with_locale everywhere, specs no longer need to be concerned
about being in an uncertain locale
Change-Id: I5a1d2c907a6f52ee4d8c2307b8c789a1f1ea436e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/320112
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
[skip-stages=Flakey]
Change-Id: I6abefdfa9fed6dd4525c8786e93efa548b3710f2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/319603
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
Build-Review: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
closes AE-81
test plan:
* the people page for an account or course should load properly,
and still sort properly (enforced by specs)
Change-Id: Id8f252af44b2fa4a31786c5c4b7fef9d2aad0946
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/314759
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
refs FOO-2835
flag = none
there are no behavioral changes, only what was necessary to do the
upgrade, see inline comments for explanation where it was warranted
Change-Id: I737f31a210365f190ddb606e96e8eb84e2359e0d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/294133
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
Change-Id: Iad400936d7e53a5f92644f260c95bfb5bf9e972f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/293144
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: August Thornton <august@instructure.com>
Reviewed-by: Alex Slaughter <aslaughter@instructure.com>
Migration-Review: Alex Slaughter <aslaughter@instructure.com>
flag=none
[skip-stages=Flakey Spec Catcher]
Test-plan:
- verify that minimal files are displayed for missing in the map
- ensure that Test Plan junit displays ~45,000 specs run
Change-Id: I516103e3d3348b4f7deaf4124044e8276dfc707e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/288539
Reviewed-by: James Butters <jbutters@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Brian Watson <bwatson@instructure.com>
if all tests files in a dir are included in the crystalball
prediction, just run the parent dir to reduce arguments sent
to rspecq.
flag = none
fixes: DE-1073
Change-Id: I816d2f00e221b74652ed485e414866372def7dcb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/285949
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
flag=none
Test-plan:
- PS1's run including gems/canvas_cache/spec/canvas_cache/redis_spec.rb
shouldn't send that spec to rspecq
Change-Id: I8e5a08c6bdf829a4c338262533c395e013adb378
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/286606
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Brian Watson <bwatson@instructure.com>
flag=none
Test-plan:
- test with changed config ruby file
- test with changed config feature flag yaml file
Change-Id: Ia0bb8bc113ada1e2f7b590c5db223869308401f0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/285429
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Brian Watson <bwatson@instructure.com>
Change-Id: I89129633731a68c38a5026b6b26318d1f3699a2a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/284968
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: August Thornton <august@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
Change-Id: Id27ffbb08609e61a207dcab78ae480a2301a01b9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/285238
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
Reviewed-by: Ryan Norton <rnorton@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
Tested-by: James Butters <jbutters@instructure.com>
flag=none
Test-plan:
- build map in jenkins
- push map to s3 manually
- reference map in test PS
Change-Id: I78c0c57f970256f84120fe3c336e882d6f3d41e2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/284590
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
flag=none
Test-plan:
- unit tests have entries in the crystalball map
Change-Id: I9a05fd5c050f0b4142dfc19fb3b960fdb00f3584
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/283875
Reviewed-by: James Butters <jbutters@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Brian Watson <bwatson@instructure.com>
flag=none
Test-plan:
- new map should have ruby coverage items sorted first
and then js items sorted and added after
Change-Id: I8053fb7be7a77ff82ab7e12b73ebd4eb2f4c551f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/283786
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Kyle Rosenbaum <krosenbaum@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Brian Watson <bwatson@instructure.com>
flag=none
Test-plan:
- generate new map, make sure more things are present without
losing things
Change-Id: I135673942b1fd6353e2a22d2c0441449bab531b2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/280525
Reviewed-by: James Butters <jbutters@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Brian Watson <bwatson@instructure.com>
refs FOO-2520
flag = none
[pin-commit-multiple_root_accounts=2a9bf89895f38df6bf8f54828af66aced594abf0]
revisit the API for resolving asset names to their (real)path on disk,
because adding to the existing logic to support an alternative bundler
made things hard to understand.
This patch brings a new simplified interface Canvas::Cdn::Registry to
query assets and resolve their location.
- Registry#include?(path) tells whether a realpath points to a static
asset
- Registry#statics_available? tells whether static assets are available
- Registry#scripts_available? tells whether JS assets are available
- Registry#scripts_for(bundle) provides the realpaths to all the JS
files in the specified bundle
- Registry#url_for(name) provides the realpath to the static asset
The Registry is a good place to house the BrandableCSS resolving logic
in the future for even more consistency. It can also support an
alternative bundler internally without leaking. Eventually, it would be
nice to have it as a gem.
CHANGES
-------
- helper "font_url_for()" has been removed as it was a duplicate of
existing logic; instead use "font_path(...)" to achieve the correct
result. As a result, BrandableCSS is no longer querying Gulp's
manifest.
- preloaded fonts are now aware of the asset host and work for CDN
- InfoController uses the new Registry API to tell whether Gulp and
Webpack have produced their assets successfully
- ApplicationHelper no longer re-computes the base URL for JavaScripts,
now only the Registry is concerned with that
- ?optimized_js query parameter is no longer supported as it has no real
benefit now that we have access to sourcemaps on production
- ENV['USE_OPTIMIZED_JS'] is now more consistent as there is a single
source of truth for it. The Registry can be instantiated with
{environment: "production"} to point to the optimized version of the
scripts.
- "css:compile" task no longer writes BrandConfig records to the DB,
that is now done as part of the "compile_assets" task, which you can
opt out of doing by setting COMPILE_ASSETS_BRAND_CONFIGS=0
TEST PLAN
---- ----
- load your dashboard and verify all the assets are loaded correctly
- set up a CDN, restart your Rails server and reload the dashboard
- verify all assets are loaded from the CDN
- verify the Lato fonts are pre-loaded from the CDN
- (optional) add custom JS to a sub-account and visit it
- verify the custom JS is loaded and evaluated *after* Canvas's main
javascript bundles
Change-Id: I8198de747cdd5892d6a831cb6c61ba0ef9afa789
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276537
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
closes OUT-4922
Test-plan:
- Get a copy of crystalball_map.yml, copy it to canvas root
- Available via #crystalball-noisy
- Look at a file that has changes under a given spec
- make changes to it, and add it to a new commit
- verify via crystalball dry-run that specs are predicted and
printed out to crystalball_spec_list.txt
- create a new .rb file
- run crystalball dry-run again and verify that the output
warns about a "new file detected" and that the dry-run
produces only a "." in the crystalball_spec_list.txt file
Change-Id: Ia2a5754c02814d681f1d375f5bc7357774b08926
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/281613
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Manoel Quirino <manoel.quirino@instructure.com>
Reviewed-by: Michael Hargiss <mhargiss@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Brian Watson <bwatson@instructure.com>
refs DE-920
flag=none
It's easy to forget to run migrations on your test db. This commit
checks before rspec spins up and will bail early with a helpful
reminder.
TEST PLAN
1) make sure your db migrations are up to date
> RAILS_ENV=test bundle exec rails migrate
2) run a sample rspec test
> bundle exec rspec -fd spec/support/test_database_utils.rb
- it should run normally without failures
3) rollback the most recent migration
> RAILS_ENV=test bundle exec rails db:rollback STEP=1
4) run the same sample test
> bundle exec rspec -fd spec/support/test_database_utils.rb
- it should fail with PendingMigrationError
5) run the same sample test with SKIP_MIGRATION_CHECK=1
> SKIP_MIGRATION_CHECK=1 bundle exec rspec -fd spec/support/test_database_utils.rb
- it should run normally without failurs
6) rerun steps 1 & 2
Change-Id: I4dfd11ae40f48295c3f1967e4b4b847adb1277af
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/280910
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Bobby Buten <bobby.buten@instructure.com>
Product-Review: Bobby Buten <bobby.buten@instructure.com>
Also moves config/initializer/crystalball.rb to spec/support
to prevent it from running in prod
This reverts commit 9a9c68be6e.
Test-plan:
- passes cd to edge without failure
- generates map successfully in PoC build
Change-Id: I67c02ebaea06e11b3a3721aa49217da16e75bd32
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279848
Reviewed-by: Michael Hargiss <mhargiss@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Brian Watson <bwatson@instructure.com>