refs AE-1492
Test Plan:
1. Ensure that all appropriate gem versions are installed for CANVAS_RAILS=6.1 with plugins enabled
2. Ensure that all appropriate gem versions are installed for CANVAS_RAILS=7.0 with plugins enabled
3. Ensure that removing Gemfile.rails*.lock and running “bundle install” produces both 6.1 & 7.0 lockfiles with no overwrites to the partial files
4. Ensure that all lockfiles update when using “bundle update” in both versions and there are changes to commit
5. Ensure that removing plugins and running “bundle install” produces no changes to commit
6. Ensure that “bundle exec rails c” with CANVAS_RAILS=6.1 runs the right version
7. Ensure that “bundle exec rails c” with CANVAS_RAILS=7.0 runs the right version
8. Ensure that the Gemfile.*.lock.partial does not contain any secrets or private plugin names
NOTE: “vcr” gem is intentionally pinned to an old version (6.0.0) for testing
Change-Id: Id8e449466ec7839b3b71f2430256c0e8d0967775
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/309093
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
Reviewed-by: Alex Slaughter <aslaughter@instructure.com>
QA-Review: Isaac Moore <isaac.moore@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Build-Review: Alex Slaughter <aslaughter@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
closes OUT-5418
flag=outcome_service_results_to_canvas
Test plan
- Find an authoritative result that appears in the csv report.
- Using the outcomes service rails console, delete the corresponding
attempt record.
- Regenerate the outcomes csv report and verify that the record is
still there. Note if the result was for an outcome that was aligned
with a question, the report will now be missing the question id
and question title because that info is stored on the metadata
of the attempt.
Change-Id: If1d1fa5ba7c434e23215e41e8aa6ef86b6cd199a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/308391
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Chrystal Langston <chrystal.langston@instructure.com>
QA-Review: Chrystal Langston <chrystal.langston@instructure.com>
Product-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
Test Plan:
1. Validate that reports can be generated as usual
flag=none
refs PFS-21068, PFS-21064
Change-Id: I0be559dd3fefc9b4f4e7f26919d0614a86c11ca4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/306962
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Mark Valentine <mvalentine@instructure.com>
Reviewed-by: Mark Valentine <mvalentine@instructure.com>
QA-Review: Trevor Byington <tbyington@instructure.com>
we don't need to suggest `disable_ddl_transaction!` when adding
a non-indexed reference
fixes FOO-3298
test plan: specs
Change-Id: I33ca47954e5760bf3f14d8b240891713f735eeda
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/308301
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
refs OUT-5415
flag=outcome_service_results_to_canvas
Test plan
- This relies on https://gerrit.instructure.com/c/outcomes-service/+/307601
- Before adding these patch sets to your workspace
- ensure you have some new quizzes that are aligned with account
level outcomes and students have taken them.
- Generate the csv report and ensure that there are new
quiz results.
- Add these two patch sets to your workspace
- Generate the report again
- Diff this reprot with the one previously generated. There
should be no differences. (use the CLI diff tool)
Change-Id: Id637622b2f04df884bd3ab91554079c32bafd0c5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/307578
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Chrystal Langston <chrystal.langston@instructure.com>
QA-Review: Chrystal Langston <chrystal.langston@instructure.com>
Product-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
closes AE-30
flag=none
test plan:
- verify Canvas boots in CD
- verify no influx of new errors in CD
[fsc-timeout=30]
Change-Id: Ifa04bebe1b09f01c6d3b8b2d8f3bb424759730f5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/308067
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Isaac Moore <isaac.moore@instructure.com>
Product-Review: Isaac Moore <isaac.moore@instructure.com>
Build-Review: James Butters <jbutters@instructure.com>
refs AE-92
These deprecated methods were previously a wrapper around URI::DEFAULT_PARSER.*. Just convert them to the underlying method for the least risk.
Change-Id: I2d7e24e61fca15346c2c9d7254ad4f3eff0cbae2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/307348
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Alphanumeric ids for answers on multiple choice assesment question
would cause errors due to an integer typecast during conversion.
fixes LS-3598
flag=none
test plan:
- Create a imscc file with a question bank
- Set a response_label ident of alphanumeric values that
would be integer cast to the same value
- Make a quiz set to pull this question from the bank.
- Take the quiz as a student and check the student results API
- Ensure the choices have different answer IDs
Change-Id: I6a87f0a1f21754f55284748b71bef9764b87fe9f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/306407
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Robin Kuss <rkuss@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Luis Oliveira <luis.oliveira@instructure.com>
Change-Id: Ibf04a5556a17af0fb03e73aff16ac1c8a03487c7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/306905
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
flag=none
test plan
- set up your notorious to use http
- make sure you can upload a video
Change-Id: I537c92c9abf0bca43484db27e191f60343243cdd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/306722
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Deyvison Penha <deyvison.penha@instructure.com>
QA-Review: Deyvison Penha <deyvison.penha@instructure.com>
Product-Review: Jon Scheiding <jon.scheiding@instructure.com>
Also move some files used in initializers
Change-Id: Ieb4ea21b0c1888361f4b1dd227fa6db12eed453f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/304381
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
test plan:
- text-only questions in the BB Ultra test package
should import properly (and not as "Error" questions)
flag=none
closes LS-3596
Change-Id: I2cb93c5735704e6cd04dd66d432f49504e0985ae
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/304326
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Luis Oliveira <luis.oliveira@instructure.com>
QA-Review: Luis Oliveira <luis.oliveira@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
the answer and response ids don't match in BB Ultra, but they
do seem to appear in the same relative order in the XML, so
match them by position
test plan:
- the test BB Ultra package should import multiple-choice
quiz questions properly
flag=none
closes LS-3594
Change-Id: Ia30095b8fbcf162b13d3a13e95987779183b5f11
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/304245
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Luis Oliveira <luis.oliveira@instructure.com>
QA-Review: Luis Oliveira <luis.oliveira@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
During test execution a sequence of tests fail with:
"Only Redis glob strings are supported: /^dynamic_settings\//"
This is because Redis does not support regular expressions
as parameters for "cache.delete_matched(...)"
The accepted format is glob
(see https://redis.io/commands/keys/)
fixes DE-1463
flag=none
test plan:
- existing tests pass and the above error is not found in the flaky failures
Change-Id: I411faef90bb4b0f7b7e3e3ff948453cac23e5a19
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/305400
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
This also includes handling pagination for results
that contains more than 1 page of data.
closes OUT-5387
flag=outcome_service_results_to_canvas
test plan:
- Jenkins passes
- Since this requires a large number of outcomes,
assignments, and users in a Course with new quiz results
this PS will be tested in Beta in the next Bug Bash.
Change-Id: I33a3d502bb1a1412d2120d7c676789316707418c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/305274
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Kyle Rosenbaum <krosenbaum@instructure.com>
QA-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
Product-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
Mainly for troubleshooting local Notorious setup
flag=none
test plan
- do something that makes your Notorious return HTTP errors
(e.g. change the client ID or secret in plugin settings)
- find an RCE
- try to embed a video
* expect that your web container logs show "Error from Kaltura service"
and some error information
Change-Id: Ic79856b8957336054f1d4c2ab6e13cc6053c0f0a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/305132
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
QA-Review: Mysti Lilla <mysti@instructure.com>
Product-Review: Jon Scheiding <jon.scheiding@instructure.com>
closes OUT-5227
closes OUT-5391
flag=outcome_service_results_to_canvas
Test Plan
- dc down on outcome service
- In canvas, navigate to account settings
- ensure you have outcome_service_results_to_canvas flag enabled
- go to reports and generate the Outcome Results report
- it will error out because it cannot communicate with OS
- Bring OS back up
- generate the report again and verify it didn't fail
Change-Id: I9ee6ea5220fc458e1dd374bf5def092085403e4b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/304019
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Martin Yosifov <martin.yosifov@instructure.com>
Reviewed-by: Kyle Rosenbaum <krosenbaum@instructure.com>
Product-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
QA-Review: Chrystal Langston <chrystal.langston@instructure.com>
Adds a plugin option in development environments to specify whether to
talk to Notorious over HTTP or HTTPS. In production environments, this
option will not be available. If option is nil, will default to still
using HTTPS.
flag=none
test plan prerequisites
- Working Notorious setup that is using HTTP
- make sure PROTOCOL env var in your Notorious override file is set
to HTTP
- make sure there is no cert for Notorious in `~/.dinghy/certs`
test plan
- Go to http://canvas.docker/plugins/kaltura?all=1
- Change the "Protocol" setting to "http" and click Apply
- Find an RCE
- Try to upload a video
- Find an Assignment submission
- Try to add a media comment
Change-Id: If18015d7b6b401db56d320d168f753a1e40e9868
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/300494
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
QA-Review: Jon Scheiding <jon.scheiding@instructure.com>
Product-Review: Jon Scheiding <jon.scheiding@instructure.com>
Change-Id: I38480368611e4b4166ee2a262038c6a1319f2f58
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/304807
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>
Remove data-method when present in html element when RCE is saved.
fixes MAT-1045
flag=none
Test Plan
- Need a course with at least one student
- Steps outlined below taken from SEC-6537
** The steps in that ticket seem to rely on a tool called "burp". I
instead switched the RCE to Raw HTML edit before saving.
- As a teacher or admin (victim), create a new assignment in the course
-- 10 possible points
-- Use appropriate dates to make it available
-- Click on "Save & Publish"
-- Copy the course_id and assignment_id from the URL & keep them handy
-- e.g. * http://canvas.docker/courses/1/assignments/3
- As a student, navigate to /dashboard/eportfolios
-- I went to the course > People > select student > Act as user
-- Copy the student's user_id from the URL & keep it handy
- Click on "Create an ePortfolio", name it, make it public
- Click on the "Welcome" link on right side of page
- Click on "Edit this page"
- Put the RCE in Raw HTML Edit mode
- Add HTML similar to the one in my recent comment MAT-1045:
- Click on "Save Page"
- Copy the URL after the ePortfolio save page
- Log back in as the teacher or admin (victim)
- Paste the copied url and navigate to it
- Click on the "check out my resume" link
* Verify:
1. Bad URL error in canvas
2. Navigate to Course > Grades and verify student's grade was not
updated.
Change-Id: I4a9fc50baa00ff998bda1f344036479390b18eac
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/304040
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Ed Schiebel <eschiebel@instructure.com>
Product-Review: David Lyons <lyons@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
closes OUT-5299
flag=outcome_service_results_to_canvas
test plan:
- tests pass in Jenkins: please pay extra attention
to the test plan. These tests should line up with
the tests in learning_outcome_result_spec.rb to
ensure all assignments that are classified as muted
are removed from the OS results.
- For testing in the UI:
- In a course with outcomes, create 2 New Quizzes
- Each quiz should be aligned to a different outcome
- Turn on LMGB, sLMGB, and Outcome Service Results to
Canvas FF on.
- Take each quiz as a student
- As a teacher, confirm:
- both outcomes have results in the LMGB
- both outcomes have results in the sLMGB
- results will be identified as a mastered/unmaster
pill. The list of assignments & its aligning
mastery in PS OUT-5297 & OUT-5298
- As a student, confirm:
- both outcomes has results in the sLMGB
- As a teacher, mute 1 quiz in the gradebook:
https://community.canvaslms.com/docs/DOC-12961-4152724339
- As a teacher, confirm:
- both outcomes are displaying in the LMGB & sLMGB
- As a student, confirm:
- Only 1 outcome results is displaying in the sLMGB
- As a teacher, mute the 2 quiz in the gradebook and
confirm:
- both outcomes are displaying in the LMGB & sLMGB
- As a student, confirm:
- 0 outcome results is displaying in the sLMGB
- As a teacher, unmute both quizzes & confirm:
- both outcomes has results in the LMGB & sLMGB
- As a student, confirm:
- both outcomes has results in the sLMGB
Change-Id: I21e085b3e856410cfe89ce57db2271f05858c097
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/302565
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Dave Wenzlick <david.wenzlick@instructure.com>
QA-Review: Dave Wenzlick <david.wenzlick@instructure.com>
Product-Review: Chrystal Langston <chrystal.langston@instructure.com>
also add safety net for similar potential
issues
fixes MAT-1046
flag=none
test plan:
-follow the steps outlined in SEC-6558
>notice that after navigating back to the page
you entered what was previously an XSS issue,
you'll see that it does not appear anymore
Change-Id: I90057aaa9322ebaf434b6f9cc2154b54a36bee13
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/302966
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Ed Schiebel <eschiebel@instructure.com>
Product-Review: Jake Oeding <jake.oeding@instructure.com>
closes OUT-5167
flag=outcome_service_results_to_canvas
Test plan
- create an outcome at the account level and import it into a course
- create a classic quiz and align the outcome with it
- create a new quiz and align the outcome with it
- create a 2nd new quiz and align the outcome with multiple questions
- Go to account settings, reports, and generate the
"Outcome Results" report.
- Verify that the report is empty because no one has taken the
quizzes yet.
- log in as a student and take all three quizzes
- log in as an admin and go to account settings, reports, and
generate the "Outcome Results" report.
- download the report and verify
- Report has 1 row for the classic quiz
- Report has 1 row for first new quiz
- Report has 1 row for each question of 2nd new quiz
- Default ordering is by user id, outcome id, course id
- Canvas data appears first in the report followed by os data
(this happens because if user, outcome, and course are all
equal, we put canvas data first)
Change-Id: I3dd86d72c3e26061f9e3cd77beec1a5458e99501
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/300790
Product-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
Reviewed-by: Kyle Rosenbaum <krosenbaum@instructure.com>
Reviewed-by: Chrystal Langston <chrystal.langston@instructure.com>
Reviewed-by: Martin Yosifov <martin.yosifov@instructure.com>
refs DE-1383
Change-Id: I6ab3efff2328717a74626a4fc2b4e171e41bcb06
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/293150
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
Refactoring the write_outcomes_report method to
help Learning Outcomes team avoid merge conflicts and
accommodate future enhancements more easily. Arg for
custom message when report scope is empty has been
replaced with a config_options hash, and that hash
has its default empty scope message set if one isn't
provided via the hash passed by the caller.
Test plan:
1. Make sure outcome reports and GSD student
outcomes report specs still pass, functionality
should not have changed.
* Note: also fixed one minor comment in application
controller that had inaccurate path information,
unrelated to this specific project
flag=none
refs: PFS-20577
Change-Id: I2eb76f71136489eabaf519ee6bb5de7a36f2e68e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/302428
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Mark Valentine <mvalentine@instructure.com>
QA-Review: Miles Nerenberg <miles.nerenberg@instructure.com>
Product-Review: Miles Nerenberg <miles.nerenberg@instructure.com>
closes OUT-5202
flag=none
Test Plan:
- Launch the rails console
- Make note of the number of LearningOutcomeResults you have:
LearningOutcomeResult.count
- If you don't have any LearningOutcomeResults, you can create
one in Canvas:
- Create an outcome
- Create a rubric and align the outcome to the rubric
- Create an assignment and align the rubric to the assignment
- Act as a student and take the assignment
- Stop acting as the student and grade the student using the
rubric in SpeedGrader
- Verify that a LearningOutcomeResult exists in the rails
console for that student, outcome, and alignment
- Find any LearningOutcomeResult and save it to a variable:
res = LearningOutcomeResult.first # or whichever result
- Save a copy of that result with a different score:
same_res = res.clone
same_res.score = 1 # or some score that is different
same_res.save!
- Observe that the LearningOutcomeResult.count has gone up by
one
- Observe the LOR clone has workflow_state = "deleted"
- Observe the original LOR has workflow_state = "active" and
the score is set to the score we set for the clone
- In Canvas, open the student's assignment in SpeedGrader
- Note: You will see that the rubric grade is different
than the current LOR score. This is fine because of how
we simulated a clone LOR being created. In real life,
these duplicate LORs would be created by the rubric
assessment and the score would stay consistent between
the assessed rubric and LOR.
- Change the rubric score to 4 (or something different from
the LOR score)
- Observe in the rails console that the LOR was updated with
the score from the rubric and that no other LORs for that
student, outcome, and assignment are active
Change-Id: I14780f1be36cb50075d09704abcba227ecc0bc79
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/299263
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Martin Yosifov <martin.yosifov@instructure.com>
QA-Review: Martin Yosifov <martin.yosifov@instructure.com>
Product-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
these changes don't change the current functionality of any
pre-existing outcome reports at all, however new reports
inheriting from the base outcome reports can now customize
the text that appears in the csv file if no results are found
Test Plan:
1. Make sure you have the corresponding patchsets
from custom_reports and professional_services.
2. Run an outcomes report w/ parameters that would
return no results.
3. Download the resulting CSV and it should say
'No outcomes found' by default.
flag = none
refs: PFS-20577
Change-Id: If39252b3f734c593823c20d1d4b428616647c1cd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/301229
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Sean Mikkelsen <smikkelsen@instructure.com>
QA-Review: Mark Valentine <mvalentine@instructure.com>
Product-Review: Mark Valentine <mvalentine@instructure.com>
only clear the shard cache from multicache, and therefore
support distributed `delete_matched`
Change-Id: Iebda2e8b2df0a1aa85997c2ede47b113f0fadc15
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/300099
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>
flag = none
fixes: QO-895
fixes: QO-896
test plan:
- delete translation files in web conatiner
rm -rf public/javascripts/translations/*
- stop your docker environment
docker-compose down
- run update script
script/docker_dev_update.sh
- change your profile settings to another language
for example catalan ca
- visit /courses/1/quizzes
- you should see points and number of questions in the
selected language
Change-Id: I1ce3c79145dba71e2d4f5e2e2b7d7ea8fca1b025
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/298756
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
QA-Review: Endre Berki <endre.berki@instructure.com>
Product-Review: Endre Berki <endre.berki@instructure.com>
While I am at it, decaffinate and typescriptify TextHelper
fixes FOO-2987
Change-Id: I0b8f33a610bee737ea79ad24d8aec8f8e8051c49
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/299013
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: August Thornton <august@instructure.com>
Product-Review: August Thornton <august@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Build-Review: Bobby Buten <bobby.buten@instructure.com>
On a system where the QTI Migration Tool is not installed, Canvas still
tries to run it.
In this situation `@migration_executable` is `nil`, so
`Qti.get_conversion_command` returns a bogus command string. This leads to
unhelpful error messages in `run_qti_converter`. The error cases in said
function assume that a *valid* command failed (and therefore look to the
command's standard output for information about the failure).
When `@migration_executable` is `nil`, raising the error in
`Qti.get_conversion_command` tells user that they haven't installed the tool.
closes: gh-2057
Change-Id: I03a332897966acbf6e302353f33ea61751021cfa
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/294672
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Alex Slaughter <aslaughter@instructure.com>
QA-Review: Alex Slaughter <aslaughter@instructure.com>
Product-Review: Alex Slaughter <aslaughter@instructure.com>
Test plan
- Go to the account permissions and set the "Users - view
primary email address" permission for the teacher role to
"enabled" (not "Use Default")
- In a course with a teacher, add an HTML file
- Clear your redis cache
- Load the file like <canvas>/courses/:id/files/:file_id
- Change some code in your models or controllers (so it reloads)
- Load the file again from <canvas>/courses/:id/files/:file_id
- Ensure it doesn't error and can load the file the second time
Change-Id: Ib000af7bfa258d5bd27826aafc4229037cc5008d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/298004
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
The data is retrieved but not used yet. That will happen in
OUT-5167: Merge and Order results for CSV in Canvas
closes OUT-5149
flag=outcome_service_results_to_canvas
Test Plan:
- Prereq: Canvas is provisioned with Outcomes Service see
https://instructure.atlassian.net/l/c/BDA1nXEX
- In canvas, start the rails console
- Switch to your shard (i.e account = switch_to_shard!
'wenzlick.canvas.docker')
- Populate test data using the canvas UI
- Create a course and assign two students to it
- Create an outcome
- Create a quiz and associate that outcome with it
- Take the quiz as both students
- Validate that you have authoritative results for those
studnts
- Go to http://pgweb.outcomes.docker/
- select the shard of the account that you are using
- Under the tables, click on authoritative_results
- Validate that there are authoritative_results for
the quizzes you just took
- We need to add a call to outcomes_lmgb_results and some print
statements to validate the the code is working as expected.
Place the following code in
gems/plugins/account_reports/lib/account_reports/outcome_reports.rb
This should be the first few lines in the outcome_results_scope
method (around line 214)
results = outcomes_lmgb_results
# These print statements are here so we can test
# OUT-5149 independently
if results.blank?
p "OUT-5149 results not found"
else
p "OUT-5149 results found"
ap results
end
- Test Case 1: Verify that we get no results when flag is disabled
- In canvas, start the rails console
- Switch to your shard (i.e account = switch_to_shard!
'wenzlick.canvas.docker')
- Ensure
account.feature_enabled?(:outcome_service_results_to_canvas)
returns false
- Run the report outcome_reports =
AccountReports::OutcomeReports.new(AccountReport.find(1))
outcome_reports.outcome_results
- In the output, verify that you see the message "OUT-5149
results not found" (this will be towards the top of the
output so you'll have to scoll up past all the sql in your
console)
- Exit the console
- Test Case 2: Verify that we get results when flag is enabled
- Enable Outcome Service Results to Canvas Reporting FF
- In canvas, start the rails console
- Switch to your shard (i.e account = switch_to_shard!
'wenzlick.canvas.docker')
- Ensure
account.feature_enabled?(:outcome_service_results_to_canvas)
returns true
- Run the report outcome_reports =
AccountReports::OutcomeReports.new(AccountReport.find(1))
outcome_reports.outcome_results
- In the output, verify that you see the message "OUT-5149
results found" (this will be towards the top of the output
so you'll have to scoll up past all the sql in your console)
- Underneath "OUT-5149 results found", verify that you have
the json representation of the authoritative results created
when populating the test data
Change-Id: I48946cc824305a9dae6c26ef1c3312f3c8fcb0e4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/296461
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Chrystal Langston <chrystal.langston@instructure.com>
QA-Review: Chrystal Langston <chrystal.langston@instructure.com>
Product-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
fixes INTEROP-7027
flag-none
test plan:
* since we can't intentionally cause an "InternalFailure" we can only run the associated test `async_worker_spec.rb:110`
Change-Id: I42105c0475ea8036bdc955472bce8953c659cfa8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/296842
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
Product-Review: Alexis Nast <alexis.nast@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
this function that parses HTML (badly) with regexes seems
not to be needed after the Nokogiri 5 update, which deals
with unmatched angle brackets in HTML much better than
the old version did
the tests written for previous iterations of this function
still pass, and manual checks of CORE-1510, CNVS-21544,
and CNVS-9919 seem good too
test plan:
- a tag such as `<img alt="1 < 2" src="blah">` in
question text should copy properly
- less than / greater than symbols in question text
or answer comments should copy properly
fixes LS-3248
Change-Id: If7ff7387e061836165322738a9285cd962cb5597
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/295312
Reviewed-by: Eric Saupe <eric.saupe@instructure.com>
QA-Review: Eric Saupe <eric.saupe@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
fixes MAT-894
flag=none
[ignore-stage-results=Flakey Spec Catcher]
Test plan
- Using both local storage and s3 storage
(and InstFS would be nice, but I don't
know how to set that up locally)
- In destroy_content_and_replace (app/models/attachment.rb)
set up a debugger before the Attachment::Storage line
- Delete a file using the API like this
DELETE http://<canvas>/api/v1/files/:id?replace=true
- Raise an error that causes the file deletion to fail
partway through
- Then delete the file again, but make sure it succeeds
and verify that the file looks like the "file_removed"
file and that the purgatory object looks like the
previously removed file
Change-Id: I73053a365376afc2ddbfc26d445c45c6b9152773
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/294835
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Gonzalo Penaranda <gonzalo.penaranda@instructure.com>
QA-Review: Gonzalo Penaranda <gonzalo.penaranda@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
refs FOO-2801
flag = none
[change-merged][build-registry-path=jenkins/canvas-lms/foo-2801]
[pin-commit-analytics=4fd9e2fbb7fc2790ba7985bb4025e901bf33a9e3]
this part reaches the goal of this series where we turn the locale
files that are used by our JS engine into plain JSON files that don't
need any special processing and are also of a simpler structure
before, translations were stored in a tree structure that we needed to
traverse in order to look up a translation, which we did by
deconstructing keys through the "." operator:
I18n.lookup("foo.bar.baz")
{
en: {
foo: {
bar: {
baz: "Hello!" // <-- this
}
}
}
}
now, translations are stored in a flat dictionary structure where the
keys are not processed in any special way but are instead "fully
qualified":
I18n.lookup("foo.bar.baz")
{
en: {
"foo.bar.baz": "Hello!"
}
}
this is nice when you consider that the previous structure contained a
mixture of nested keys and flat ones, based on different conditions:
{
en: {
"asdf_1234": "ASDF", // inferred, so it was never "nested"
"foo": {
"bar": {
"baz": {
"one": "One banana",
"other": "Many many bananas"
}
}
}
}
}
because, for example, keys that are inferred by i18nliner end up at
the root level and not nested. You also never knew whether a key was a
container or a phrase that was pluralized, because they both had the
shape of an object.
Now these distinctions are gone; a key is always fully-qualified
regardless of how it was specified:
1) inferred: I18n.t("Inferred key")
// => inferred_key_c49e3743
2) absolute: I18n.t('#buttons.cancel')
// => buttons.cancel
3) relative: I18n = useScope('outer')
I18n.t('something', 'Something')
// => outer.something
4) nested: I18n = useScope('outer');
I18n.t('something.inside', 'Something inside')
// => outer.something.inside
5) pluralized: I18n.t({
one: 'One banana',
other: 'Many bananas'
})
// => many_many_bananas_ce8e7fb7.one
// => many_many_bananas_ce8e7fb7.other
Change-Id: I7c33fbd2321d7d56994223d65f2572db0ac12ed5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/293675
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
refs FOO-2801
flag = none
[change-merged][build-registry-path=jenkins/canvas-lms/foo-2801]
gems/canvas_i18nliner is now a package @instructure/i18nliner-canvas and
lives in the same repo on github along with the 3 other i18nliner
libraries.. this was done to make it easier for maintainers to deal with
this code, since changing one part may break the other due to how
they're architected
the source on github: https://github.com/instructure/i18nliner-js
~ test plan ~
build is still OK, this only affects the generation of files, and those
i manually verified to be identical before and after
Change-Id: I78afa8a808f1699c10aced8466cfade066848bc9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/294209
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
for backwards compat until we upgrade all the callsites to use
i18n:extract
refs FOO-2801
flag = none
~ test plan ~
you can call "rake i18n:generate" to do what "rake i18n:extract" does
Change-Id: I0a4cd9a1fe8273aad0a570c3dc5beaf61bc8554c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/294619
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Ahmad Amireh <ahmad@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
refs FOO-2801
flag = none
this patch renames the rake task i18n:generate to i18n:extract to better
reflect what it does and to be consistent with the rest of the codebase
this might not be significant for 99% of users, but for maintainers who
deal with i18n code - i18nliner on ruby, i18nliner on js, i18n_tasks -
this particular Rake API is disorienting because everywhere in the code
the routine is referred to as "extraction" except for the api --
"i18n:generate", it's also compounded by the other api
"i18n:generate_js" which is significantly different in terms of logic,
so you always had to keep that in mind
now we have:
- i18n:extract - extract translations from all source code; Ruby, JS,
Handlebars into a single YAML file with a tree structure
- i18n:generate_js - generate translation files for the JS *runtime*
~ test plan ~
you can still run i18n:extract and i18n:generate_js, and Jenkins runs
them too
Change-Id: I0216206b46c225e101dcd2112d9f84b773a84d04
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/294207
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
QA-Review: Ahmad Amireh <ahmad@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
Refs FOO-2801
flag=none
[change-merged]
[build-registry-path=jenkins/canvas-lms/foo2801]
Fixes bad filename in a Rake task
Test plan:
* Post-merge build passes (these flags should force it to run)
Change-Id: I12c10634439828ffd703b5a52e081c13f3371c2d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/294538
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
Reviewed-by: Ben Rinaca <brinaca@instructure.com>
refs FOO-2801
flag = none
move implementation of Rake tasks into their own Ruby modules so that we
may more easily test them; the Rake tasks will do any necessary IO while
the stuff in lib/ will be confined to the logic
~ test plan ~
we can still run i18n:check and i18n:generate_js
Change-Id: I14526acb41d3efec3a27cd6435a853a515ba41b6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/292205
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
QA-Review: Ahmad Amireh <ahmad@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
refs FOO-2801
flag = none
the code has since been ported to use format-message and the only
straggler was the natcompare module, which really only needed the active
locale, which is now exposed to it by the entrypoint
~ test plan ~
the file browser in the RCE continues to work
Change-Id: Iaf6fc588fe86117f9cc63701f70992987be547ba
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/293551
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob DeWar <jacob.dewar@instructure.com>
QA-Review: Jacob DeWar <jacob.dewar@instructure.com>
Product-Review: Ahmad Amireh <ahmad@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>
Change-Id: I61d5ba9f6ef5e0837da2ec22b695b9a56b88acb5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/293104
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: August Thornton <august@instructure.com>
Reviewed-by: Alex Slaughter <aslaughter@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
report rows to not have duplicates when failure occurs
refs: PFS-20002
flag = custom_report_experimental
Test Plan:
- Deploy to production and turn on feature flag for individual
customer experiencing issues
- Verify that job is retrying when failing
Change-Id: I4272bdfd960814ecd366bdf07ce82ea20663ead0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/292102
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ben Rinaca <brinaca@instructure.com>
Reviewed-by: Mark Valentine <mvalentine@instructure.com>
QA-Review: Clint Pelish <clint.pelish@instructure.com>
Product-Review: Clint Pelish <clint.pelish@instructure.com>
TEST PLAN: Dev verified in rails console that new
method of checking report db seems to work.
Change-Id: I96eacab4c18b9bf2e1a2cde64ce27272da864601
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/292787
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Mark Valentine <mvalentine@instructure.com>
Product-Review: Mark Valentine <mvalentine@instructure.com>
closes LS-3015
flag=none
Test plan:
- Check that when kaltura reaches a 503 it
will properly log that the service is unavailable
Change-Id: I2a3ee4d8cbc39a650292787be0d1647af6a06bc0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/291840
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jackson Howe <jackson.howe@instructure.com>
QA-Review: Jackson Howe <jackson.howe@instructure.com>
Product-Review: Luis Oliveira <luis.oliveira@instructure.com>
This flag indicates allows LTI 1.1 tool providers to check
if an LMS supports this new extension.
closes QUIZ-9501
flag=none
Test Plan:
- Associate an LTI 1.1 tool (like Quiz LTI) to an assignment
in Canvas
- Launch the tool via the assignment and observe the post
request made for the tool launch
- Valide "ext_outcome_submission_needs_additional_review_accepted"
is sent in the post request and is set to true
Change-Id: Ife10f09af5bdef1f958ac0c6d6a55ed6e81e9e3a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/290387
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Alex Slaughter <aslaughter@instructure.com>
QA-Review: Alex Slaughter <aslaughter@instructure.com>
Product-Review: Alex Slaughter <aslaughter@instructure.com>
closes QUIZ-9497
flag=none
Test Plan:
- Launch an LTI 1.1 tool assocaited to an assignment (like New
Quizzes) with the browser's network inspector open
- Find the POST request that was the LTI launch
- Validate ext_outcome_submission_needs_additional_review_accepted
was sent with a value of "true"
Change-Id: I9b1691143bb4796472cf7a83634c82c02229efeb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/290240
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Stephen Kacsmark <skacsmark@instructure.com>
Reviewed-by: Jorge Arteaga <jorge.arteaga@instructure.com>
Reviewed-by: Ricardo Oliveira <ricardo.oliveira@instructure.com>
QA-Review: Jared Crystal <jcrystal@instructure.com>
refs QUIZ-9495
flag=none
This change allows referencing a Model's workflow_state
values an an enum-like way.
For example, let's pretend I want to conditinally set the
workflow_state in a Submission based on some condition.
In the current version of Canvas, I would write:
```
workflow_state = "graded" if something_is_true?
```
With the new code, I can instead write
```
workflow_state =
Submission.workflow_states.graded if something_is_true?
```
While the syntax is longer, we can avoid mistyping the
desired workflow_state string. Additionally, we can
begin to DRY up references to workflow_state values
Test Plan
- Pick an ActiveRecord model (like Submission)
- Call the new .workflow_states class method
- Validate each valid workflow_state for the chosen
model is represented in the returned OpenStruct
Change-Id: Ieeabcbb9956808a963f1c4a5e0c67d1082a36015
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/290181
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Stephen Kacsmark <skacsmark@instructure.com>
QA-Review: Jared Crystal <jcrystal@instructure.com>
Reviewed-by: Ricardo Oliveira <ricardo.oliveira@instructure.com>
Reviewed-by: Dustin Cowles <dustin.cowles@instructure.com>
Reviewed-by: Alex Slaughter <aslaughter@instructure.com>
User content with deeply nested html elements couldn't be parsed by
Nokogiri when the depth exceeded the DEFAULT_MAX_TREE_DEPTH of 400.
The depth limit has already been increased in other places (quizzes,
wiki pages), so we'll do the same for syllabus content to prevent making
the entire syllabus inaccessible if deeply nested content is saved. This
change also prevents content that can't be parsed from being saved in
the syllabus.
fixes LS-3114
flag = none
Test plan:
- Get my document with deeply-nested html and save the content to a
course's syllabus_body in a rails console
- Go to that course's syllabus in the UI
- Expect the page to load fine
- Lower the max_tree_depth constant in
gems/canvas_sanitize/lib/canvas_sanitize/canvas_sanitize.rb (L75) to 1
- Restart rails server
- In a new course, go to the syllabus and in the html editor, paste
<div><div><p>hi</p></div></div>
- Click save and expect to get a 4xx response
Change-Id: Ib97ab86c102162f8efdc29c1122e0aa6d9801026
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/289992
Reviewed-by: Eric Saupe <eric.saupe@instructure.com>
QA-Review: Eric Saupe <eric.saupe@instructure.com>
Product-Review: Jackson Howe <jackson.howe@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
closes OUT-5025
flag=none
Test Plan:
- Navigate to Admin > Settings
- Click on the "?" button right next to the Outcome Export
- Observe that there is a new column called friendly_description
- Observe that there is the expected content in each of the rows
Change-Id: I6e9b736c477a8922f120cb5d5f97078173d5c278
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/288402
Reviewed-by: Angela Gomba <angela.gomba@instructure.com>
Reviewed-by: Chrystal Langston <chrystal.langston@instructure.com>
QA-Review: Chrystal Langston <chrystal.langston@instructure.com>
Product-Review: Ben Friedman <ben.friedman@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
fixes MAT-620
flag=none
test plan:
- Create a new quiz
- Add a multiple answer question
- On answer body, add a formula using Equation Editor
- Save quiz
- Take quiz as a student
- Open Quiz Statistics (in Quiz page)
> Verify that the answer you added shows the formula
correctly
Note: I needed to remove the strip_tags calls because it
clears all HTML code to an empty string. This method is
used for word count and converting HTML to plain text.
Due we have only html code (p, img) and no words, it
returns empty.
Current example HTML:
<p><img class=\"equation_image\" title=\"f\"
src=\"/equation_images/f?scale=1\" alt=\"LaTeX: f\"
data-equation-content=\"f\" data-ignore-a11y-check=\"\"></p>
Current example output : ""
So nothing to do here. Also answer body is not "converted"
in othernsites (e.g. Quiz page preview) so I'm keeping
the same way we handle question body in backend and
render in frontend.
Change-Id: I0916bc38e388ef0e182f2d529ce57f6bf964ba1b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/287963
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Joe Hernandez <joe.hernandez@instructure.com>
QA-Review: Joe Hernandez <joe.hernandez@instructure.com>
Product-Review: Juan Chavez <juan.chavez@instructure.com>
refs DE-523
Test Plan
1. Ensure CANVAS_RAILS override works
2. Ensure file override works
3. Ensure consul override works
Change-Id: I6eea63bba5c401428c02179a3d6187c8265ce33e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/287849
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
refs FOO-2696
flag = none
this new extractor is tailored for ES modules away from the previous AMD
implementation. It will be put to use once we add support for the
useScope interface in @canvas/i18n and adjust webpack/source files to
use it.
This is how i18n extraction works for ESM:
(1) import the "useScope" function from @canvas/i18n
import { useScope } from '@canvas/i18n'
import { useScope as useI18nScope } from '@canvas/i18n' // ALSO OK
(2) use that function to define your I18n receiver and supply a scope:
const I18n = useScope('foo')
(3) proceed to call I18n.t or I18n.translate as usual:
I18n.t('my_key', 'Hello') // => foo.my_key
the implementation required an upstream change to i18nliner-js; see
4040b1c979
~ test plan ~
---- ----
- read through the extractor code and rely on the tests since it's not
wired yet
Change-Id: I5c1ff0c23983c0e61a649c9fb3f4673724d6e468
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/286652
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
QA-Review: Ahmad Amireh <ahmad@instructure.com>
[skip-crystalball]
closes LS-1734
flag=none
test plan:
- upload a webp image from the Files page
> expect it to work like all other images
> expect to be able to preview it
- upload a webp image from the RCE's image upload dialog
> expect it to get embedded in the RCE
- open the course images tray
> expect it to be there, with a thumbnail
> expect to be able to adjust its size using the image options tray
Change-Id: I621a3f5fc455bc3aaf19928a5cfa7931a1694277
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/286027
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Robin Kuss <rkuss@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
This warning was for an upgrade that took place in Feb 2021
flag=none
Test-plan:
- Navigate to SiteAdmin > Plugins > Academic Benchmark Importer
- In the dropdown select a few different options
- Select |Create Config| to make sure the whole form is present
- Verify the red text with "The importer will be migrating from API
v3 to v4.1. Credentials will not change...." is NOT present
Change-Id: I31d3a6f7c0f226d42b5b00bda74ef5d9f935fece
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/286413
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Kyle Rosenbaum <krosenbaum@instructure.com>
QA-Review: Martin Yosifov <martin.yosifov@instructure.com>
Product-Review: Ben Friedman <ben.friedman@instructure.com>
- currently we swap back to :report db even if upstream
we timed out from using it and are using :secondary.
Result is missed data in the output report.
flag = none
test plan: This is tricky to test as it is a race
condition between primary and report db and requires
report db to timeout on being up to date. For now,
just verify specs pass and monitor if empty reports
continue to happen in prod.
Change-Id: I92f0024593cd497949747378b8c8792e4cc047b3
refs: PFS-18941
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/286338
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Matt Maruri <mmaruri@instructure.com>
QA-Review: Mark Valentine <mvalentine@instructure.com>
Product-Review: Mark Valentine <mvalentine@instructure.com>
refs INTEROP-7087
flag=lti_platform_storage
why:
* signals to tools that Canvas supports a cookie-less launch process and
is listening for postMessages on the window designated by this param
* default value is `_parent`, which means tools should send postMessages
to `window.parent || window.opener`
* can be set to something else, in which case the tool should expect
to have a sibling frame named with this value, to which it should send
postMessages - not implemented yet since there are some kinks, so always
send `_parent`
* there are other specs that check for this list of params
in a login request - once the flag is flipped on for good,
these specs will fail and will need to be changed then
test plan:
* open the Network tab of the browser dev tools
* launch an LTI 1.3 tool
* in the login request (for the 1.3 test tool it's a POST to `/login`)
look for the lti_storage_target param - it should *not* be there
* enable the lti_platform_storage feature flag
* you may need to restart the web container and/or clear cache using
`GuardRail.activate(:deploy) { Rails.cache.clear }` to get
the flag enabling to stick
* launch an LTI 1.3 tool
* in the login request, lti_storage_target should be present in the form
data and set to `_parent`
Change-Id: Ic7539d3fdc381857c435cf7fb77f0a87ffc7c605
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274516
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
Product-Review: Xander Moffatt <xmoffatt@instructure.com>
refs DE-1022
There have been reports of a memory regression caused by 1e8f45e ("use per-language instead of per-scope translation files"). This is indeed the case from the profiling steps below.
```
apt update && apt install -y time
rm -rf public/javascripts/translations/* && bundle exec rake i18n:generate_js
for run in {1..5}; do
rm -rf node_modules/.cache/* && rm -rf public/dist/webpack-dev/*
(/usr/bin/time -v yarn run webpack-development) 2>&1 >/dev/null | grep "Maximum resident set size"
done
```
Before 1e8f45e:
Maximum resident set size (kbytes): 3785704
Maximum resident set size (kbytes): 3991196
Maximum resident set size (kbytes): 3894452
Maximum resident set size (kbytes): 3858516
Maximum resident set size (kbytes): 3768916
After 1e8f45e:
Maximum resident set size (kbytes): 4556988
Maximum resident set size (kbytes): 4711868
Maximum resident set size (kbytes): 4862212
Maximum resident set size (kbytes): 4763156
Maximum resident set size (kbytes): 4803300
With this change, the memory usage drops to below the previous value, which would be expected from this change.
Maximum resident set size (kbytes): 3627176
Maximum resident set size (kbytes): 3608840
Maximum resident set size (kbytes): 3961552
Maximum resident set size (kbytes): 3887148
Maximum resident set size (kbytes): 3863004
The root cause appears to be that webpack is using a significant amount of memory to translate the many setLazyTranslation calls for each scope.
For the quick fix, we choose to do the fastest fix of wrapping these calls in an IIFE. A longer term fix would be to re-write the mergeI18nTranslations API to require only one call. This is work already scheduled for this project that will be handled later as it requires consensus and testing on different file formats.
Additionally, we could also convert the file to a JSON file, but we would lose the ability to lazy load each translation scope, and would require further performance testing. If we chose to do that work, we may be able to have a memory usage like:
Maximum resident set size (kbytes): 3285508
Change-Id: I827643a6706c163ab9b0f2a8a597c4d668c36e32
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/285584
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
closes OUT-4933
flag=none
test-plan:
- create two outcomes at the account level
- create a friendly description for one outcome at
the account level (I did this through the rails
console)
- go to settings > reports and run a report for
the outcome export
- observe the report contains a friendly
description header
- observe outcomes with no friendly descriptions
are blank
- observe outcomes with friendly descriptions
include those friendly descriptions
- import outcomes with a friendly description to
a sub-account
- run an outcome export report from the sub-
account and observe there's a friendly
description from the account-level
- edit one of the friendly descriptions in the
sub-account
- run an outcome export report from the sub-
account and observe that the friendly
description created at the sub-account level is
present
Change-Id: I8c577a0220ad12ccc2d6d632a20dd670b699243a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/284892
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Martin Yosifov <martin.yosifov@instructure.com>
QA-Review: Martin Yosifov <martin.yosifov@instructure.com>
Product-Review: Ben Friedman <ben.friedman@instructure.com>
refs FOO-2720
refs DE-1022
Currently, translations are compiled on a per-scope level. The primary problem by doing this is that each generated scope file contains the translations for all languages, leading users to needing to download translations for languages they will never use.
Instead, we now generate a single translations file per language. This file is loaded and cached by the browser at the beginning of page load.
[change-merged]
[build-registry-path=jenkins/canvas-lms/de-1022]
Change-Id: I64b0d054b04e3d81bb7263650481d1d3fe9a4868
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/284285
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
QA-Review: Ahmad Amireh <ahmad@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
refs FOO-2720
flag = none
Short version: the "_core_en.js" file is no longer loaded in production
as its contents have been merged (there) with the super "core.js" file,
which is targeted for removal later in this series.
Change-Id: I05eb76a2f1cac12b4ab953bad0ca5a49b6ffd37b
---
The problem as I understand it: there are certain phrases that are
marked as "core" because they are used by shared/logic code like
DateTime formatters and are pre-defined in config/locales.yml. These
phrases were being supplied in two distinct files:
- _core_en.js, which includes only the phrases for the "en" language
- _core.js, which includes the phrases for the rest of the supported
locales
_core_en was split because it was deemed necessary to be loaded always,
regardless of the active locale, and that is - as it appears to me, at
least - because some code attempts to look up those phrases at the
time their modules are evaluated. This patch corrects those modules to
defer their lookups until the point where the translations are used,
and when the translations have become available -- just like the rest of
the codebase does.
But if this is true, this begs the question, how come those modules
weren't presenting bugs by using translations for "en" and not for the
target locale? My thinking is that it is only coincidental that they
weren't: should _any_ module that uses I18n be evaluated _before_ any of
those modules, the Webpack plugin will have already loaded the "core"
file, which includes the translations for those phrases in the target
locale. _core_en may not have been loaded by then, but that doesn't
matter because the resolver is gonna look for what's in _core first when
it's available, and it is.
---
What happens in this patch is a slight change to prepare for the full
removal of both _core and _core_en: _core_en is now loaded only in
builds that don't load actual translations because we need the default
values that that file provides. The alternative would've been to go to
each call-site that looks up the phrases provided in _core_en and have
them supply default values, but it's untenable at this point.
This is the list of call-sites and the phrases they look up:
ui/features/calendar/jquery/index.js: time.formats.tiny_on_the_hour
ui/features/quiz_statistics/util/parse_number.js: number.format.delimiter
ui/features/quiz_statistics/util/parse_number.js: number.format.separator
ui/shared/day-substitution/backbone/views/DaySubstitutionView.coffee: date.day_names
ui/shared/syllabus/jquery/calendar_move.js: date.month_names
ui/shared/datetime/jquery/DatetimeField.js: date.formats.medium
ui/shared/datetime/jquery/DatetimeField.js: date.abbr_month_names
ui/shared/datetime/jquery/DatetimeField.js: date.day_names
ui/shared/datetime/jquery/DatetimeField.js: date.abbr_day_names
ui/shared/datetime/jquery/DatetimeField.js: date.datepicker.column_headings
ui/shared/datetime/react/components/render-datepicker-time.js: datepicker.titles.hour
ui/shared/datetime/react/components/render-datepicker-time.js: datepicker.titles.minute
ui/shared/datetime/react/components/render-datepicker-time.js: datepicker.titles.am_pm
ui/shared/handlebars-helpers/dateSelect.js: date.order
ui/shared/handlebars-helpers/dateSelect.js: date.*
ui/shared/i18n/i18nObj.js: number.format
ui/shared/i18n/numberHelper.js: number.format.delimiter
ui/shared/i18n/numberHelper.js: number.format.separator
dateSelect.js is the gnarly one because it seems to be passing through
everything under date.* to God knows who.
The list above was generated with a command similar to this:
grep -rnP "I18n.(t|lookup)\(['\"](date|datetime|number|support|time)\S" ui
---
~ test plan ~
~~~~ ~~~~
- you can still activate a different locale and use something like the
datepicker to normal effect
[change-merged]
[build-registry-path=jenkins/canvas-lms/foo-2720-01]
Change-Id: Ifd5d2d888edc9b89a9930824f2c55fd9c275b03f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/284102
QA-Review: Ahmad Amireh <ahmad@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
This change causes `db.redis.command` spans to be recorded by Sentry when
APM is enabled. It also makes slight improvements to the Sentry
initializer.
flag=none
closes DE-1055
test plan:
- verify that Sentry and Canvas initialize OK, and both errors and APM
transactions are recorded OK
- verify that controllers which interface with Redis record spans in
their APM transactions
- verify that Redis commands are not recorded as breadcrumbs (we did not
enable this feature)
Change-Id: I7955b3ad5d6b59e6fd96c801881671814064d622
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/285255
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Isaac Moore <isaac.moore@instructure.com>
Product-Review: Isaac Moore <isaac.moore@instructure.com>
refs FOO-2720
flag = none
Short version: the "_core_en.js" file is no longer loaded in production
as its contents have been merged (there) with the super "core.js" file,
which is targeted for removal later in this series.
Change-Id: If97f75066aea32dd74c3899db7aec8fcf4cd93db
---
The problem as I understand it: there are certain phrases that are
marked as "core" because they are used by shared/logic code like
DateTime formatters and are pre-defined in config/locales.yml. These
phrases were being supplied in two distinct files:
- _core_en.js, which includes only the phrases for the "en" language
- _core.js, which includes the phrases for the rest of the supported
locales
_core_en was split because it was deemed necessary to be loaded always,
regardless of the active locale, and that is - as it appears to me, at
least - because some code attempts to look up those phrases at the
time their modules are evaluated. This patch corrects those modules to
defer their lookups until the point where the translations are used,
and when the translations have become available -- just like the rest of
the codebase does.
But if this is true, this begs the question, how come those modules
weren't presenting bugs by using translations for "en" and not for the
target locale? My thinking is that it is only coincidental that they
weren't: should _any_ module that uses I18n be evaluated _before_ any of
those modules, the Webpack plugin will have already loaded the "core"
file, which includes the translations for those phrases in the target
locale. _core_en may not have been loaded by then, but that doesn't
matter because the resolver is gonna look for what's in _core first when
it's available, and it is.
---
What happens in this patch is a slight change to prepare for the full
removal of both _core and _core_en: _core_en is now loaded only in
builds that don't load actual translations because we need the default
values that that file provides. The alternative would've been to go to
each call-site that looks up the phrases provided in _core_en and have
them supply default values, but it's untenable at this point.
This is the list of call-sites and the phrases they look up:
ui/features/calendar/jquery/index.js: time.formats.tiny_on_the_hour
ui/features/quiz_statistics/util/parse_number.js: number.format.delimiter
ui/features/quiz_statistics/util/parse_number.js: number.format.separator
ui/shared/day-substitution/backbone/views/DaySubstitutionView.coffee: date.day_names
ui/shared/syllabus/jquery/calendar_move.js: date.month_names
ui/shared/datetime/jquery/DatetimeField.js: date.formats.medium
ui/shared/datetime/jquery/DatetimeField.js: date.abbr_month_names
ui/shared/datetime/jquery/DatetimeField.js: date.day_names
ui/shared/datetime/jquery/DatetimeField.js: date.abbr_day_names
ui/shared/datetime/jquery/DatetimeField.js: date.datepicker.column_headings
ui/shared/datetime/react/components/render-datepicker-time.js: datepicker.titles.hour
ui/shared/datetime/react/components/render-datepicker-time.js: datepicker.titles.minute
ui/shared/datetime/react/components/render-datepicker-time.js: datepicker.titles.am_pm
ui/shared/handlebars-helpers/dateSelect.js: date.order
ui/shared/handlebars-helpers/dateSelect.js: date.*
ui/shared/i18n/i18nObj.js: number.format
ui/shared/i18n/numberHelper.js: number.format.delimiter
ui/shared/i18n/numberHelper.js: number.format.separator
dateSelect.js is the gnarly one because it seems to be passing through
everything under date.* to God knows who.
The list above was generated with a command similar to this:
grep -rnP "I18n.(t|lookup)\(['\"](date|datetime|number|support|time)\S" ui
---
~ test plan ~
~~~~ ~~~~
- you can still activate a different locale and use something like the
datepicker to normal effect
Change-Id: I12ff180da35dcf916137818ab91296dab469f3c0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/284582
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Ahmad Amireh <ahmad@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>
This change adds Sentry's distributed trace ID to the `X-Canvas-Meta`
response header, so that it may be ingested by the logging pipeline and
accessed downstream.
flag=none
refs DE-1032
test plan:
- with Sentry initialized with a valid DSN, verify that the
`X-Canvas-Meta` header contains a `st` value containing the Sentry
trace ID
- verify that the trace ID present in the response header matches the one
in the `meta` tag inside the body's `<head>`
- verify that when Sentry is not initialized with a valid DSN, the value
is omitted from the response header, and the app still renders
responses correctly
Change-Id: I63580b4d5057cebf55e6a4fdbc628d58ed7973f7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/284991
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
This reverts commit b9d45dbc1d.
Reason for revert: breaks prod database.yml because of the to_prepare
Change-Id: I3db4c5cbad77168ede014f9924049f458f05cb3f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/284097
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
Product-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
qti_migration_tool decided that object ids need to start with a
letter or underscore and are not allowed to start with a digit.
this isn't consistent with non-QTI packages and it can cause
imported quizzes to lose their Canvas metadata (including the
quiz description and due dates)
the fix is in qti_migration_tool but some Canvas specs need to
be adjusted to match the new behavior
test plan: specs
flag=none
refs LS-2980
[pin-commit-qti_migration_tool=fed7c13a5b0cd54a2d43a1085e365b93b9243ac5]
Change-Id: I902c265f200637dfeb45961d94b5e2102f733c6b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/284571
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Eric Saupe <eric.saupe@instructure.com>
QA-Review: Eric Saupe <eric.saupe@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
fixes LS-2897
flag=none
test plan:
- Have the INST-FS plugin ON
- Have a canvas export package with at least one file
- Import the export package into a fresh course
- Import the same export package again.
- Check that the file wasn't duplicated
- (You could, after the first import, alter the
attachment md5 column and put it's sha512 there,
then theorically you'd be testing this, but Ideally
you want instfs ON)
Change-Id: I0de79032d2ccd64e51cc09dea61b410aad43756f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/282779
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Robin Kuss <rkuss@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Luis Oliveira <luis.oliveira@instructure.com>
why:
* to see if this is a problem, since events sent out without a context
will pose a problem to live events consumers
refs INTEROP-7187
flag=none
test plan:
* follow the instructions in doc/live_events.md to set up live events
and print them to stdout logs
* follow the instructions in doc/lti_manual/11_testing.md under
`Stubbing Statsd Calls` to monkey-patch Statsd for easy metric viewing
* (a good place to put that is in the ApplicationController)
* comment out the call to `LiveEvents.set_context` in the
ApplicationController
* trigger any live event - navigating through course pages should be
enough, though creating an assignment is always a good one
* for every event triggered there should be a Statsd call for
`missing_context`
* add back the call to `set_context`
* trigger more live events
* the Statsd calls should not continue
Change-Id: Ib87952e208885ef15b00561731769f808cdcd066
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/284053
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Tucker Mcknight <tmcknight@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
Product-Review: Xander Moffatt <xmoffatt@instructure.com>
test plan:
- create a migration and stage it for commit (no need to
actually commit or run it) that creates a new table
- start without having a root_account_id column or a
replica identity index
- run script/rlint and it should complain that you need
a root_account reference and a replica identity index
and provide example lines for both
- if you create the root_account_id column in any of the
following less-desired ways, it should point out your
error and give you an example of what the line should
look like:
- `t.bigint :root_account_id` instead of
't.references :root_account`
- missing `{ foreign_key: { to_table: :accounts} }`
- missing `index` option or `index` option other than
`index: false` (the replica identity index is
generally sufficient)
- missing `null: false`
(if multiple deficiencies exist, it'll only log one;
it's not possible for one cop to log multiple errors
per line, but it will give an example that checks all
the boxes so following that should avoid back-and-forth)
- create more than one table in the migration and verify
that it detects which table(s) is/are missing the
`add_replica_identity` call
flag=none
closes DE-951
Change-Id: I582608c8792767c2b51f69d90afd777e3c7a0981
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/283076
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Isaac Moore <isaac.moore@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Fixes INTEROP-7269
flag=none
The problem was introduced in
https://gerrit.instructure.com/c/canvas-lms/+/275160 which added a UUID,
to the KID. If the UUID happens to have something that looks like a
date, Time.zone.parse picks that up and doesn't return the date in the
first part of the kid. For example:
> Time.parse "2022-01-25T17:46:59Z_d2fe13a4-b3f7-4feb-9"
=> -0009-02-04 17:46:59 UTC
This resulted in a flaky spec. It could also cause rotate_keys to rotate
keys multiple times on the first of the month (which can happen but
we're not sure why, see 89941a1d). It could also cause the keys to not
rotate (if the timestamp is in the future):
> Time.zone.parse "2022-01-25T17:46:59Z_2feb2023-aaaa-aaaa-a"
=> Thu, 02 Feb 2023 17:46:59 UTC +00:00
Test plan:
- run Lti::KeyStorage.retrieve_keys to see the keys; then Lti::KeyStorage.rotate_keys
- retrieve keys again to see they rotated
- run rotate_keys again and make sure they haven't rotated
- class << Lti::KeyStorage; def min_rotation_period; 10.seconds; end; end
- run rotate_keys again and make sure they've rotated
- class << SecureRandom; def uuid; "2feb2023-aaaa-aaaa-a"; end; end
- run rotate_keys again and make sure they only rotate 10 seconds after
the last time and that the kid includes that string
Change-Id: Ia67cafe3d04a650d8c6735835bb170b8dc8980ee
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/283562
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Evan Battaglia <ebattaglia@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
test plan:
- create a migration that adds an integer column whose name
ends in "_id" and stage it for commit (no need to actually
run the migration)
- `script/rlint` should warn you to use bigint types for
id columns
- using type `:integer` with `limit: 8` is acceptable
as is using type `:bigint`
- no complaints are issued in `down`
flag=none
closes DE-953
Change-Id: Ifd1f4ff1cc74368b99ac2eda42181bcec25b94c8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/282668
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Isaac Moore <isaac.moore@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
per our migration guidelines, tables, columns, and indexes
should be created in predeploy migrations
test plan:
- create a migration and stage it for commit (no need to
actually commit it or run it) and ensure `script/rlint`
flags issues for a postdeploy migration that:
(1) tries to `create_table`
(I don't bother flagging all the index or column
creation inside this block, since the table is enough)
(2) tries to create columns or indexes inside `change_table`
(e.g., with `t.index`, `t.text`, `t.boolean` etc.)
(2a) a postdeploy migration that uses a change_table
block to remove columns or indexes is ok
(3) tries to `add_column`
(4) tries to `add_index`
(5) tries to `add_reference`
- the above things should not be errors in a predeploy migration
and should not be flagged if they appear in `down` regardless
flag=none
closes DE-949
Change-Id: I209f44289f3a21f80d3d1c063600c009fc406d7c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/282588
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Isaac Moore <isaac.moore@instructure.com>
test plan: a call to DataFixup::(Something).run should be flagged
unless the migration is tagged :postdeploy
flag=none
closes DE-948
Change-Id: I5c1deb43267f00d4a042bb3bae9db906a2e3673a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/282570
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Isaac Moore <isaac.moore@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
per our migration best practices, boolean columns should have
a default value and should not be nullable
test plan:
- create a migration that adds new boolean columns and stage it
for commit (no need to actually commit run the migration)
- run script/rlint and you should be warned if your column
does not have a default type or is nullable
- test various ways of doing this:
- with `add_column`
- with `t.boolean` in a `create_table` or `change_table` block
- with `t.column :foo, :boolean` in one of those blocks
- try both the :boolean and :bool spellings (the latter isn't
documented but is used in a few places anyway)
flag=none
refs DE-948
Change-Id: I305d2d146c1cca8fae80532416e0b8d5ded7e5c2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/282302
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Isaac Moore <isaac.moore@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
This reverts commit 7dd287adea.
Reason for revert: try again
Change-Id: Ie0eededa8465a7fb79bbd221c777646ab2640fa7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/282036
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>
test plan:
- create a database migration and add it to a commit
(no need to push the commit or run the migration))
that tries to add a not-null constraint to a column. e.g.
change_column_null :table, :column, false
- run script/rlint
- you should be warned to use `disable_ddl_transaction!` if
this is not present in the migration class definition
- you should be warned to use DataFixup::BackfillNulls to
backfill null values if this is not present
(note that the linter can't actually tell if your arguments
to BackfillNulls are correct, because it takes an AR class name
instead of a table name and the cop has no way of linking
the two, and also the arguments are dynamic in many places;
it's just looking for the presence of that call)
closes DE-944
Change-Id: I8b79f8d0a44ae1bbf8de86c1a7e89c50cfe2b702
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/282137
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Isaac Moore <isaac.moore@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
which is nicer because
(1) that's where the `disable_ddl_transaction!` needs to be, and
(2) the message doesn't preempt the `algorithm: :concurrently` note
test plan:
- add a migration to a commit (no need to actually run it or push
the commit) that adds an index to an existing table, and does
not use `algorithm: :concurrently` or `disable_ddl_transaction!`
- run script/rlint and you should see both warnings
(the transaction one at the top, under the class, and the
algorithm one on the index line)
flag=none
refs DE-945
Change-Id: Ibfc55b26387d3520c2de9fde5491869a9033b2c5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/282461
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Isaac Moore <isaac.moore@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
test plan:
- create a commit containing a migration that adds an index
to a table with add_index (no need to actually run the migration
or push the commit)
- run script/rlint and verify:
1. it wants `disable_ddl_transaction!` in the migration class
2. it wants `algorithm: :concurrently` in the index line
3. it doesn't care about 1 and 2 if the table was also created
in the same migration
- repeat with `add_reference` instead of `add_index`, except for
part 2, the option is spelled `index: { algorithm: :concurrently }`
and if you put `index: false` it doesn't complain (but it still
does if you put `index: true` or omit the option, as it defaults
to true)
- repeat with a `change_table` block using `t.index`,
e.g. `t.index [:columns], algorithm: :concurrently` is fine,
without the option results in the warning. (but note that
inside `create_table` the option is not needed!)
- repeat with a `change_table` block using `t.references`
(as with `add_reference`, `index: false` is fine, as is
`index: { algorithm: :concurrently }`, but `index: true`
or no `index` option result in the warning.)
flag=none
closes DE-945
Change-Id: If95ce2d930bdf41d0bc863a065f2447ec01d2271
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/282227
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Isaac Moore <isaac.moore@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
test plan:
- create a migration that renames a table and `git add` it
(no need to actually run the migration or push the commit)
- run script/rlint
- it should tell you that renaming a table requires a multi-
deploy process and link you to our migration best practices page
- if your migration uses the process from that page and drops a view
before renaming the table, no warning is issued
- it doesn't warn you about the `down` half of the above pattern
flag=none
closes DE-947
Change-Id: Ic19807af210940df60e8b72952db297d71ac7dfa
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/282292
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Isaac Moore <isaac.moore@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
This commit replaces `sentry-raven` with the more modern Sentry SDKs.
Settings related to this change:
- `sentry_disabled`: completely disables Sentry, in case anything goes
sideways (defaults to `false`)
refs DE-922
flag=none
test plan:
- make sure to check out the correct patchset in the
`gems/plugins/uuid_provisioner` directory (see the tag below for ref)
- create a new project in Sentry (it may be easiest to set up Sentry to
run locally; check out `getsentry/onpremise` on GitHub for setup
details; it's not too onerous. note that you will need to add
`VIRTUAL_HOST` and `VIRTUAL_PORT` to the `nginx` container in that
`docker-compose.yml` in order to have your Sentry accessible via Dory
at `sentry.docker`)
- configure `config/sentry.rb` with your DSN
- restart rails and job servers
- confirm that, by default:
- any errors raised in controllers appear in the "Issues" section
- any errors raised in jobs appear in the "Issues" section
- user context associated with issues includes user IP and global ID
- job issues contain context from the job under the "INST-JOBS" section
- set `sentry_disabled` setting to true and restart rails/jobs servers
- confirm that the app/jobs start fine and there are no issues
- also confirm that Sentry is disabled (no errors received)
- remove `config/sentry.yml` and restart rails and jobs servers
- confirm that the app/jobs start fine and there are no issues
[pin-commit-uuid_provisioner=735c2102fb0020ac5aa80734a323bf08322d002d]
Change-Id: Id0fa4b4ee57ab812cd75d21d2e8ab5e21177af1a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279454
Reviewed-by: Ben Rinaca <brinaca@instructure.com>
QA-Review: Isaac Moore <isaac.moore@instructure.com>
Product-Review: Isaac Moore <isaac.moore@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
This reverts commit 276eb49f8e.
Reason for revert: Something in here is failing deploys
Change-Id: I615a90e6a4edf743ba47a2673bc14483ad141b3d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/282032
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
Tested-by: James Butters <jbutters@instructure.com>
run rspecq/rspec tests in separate sub-build.
flag = none
refs: DE-929
Test Plan:
-Jenkins passes
-test count is consistent
Change-Id: Ia62730c32d1793d591555c0fd034538254efffc3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/282016
Reviewed-by: Aaron Ogata <aogata@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>
test plan:
- create a migration that changes a column data type
using change_column (no need to run it)
- `git add` the migration file (no need to actually
commit it)
- run script/rlint and it should tell you that
changing a column type usually requires a multi-
deploy process and link you to our best practices
document
- repeat with `rename_column` and the same warning
should appear
flag=none
closes DE-943
closes DE-946
Change-Id: I21b4c4296441cfe5e7252827341ac4e48a2eec7f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/281349
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Isaac Moore <isaac.moore@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
test plan:
- create a migration and add it to a commit (no need to actually
run the migration or push the commit) that performs raw SQL
via `execute` or `connection.execute`
- run `script/rlint` and you should see an "info" message that
raw SQL in migrations must be approved by a migration reviewer
flag=none
closes DE-941
Change-Id: Icfddda67f134aee9922d22c8c092836da09fc29d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/280808
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Isaac Moore <isaac.moore@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
test plan:
- create a migration (locally) and add it to a commit
(no need to actually commit, push, or even run the migration)
that adds a foreign key to an existing table, e.g.
add_foreign_key :users, :eportfolios
- run script/rlint, and it should complain that you should
use a non-transactional migration and add `delay_validation: true`
to the arguments
- do those things, run script/rlint again, and it should not
complain
- add a foreign key to a table created in the same migration,
e.g.
create_table :foo do |t|
end
add_foreign_key :foo, :bar
- run script/rlint again, and it shouldn't complain
flag=none
closes DE-940
Change-Id: I3f235cbf1ff4011e20d74bdaa8953b857c7e330a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/280514
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Isaac Moore <isaac.moore@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
test plan:
- an `info` message should be logged when a column is removed
reminding the engineer to use ignored_columns
- the message doesn't occur in `down`
flag=none
closes DE-942
Change-Id: If46c2d325f2e2d3b32964f23fed1ba25520efabd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/280381
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
since planned cops may provide different severity levels
depending on circumstances
refs DE-942
flag = none
Change-Id: I7501c13ea350241c47debceb7440cc8ce3d43925
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/280532
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
migrations that disable the DDL transaction should use if_not_exists
when adding a reference to a table
test plan: specs
closes DE-935
Change-Id: I3ccb9786446995c22c9cf2b8b1fa9da9e24e184e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/280182
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Added in the "resource_link_id" migration parameter for resource link
launches. This parameter is included when the LTI 1.3 resource_link_uuid
is different than the LTI 1.1 lti_context_id. It helps tools migrating
from 1.1 to 1.3 map old ids in their databases to the new ids.
flag=none
closes INTEROP-6796
test-plan:
* Install an LTI 1.1 tool and create an assignment that launches that
tool, then launch it. Note the resource_link_uuid that is provided. It
should look like a hash, not a UUID. Xander likely knows of a good LTI
1.1 tool that would work for testing, or a way to make the 1.3 tool
work for this.
* Install the LTI 1.3 Test Tool in at least the assignment submission
and course menu placement. I'm lazy, so I have it installed everywhere :)
* Migrate your previous LTI 1.1 assignment to use the LTI 1.3 Test Tool.
You can do this by updating the assignment's external_tool_tag.url to
the launch url of the LTI 1.3 Test Tool which is typically
http://lti13testtool.docker/launch.
* Launch the assignment. You should see under the
"https://purl.imsglobal.org/spec/lti/claim/lti1p1" a value for
resource_link_id. This should match the hash you saw earlier when you
launched the 1.1 tool.
* Now for some monkey-patching :). Place a byebug breakpoint at the
beginning of the include_lti1p1_claims? method in
lib/lti/messages/resource_link_request.rb. Then, launch the 1.3 tool
from the assignment. When you hit the breakpoint, monkey-patch
Assignment with the following code:
class Assignment < ActiveRecord::Base
def lti_resource_link_id
primary_resource_link.resource_link_uuid
end
end
This makes sure that the code thinks that the LTI 1.1 and 1.3
resource_link_ids are the same, even though that can basically
never happen in real life. This way though, we know that only
include the claim when we absolutely need to.
Continue the launch after monkey-patching and you should see there is
no resource_link_id claim in the lti1p1 claims section.
* Launch the tool from the course menu and make sure that you *don't*
see a key-value pair for resource_link_id. It should only be included
on assignment launches.
Change-Id: I85bbd977f4aa0809b2b031492bf58c0c86fea4bc
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275459
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Ryan Hawkins <ryan.hawkins@instructure.com>
[skip-stages=Flakey]
manual, mostly by fixing copy/paste name problems,
combining groups that didn't need separating, or creating
new groups to contain contiguous top level groups that can't
be combined due to having different setup
Change-Id: I5b21664eabd8c3a62e22c09a28ba8bf519371aa5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279428
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>
means we can remove a whole bunch of specific cop configurations that
now inherit the proper settings. cops that still have violations need
to be explicitly named to make them not error. this means that the
list of remaining cops is explicitly in our config now. also combined
the don't-auto-correct lists with the not-yet-fixed lists, so that
it's only a "permanent" section and a "todo" section
the final computed configuration is unchanged by this commit, with one
exception - Bundler/OrderedGems was moved to the Gemfile.d/.rubocop.yml
override, and some of the internal gems violated that so their
gemfiles have been autocorrected
Change-Id: I100884a96dbe9eb9d4bfc0692663c271daa9de16
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279413
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>
we're far enough along that the generated disablings are no longer useful
Change-Id: Iec341384f7a5f6eeb42bad4ae1ea12f433d270a4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279397
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]
auto-corrected with post review ensuring line breaks continue to
convey original meaning of separated conditions, and cleaning up
some now-duplicated conditions
Change-Id: Ib9b31226de0665a2e4427fe595639d0d91a33f83
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279151
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]
auto-corrected, with post review looking for opportunities to convert
to heredocs
Change-Id: Ic163882ebb5f4d2d28b5e5fd65188781d8eef3c8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279287
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>