Commit Graph

2202 Commits

Author SHA1 Message Date
Isaac Moore bfaff1d6fa Add internal CA upload to LDAP authentication providers
This will allow an admin to specify an internal CA that they would like to
trust when connecting to their configured LDAP instance. It also allows
an admin to explicitly opt in to TLS certificate verification prior to our
enforcement date.

closes AE-180
flag=none

test plan:
- with the `verify_ldap_certs` flag disabled:
  - verify LDAP connections succeed with bad certs
  - upload a CA certificate
  - verify LDAP connections still succeed with bad certs
  - define the `ldap_validate_tls_cert_enforcement_date` setting
    - verify the "Verify TLS Certificate" checkbox is visible, and
      editable
    - verify the help text appears
    - enable the checkbox
    - verify connections fail with bad certs
    - verify connections succeed if the cert was issued by the uploaded CA
  - clear the `ldap_validate_tls_cert_enforcement_date` setting
    - verify the "Verify TLS Certificate" checkbox is hidden
- with the `verify_ldap_certs` flag enabled:
  - verify LDAP connections do not succeed with bad certs
  - upload a CA certificate
  - verify LDAP connections succeed if the cert was issued by the uploaded
    CA
  - define the `ldap_validate_tls_cert_enforcement_date` setting
    - verify the "Verify TLS Certificate" checkbox is on, but disabled
    - verify the help text is hidden
  - clear the `ldap_validate_tls_cert_enforcement_date` setting
    - verify the "Verify TLS Certificate" checkbox is hidden

Change-Id: I41536261bdc7e5554cbf5b9915638ced996192f3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/315294
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Isaac Moore <isaac.moore@instructure.com>
Product-Review: Isaac Moore <isaac.moore@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
2023-04-13 13:29:06 +00:00
Cody Cutrer 0fed7b7336 switch to native pg12 collation for ICU sorting
closes AE-81

test plan:
 * the people page for an account or course should load properly,
   and still sort properly (enforced by specs)

Change-Id: Id8f252af44b2fa4a31786c5c4b7fef9d2aad0946
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/314759
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-04-12 17:18:46 +00:00
Chawn Neal 039f84dd6d datafix fill root_account_ids ConversationMessageParticipant
fixes VICE-3384
flag = none

Test Plan:
1) you can run the loop locally,
 and for one cmp.
2) watch how it sets the cmp.root_account_ids

ex:
ConversationMessageParticipant.where('id > 10')
 .limit(5).update_all(root_account_ids: nil)

Change-Id: Ibdb580e0a8f016126da8a60d93298f52def9455e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/315024
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Omar Soto-Fortuño <omar.soto@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
2023-04-05 18:49:19 +00:00
Cody Cutrer cee05c4fee make ICU collation migrations non-conditional
Canvas already requires postgres 12+

refs AE-81

test plan: N/A

Change-Id: I54311b2426ebd2e0c23ff3f57247ff83a6e5595d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/314746
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>
Migration-Review: Alex Slaughter <aslaughter@instructure.com>
2023-04-03 17:53:26 +00:00
Jacob Burroughs 9a9fdf3a65 Remove auditor cassandra support
Also remove the engine experiment, because that never really went
anywhere for canvas and was just one more "different" thing

[fsc-max-nodes=15]
[fsc-timeout=45]

Change-Id: Ib990deb94bf5e25d587d554f64c535c9b96cce26
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/314469
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Build-Review: Aaron Ogata <aogata@instructure.com>
Migration-Review: Aaron Ogata <aogata@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
2023-04-03 15:40:22 +00:00
Jacob Burroughs 72176937d8 Add original query to guard_excessive_updates
Change-Id: Icfe5996c1509b647c445f29737064e85d99e50fd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/314675
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>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
2023-03-30 17:06:01 +00:00
Chris Soto 33a4510fef asv fix assignment visibility concluded student
previous asv fix for concluded students with completed_at after the
assignment due date was not working in cases where some teachers would
have valid assignments that were after the student's completed_at date.
a change has been made to the asv query to fix this issue. removed the
completed_at filter from the asv view and added a filter to the rails
code to only filter out these assignments if they were unsubmitted.

fixes EVAL-2857
flag=none

test plan:
* Pre-requisites: Migrations have been run, and a student enrolled in
two sections of the same course (A & B).

1. As the teacher, create one assignment in section A.
2. As the teacher, create three assignments in section B.
   - create one assignment with a due date in the past
   - create one assignment with a due date in the future that is not to
     be graded
   - create one assignment with a due date in the future that is to be
     graded
3. As the teacher, grade the future assignment in section B that is to
   be graded
4. As the student, view your assignments. User should see all
   assignments
5. As teacher, go to the user page for the
   student (courses/:course_id/users/:id), click 'more user details...',
   and then click on 'Conclude this Enrollment' for Section B
6. As the student, view your assignments. User should now see:
   - Assignment for Section A (still enrolled)
   - Assignment for Section B with due date in past
   - Assignment for Section B with due date in future that was graded
7. Verify the student cannot see the assignment for Section B that
   has the due date in the future and not graded.

Change-Id: I177e03806b4dedf586293d2657f343340a2de193
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/314273
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
Product-Review: Cameron Ray <cameron.ray@instructure.com>
2023-03-29 19:28:17 +00:00
Jackson Huang b23a932abe change default value for late policy missing submission deduction
Test plan
- After a course is created as a teacher go to
grades
- press the cog in the top right corder
- a grade submission late policies options should appear
- the default value should be 0

flag = none

Change-Id: I59ac048cae46642bd7822c0bac53c48283c2773b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/312346
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cameron Ray <cameron.ray@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
Product-Review: Sam Garza <sam.garza@instructure.com>
Migration-Review: Aaron Ogata <aogata@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
2023-03-23 22:38:20 +00:00
Isaac Moore e1b397ca30 Remove Delicious from Canvas
refs AE-142
flag=none

test plan:
- mutating allowed_services via UI still works
- mutating user services via UI still works

Change-Id: I2231b76c2dc9443ea94ecf0afbdfc842ecc8c497
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/313727
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Isaac Moore <isaac.moore@instructure.com>
Product-Review: Isaac Moore <isaac.moore@instructure.com>
2023-03-22 15:01:28 +00:00
Paul Gray 6beb8cdc4b Add Lti Registration model
refs INTEROP-7952

flags=none

why

This commit adds a table and matching ActiveRecord model to facilitate
Lti Registrations. This will be further used in building support for
Dynamic Registration.

test plan:

Make sure the migrations run, and the `lti_ims_registrations` table is
created.

Change-Id: I1d3f6b46d08de7dd68254553191de65fdf72138e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/313519
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Paul Gray <paul.gray@instructure.com>
2023-03-22 13:41:35 +00:00
Jacob Burroughs 809ca3cac9 Send postgres warnings to sentry
And make the errors from guard_excessive_updates likely group
better for sentry's purposes

refs AE-149

Change-Id: Iea04ebdbb96653b82e1eed7026697fe8419f6879
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/313635
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
2023-03-17 21:54:49 +00:00
Jacob Burroughs a01ccf7f69 Exclude underscore tables from the update guard
underscore tables are created by other tools in canvas schemas
but are not managed by canvas itself, so we shouldn't try to
modify them

Change-Id: Id9a804c42884a178e3415a73a66d1fd56784bb8d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/313574
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>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
2023-03-17 14:19:39 +00:00
Drake Harper ae9dae465d Fix performance issues in conversation datafix
closes VICE-3336
closes VICE-3337
flag=none

Test Plan:
 - run datafix up queries in rails console
 - should see queries with multiple ids

Change-Id: Ide5997e90890e82c4e5fedd34044b90d260862a0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/312284
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
Reviewed-by: Omar Soto-Fortuño <omar.soto@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
2023-03-13 19:21:33 +00:00
Weston Dransfield b876adcdf3 Revert "Data fix up for Conversation/ConversationParticipant"
This reverts commit b6debfc9fb.

NOTE: this is not a complete revert. It leaves the addition of the
saftey navigation operators in ConversationHelper

Reason for revert: This data migration has a few performance issues that should be addressed:

- (line 27) Don’t use .each on Conversations, use some sort of batching (probably find_each with :id strat)
- (line 28) n+1 loading conversation_participants
- (line 29) n+1 loading users

Change-Id: I2b18c121a9e6b75e1fe605202542899838af7b80
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/312283
Reviewed-by: Omar Soto-Fortuño <omar.soto@instructure.com>
QA-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
Product-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2023-03-13 15:37:10 +00:00
Jacob Burroughs 35c56fb9b9 Revert "Revert "Introduce guardrails for excessive db modifications""
This reverts commit d2f0962da9.

Fixed now to not break jenkins

[build-registry-path=jenkins/canvas-lms/jburroughs-test]
[change-merged]

Change-Id: I9e55a234000043dce4e296952279e275bbb281a3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/312747
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>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
2023-03-08 15:00:09 +00:00
Mysti Lilla 5b3e242645 Add attachment_id to media_tracks
closes MAT-1202
flag=none

Test plan
- Run the database migration
- Upload a media file
- Separately (unresolved race
  condition) add a caption
  to the media file
- Ensure the media track
  in the database has the
  attachment_id from the
  media object

Change-Id: I890c5d81f4115a885b7c9f991352fb590b1c2609
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/310187
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Sarah Gerard <sarah.gerard@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
2023-03-07 22:42:46 +00:00
Jacob Burroughs ac948b6aff Revert "add index on content_tags to make lookup / bulk updating easier"
This reverts commit dbaf24a057.

Reason for revert: some urls are stupidly long and un-indexable

Change-Id: I9dafdfe5591bb811a8faead824a2d177eb71d604
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/312270
Reviewed-by: Ryan Norton <rnorton@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
2023-03-02 17:27:21 +00:00
Aaron Ogata d2f0962da9 Revert "Introduce guardrails for excessive db modifications"
This reverts commit 8bc4a9e6a3.

Reason for revert: broke jenkins

Change-Id: I4beb70f18707d52665ed489b31f513c4165bf51c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/311360
Tested-by: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
Migration-Review: Aaron Ogata <aogata@instructure.com>
2023-02-24 19:02:04 +00:00
Jacob Burroughs 8bc4a9e6a3 Introduce guardrails for excessive db modifications
For now warn so we can measure and make necesssary changes; will
allow opting in to hard fialures per database server

fixes AE-149

Change-Id: I4588ccbda726ea0b9fdf4eb9fe15246388ac0478
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/311729
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
Reviewed-by: Hubert Lubaczewski <hlubaczewski@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: Aaron Ogata <aogata@instructure.com>
2023-02-24 15:51:35 +00:00
Alex Slaughter dbaf24a057 add index on content_tags to make lookup / bulk updating easier
flag=none

Test plan:
 - Already tested: https://instructure.slack.com/archives/C0292K3J1/p1676774757040499

Change-Id: Id9c7f05cf7996d6aaf1c1529d2d95df3a26fcc67
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/311485
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Alex Slaughter <aslaughter@instructure.com>
Product-Review: Alex Slaughter <aslaughter@instructure.com>
2023-02-21 07:22:09 +00:00
Drake Harper b6debfc9fb Data fix up for Conversation/ConversationParticipant
closes VICE-3336
closes VICE-3337
flag=none

Test Plan:
 - specs pass
 - migration runs locally to fix applicable data

Change-Id: Ie29956836e3a9e8f4dd0a354b8c42175d9ee83c6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/311446
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
Reviewed-by: Jason Gillett <jason.gillett@instructure.com>
Product-Review: Jason Gillett <jason.gillett@instructure.com>
QA-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
2023-02-17 19:17:24 +00:00
Chawn Neal 76d877e3ee datafix set root_account_ids ConversationMessageParticipant
this is the intended set_root_account_ids for
conversation message participants.

this will set it to the conversation's root_account_ids.

refs VICE-3181
flag = none

Test Plan:
1) you can run the loop locally,
 and for one cmp.
2) watch how it sets the cmp.root_account_ids

Change-Id: I7796e7bf76428840bd94fdb2bd54e0b001280d2c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/310674
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Migration-Review: Aaron Ogata <aogata@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Jason Gillett <jason.gillett@instructure.com>
Product-Review: Jason Gillett <jason.gillett@instructure.com>
2023-02-09 19:13:08 +00:00
Omar Gerardo Soto-Fortuño bda150e266 Populate missing root_account_ids for Communication Channels
closes VICE-3182
flag=none

test plan:
  - Specs pass

qa risk: low

Change-Id: I9fea3003c97a6e62f4f3a917491cfd77aa4fdb8c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/310495
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Drake Harper <drake.harper@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Drake Harper <drake.harper@instructure.com>
QA-Review: Jason Gillett <jason.gillett@instructure.com>
2023-02-07 21:09:17 +00:00
Jacob Burroughs 48d17872bf Set root_account_ids for student view students
fixes FOO-3156

Change-Id: Ibd93e097544e7b5da082cdcf4429e97c83a24bed
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/304309
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>
Migration-Review: Isaac Moore <isaac.moore@instructure.com>
2023-02-01 18:30:16 +00:00
jake.oeding 656b315402 stop reviving deleted media files
don't bring them back from death when a user
views an embedded version of them

fixes MAT-1193
flag=none

test plan:
-upload a media file (audio or video)
-embed said file in a page/assignment/other rce location
 and save
-go to your 'Uploaded Media' folder and delete said file
-go back the the location where you embedded said file,
 view it, and make sure you wait until you can play the
 audio/video before moving on
>go back to files and ensure that the file wasn't recreated,
 i.e. it's not present in your 'Uploaded Media' folder
>go to an RCE, open the media embed tray, and confirm
 said file also does not appear in the files available to
 embed

Change-Id: Icc061234d2be8b853ed89107146cf161cdab3d28
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/309791
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>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Allison Howell <allison.howell@instructure.com>
2023-01-31 15:00:31 +00:00
Mysti Lilla 9fb2262ca8 Fix folder_active functions
Turns out that trigger functions cannot reference
schema qualified tables, or we can't refresh test
cluster instances, so this should make them
generic

flag=none

Test plan
- Specs pass

Change-Id: I344ab266f1d37ab1935b6e2a51cb80ecdb37d247
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/309949
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Migration-Review: Rosser Schwarz <rschwarz@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Mysti Lilla <mysti@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2023-01-31 01:19:39 +00:00
Endre Berki 762b3aa448 Add canvas_tool_id custom field to Quiz LTI tools
Closes QUIZ-10477
flag=none

New Quiz LTI provisions are already requesting this  field with g/307628.
With this migration, the existing provisions will also be adapted.

Test plan:
- check that your Quiz LTI ContextExternalTool
  record does not have the canvas_tool_id custom field.
- execute rails db:migrate
- check that your Quiz LTI ContextExternalTool
  record HAS the canvas_tool_id custom field

Change-Id: I04c54dcdf5d9730756f67ae9459c5008c9aecfdf
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/308959
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ferenc Marcsó <ferenc.marcso@instructure.com>
QA-Review: Roland Beres <roland.beres@instructure.com>
Product-Review: Roland Beres <roland.beres@instructure.com>
Migration-Review: Aaron Ogata <aogata@instructure.com>
2023-01-27 11:37:12 +00:00
Jeremy Stanley 39dec149cf add resource_map_url to quizzes_next_quiz_duplicated live event
test plan:
 - have a course with a new quiz
 - copy it to another course
 - the quizzes_next_quiz_duplicated live event that is dispatched
   should include a resource_map_url that points to a file
   that looks like

   {
     "source_course": "203",
     "source_host": "pineapple.edu",
     "resource_mapping": {
       "assignments": { "1": "21", "2": "22" },
       "announcements": { ... },
       ...
     }
   }

flag=none
refs FOO-3302

Change-Id: I97196bd13c0cb2d95103540526e69e11f5c9c2f7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/309121
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Logan <james.logan@instructure.com>
Reviewed-by: Eric Saupe <eric.saupe@instructure.com>
QA-Review: James Logan <james.logan@instructure.com>
Migration-Review: Isaac Moore <isaac.moore@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2023-01-25 00:24:40 +00:00
Ed Schiebel 0f018da4fb Remove unsplash code from canvas
One tricky bit I had to deal with here was migrating developer_key scopes

refs MAT-1140
flag=none

test plan:
  - jenkins passes
  - canvas still runs
  - you can set|change the course image on the course settings page
  - you can upload an image from the rce
  - Unsplash does not show up on the /plugins page

Change-Id: I36a88bcba0cd6f39a45a61ea38ede39f99d58a42
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/308631
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Tucker Mcknight <tmcknight@instructure.com>
Reviewed-by: Deyvison Penha <deyvison.penha@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Deyvison Penha <deyvison.penha@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2023-01-18 17:51:51 +00:00
Jason Gillett 94e7ee5b98 Populate quoted entry field
closes VICE-3240
flag=split_screen_view

Test Plan
- run the migration
- Verify that discussion_entries with include_reply_preview = true have a populated quoted_entry_id
- the quoted_entry should match the quoted_entry_id
- all existing quoted_entries should be their parent_entry

Change-Id: I70f61e29bf47a30f3e90ab7d5c9a60d7e7a6610c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/308223
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Omar Soto-Fortuño <omar.soto@instructure.com>
Product-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
2023-01-06 16:48:54 +00:00
Jason Gillett ebafef9661 Add Quoted_entry to discussion entry model
refs VICE-3240
flag=split_screen_view

Test Plan
- run the migration
- Verify that the discussion_entry model has a quoted_entry_id field

Change-Id: I921b23f839311d8d25a7e7d36067751285a3d0f7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/308220
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Drake Harper <drake.harper@instructure.com>
Product-Review: Drake Harper <drake.harper@instructure.com>
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
2023-01-06 16:43:13 +00:00
Tucker McKnight 8475b01547 Change dev key scopes that reference old API routes
A couple of outcome_imports endpoints were changed a while ago
and not caught it our first round of fixups for this issue.

The commit that changed these routes is d97ffa57a8, which is from
before we started cleaning these up and catching these errors.

test plan:
- I tested this by creating a developer key with the first two
  "before" values in SCOPE_CHANGES,
  ["url:POST|/api/v1/courses/:course_id/outcome_imports",
   "url:POST|/api/v1/accounts/:account_id/outcome_imports"]
  for its scopes, and saving it with dk.save(validate: false).
- Then I verified that you couldn't modify the developer key without
  getting a validation error.
- Then I changed the dk.scopes to be the first two "after" values in the
  SCOPE_CHANGES array below, and verified that you could modify it after
  that.

flag = none

fixes INTEROP-7864

Change-Id: I681d1d050c2af096e1e84e7038aa50b5bda854fb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/306877
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Tucker Mcknight <tmcknight@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
2023-01-04 16:53:01 +00:00
Tucker McKnight 2055aa0bc6 Refactor dev key scope fixup
Since a developer key won't save unless all of its bad routes are
fixed at once, if we discover a new bad route in the future, we'll want
to re-run all of the prior scope changes on that key at the same time.
Putting them all in the fixup class itself makes it easier to run all
of the route changes every time, and gives a straightforward place to
put new route changes that may come up in the future.

flag = none

Change-Id: I8c7c93d513d82b1c366bbe641c70196933be3363
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/306601
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Tucker Mcknight <tmcknight@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
2023-01-04 16:52:38 +00:00
Ryan Hawkins 78eb4617ec Increase valid length for dev keys redirect_uris
why:
- some of the DBAs noticed that we were trying to save URIs longer than
  255 characters to the database and silently swallowing the errors.
- we've decided to bump up the size of a valid redirect_uri, as 255
  characters is quite short in the grand scheme of things.
- additionally, added a validation on the front and backend to ensure we
  don't swallow errors like this again.
flag=none

closes INTEROP-7592

test-plan:
- Run the included migration
- In the UI, try and create a key with one of its redirect_uris having
  a length greater than 4096 characters. You should get an alert telling
  you that redirect_uri is too long.
- In a rails console, try and create a DeveloperKey with one of its
  redirect_uris having a length greater than 4096 characters. You should
  get an error from ActiveRecord::Validations saying that one of your
  redirect_uris is too long.

Change-Id: I86b437d62f95cbee81dac45250ad4a59fcd6b373
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/306735
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
Product-Review: Ryan Hawkins <ryan.hawkins@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
2023-01-03 21:42:21 +00:00
Derek Williams 4fc4538460 add submit for student file upload button and modal
closes EVAL-2685
closes EVAL-2686
closes EVAL-2687
closes EVAL-2688
flag=proxy_file_uploads

test plan:
- turn on proxy_file_uploads siteAdmin FF
- grant Teachers permission with proxy_assignment_submission
- create an assigment on a course with file_upload submissions
- as a teacher, navigate to that assignment in gradebook
- notice 'Submit for Student' button on the submission tray
- upload a file and see that it saves to the student's folder
- click 'submit' to save the submission
- notice that the proxy submitter is saved on the submission
- verify proxy upload indicator appears in the following places
    - gradebook submission tray
        - SubmissionTray.tsx
    - speedgrader
        - submissions_dropdown.handlebars
    - A2 student views
        - SubmissionWorkflowTracker.js
    - A1 student views
        - submission_sidebar.html.erb
        - views/submissions/show.html.erb

Change-Id: I2b9a7b8a5d1bd7c31bd2fe0c15b3316ce8b7e4bc
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/304943
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Cameron Ray <cameron.ray@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Christopher Soto <christopher.soto@instructure.com>
Product-Review: Deborah Kwak <deborah.kwak@instructure.com>
2023-01-03 21:28:01 +00:00
akemeny a71ad5b289 Add Commons LTI config backfill for Heap integration
refs PHO-3830
flag=none

Commons LTI provisions are already requesting these fields.
With this migration, the existing provisions will also be adapted.

Test plan:
- check that your Commons ContextExternalTool
  record does not have the necessary custom fields.
- execute rails db:migrate
- check that your Commons LTI ContextExternalTool
  record HAS the necessary custom fields

Change-Id: Id7e12bfb1569ba48c55f2d0e16c8dedc7c9cb335
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/307266
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Andras Kemeny <akemeny@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
2022-12-24 20:15:21 +00:00
Chris Soto f0d7a015c1 remove assignment visibility for concluded student
Before this change, if an assignment was assigned to a section that a
student was concluded in AND that student had another enrollment in
the course that was active, the student would maintain visibility of
any assignments that had a due date in the future. This meant that the
students could submit for that assignment. After this change,
students will no longer be able to see assignments that are assigned
to sections that concluded/completed in that have a due date in the
future. The will continue to see any assignments that were due before
their enrollment was completed.

closes EVAL-2748
flag=none

Test Plan 1:
* Pre-requisites: Migrations have been run, and a student enrolled in
two sections of the same course (A & B).

1. As the teacher, create one assignment in section A.
2. As the teacher, create two assignments in section B.
   - create one assignment with a due date in the past
   - create one assignment with a due date in the future
3. As the student, view your assignments. User should see all
   assignments
4. As teacher, go to the user page for the
   student (courses/:course_id/users/:id), click 'more user details...',
   and then click on 'Conclude this Enrollment' for Section B
5. As the student, view your assignments. User should now see:
   - Assignment for Section A (still enrolled)
   - Assignment for Section B with due date in past
6. Verify the student cannot see the assignment for Section B that
   has the due date in the future.

Change-Id: I68a5ae908077d2f591532513a022e339db2c8c3a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/306831
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
Reviewed-by: Cameron Ray <cameron.ray@instructure.com>
QA-Review: Spencer Olson <solson@instructure.com>
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
Product-Review: Deborah Kwak <deborah.kwak@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
2022-12-21 22:06:33 +00:00
Jacob Burroughs f5ef671937 Fix migrations on ruby 3.0
Change-Id: Id1240c757f3e8470c27b8c1fdd0f5fe3f9c48e4e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/307222
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Migration-Review: Aaron Ogata <aogata@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
2022-12-13 14:26:35 +00:00
Mysti Lilla 9389b58c9f Error when trying to create files/folders in deleted folder
fixes MAT-917
flag=none

Test plan
- Upload a very large zip and extract it into a folder
  in the files interface
- When it has started importing, delete the top level folder
  (The import will still complete)
- Go to the modules page and add a file module item
  and verify that you can't see any of the files that your
  import would've created

Change-Id: Ibcf06940ad8306a015040508166e0a2b001409c4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/305351
QA-Review: Deyvison Penha <deyvison.penha@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2022-12-02 19:55:13 +00:00
AJ Esa 8abef3d627 Timestamps for delayed jobs not null
Make the timestamps for delayed jobs not nullable. Fixes schema
inconsistency.

fixes FOO-3107
flag=none

Change-Id: I97050eb78fcfa4bd3989c120ee1736efa8abd879
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/305918
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Ajmal Esa <ajmal.esa@instructure.com>
Product-Review: Ajmal Esa <ajmal.esa@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
2022-11-29 16:55:55 +00:00
Cameron Ray 0dd4aec595 assignment_group rules
prevent decimal ignore rules from being added to
assignment_groups

Test plan:
 - As a teacher
 - In the Assignment Groups edit modal
 - Enter a non-integer value to 'Lowest Scores'
 - Click save
 - Should show error
 - Enter a non-integer value to 'Highest Scores'
 - Should show error

Refs EVAL-2720

flag=none

Change-Id: I51b86da6c0692231c1d7a6f28dbdeaf1dd1aac5f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/304051
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Migration-Review: Isaac Moore <isaac.moore@instructure.com>
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
Product-Review: Cameron Ray <cameron.ray@instructure.com>
2022-11-16 21:22:18 +00:00
Eric Saupe 90c5693d36 Fix non-paceable content tags being updated/created
A check was added for "learning_outcome_association" tag types with
PFS-19614. There are other content tags that are not used by
context modules. Course pacing is only concerned with module items. This
patchset fixes the check when a content tag is updated to match the other
course pacing checks to only get content tags that are for context modules
and have an assignment.

fixes LS-3548
flag=course_pacing

test plan:
- Create a ContentTag with a tag_type other than "context_module" in a
course with course pacing enabled and a course pace published
- Verify the content tag is not added to the course pace
- Create a ContentTag with a tag_type of "context_module" without an
assignment attached
- Verify the content tag is not added to the course pace

Change-Id: Ibe32df8906cf96582874727a88e8ece9bd02fd84
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/303975
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Davis Hyer <dhyer@instructure.com>
QA-Review: Davis Hyer <dhyer@instructure.com>
Product-Review: Davis Hyer <dhyer@instructure.com>
2022-11-08 19:36:22 +00:00
Chawn Neal a2314df6cc Fix pagination with unread filter
fixes VICE-3170
flag = react_discussion

Test Plan:
Solution:
- any entries marked as read after selecting the unread filter,
will still return under the unread filter, until the filter changes
or a page refresh.
- note the mutation will sill update and the blue unread icon
will disappear.

Have at least 60 unread entries (3 pages).
Have some unread entries.
1. Use the unread filter.
2. Notice the unread entries can update to read,
however. If you switch pages the same set of total unread entries
will be returned.
3. Upon page refresh or switching filter, then
returning to unread the entries will no longer return.

Change-Id: I911f85ed8a23b7f8bdfa22edce5745e79b389307
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/304016
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Omar Soto-Fortuño <omar.soto@instructure.com>
Product-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
2022-11-01 16:01:20 +00:00
Omar Gerardo Soto-Fortuño 45fc40f040 Create DiscussionEntryVersion
flag=none

test plan:
  - Tests pass

qa risk: low

Change-Id: Iaadf9cb6c0dd92946990a4fdee7649984b5a6143
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/304362
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Chawn Neal <chawn.neal@instructure.com>
QA-Review: Chawn Neal <chawn.neal@instructure.com>
Product-Review: Chawn Neal <chawn.neal@instructure.com>
2022-11-01 15:28:34 +00:00
Mysti Lilla 74c87a0577 Clean up duplicate subscription creation code
flag=none

While working on g/289874 I discovered the
tool proxy controller was also attempting
to create/delete the live events subscriptions.
The model is already doing this now, and
the controller code is not necessary

Test plan
- Create a LTI 2 tool (with live events
  subscription service turned on) and
  ensure a subscription is created
- Delete the LTI 2 tool and ensure
  the subscription is disabled

Change-Id: Ieac06c9cc22faca27bfabaaf18f342abd68e8efa
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/290866
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
Reviewed-by: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2022-10-27 18:18:32 +00:00
Cameron Ray f64c1ada94 Remove comments from the rubric assessments table
This is a field that has not been used for a long time and,
previously, someone tried to remove it.
It's causing data inconsistency issues across shards.

Test plan: all existing tests pass

flag=none

Refs EVAL-2631

Change-Id: I64533586806f4a0574ae39cca82bf8a07cf54236
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/303968
Reviewed-by: Spencer Olson <solson@instructure.com>
QA-Review: Cameron Ray <cameron.ray@instructure.com>
Product-Review: Cameron Ray <cameron.ray@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
2022-10-25 15:27:19 +00:00
August Thornton cfa4c53bab backfill root_account_id for enrollment_dates_overrides
refs FOO-3155
flag = none

test plan:
 • run data fixup migrations
 • should populate any root_account_id columns that are NULL
   for enrollment_dates_overrides table

Change-Id: Idbb8d9f5811cf8da3f7245572cd3f1e1fbf59a76
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/303632
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: August Thornton <august@instructure.com>
2022-10-20 20:06:15 +00:00
August Thornton 23de3cb6c8 add root_account_id to enrollment_dates_overrides
refs FOO-3155
flag = none

test plan:
 • run migrations
 • verify in rails console that root_account_id can now
   be set on the EnrollmentDatesOverride model

Change-Id: I801b344efffa88efc6a5ed351440a4bf2e5525f1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/303609
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Sean Scally <sean.scally@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: August Thornton <august@instructure.com>
2022-10-19 21:07:59 +00:00
Omar Gerardo Soto-Fortuño 5b1b4e369d Change discussion_topic_materialized_views fields to text
flag=none
closes VICE-3126

test plan:
  - Tests pass
  - Cursory testing of legacy discussions

qa risk: low

Change-Id: Ifc84cbeadb439b919bc84d5cae400b92ff32eb0b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/302961
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Chawn Neal <chawn.neal@instructure.com>
Product-Review: Chawn Neal <chawn.neal@instructure.com>
2022-10-11 14:14:40 +00:00
Endre Berki 323f89e48a Add rcs_service_jwt custom field on Quiz LTI tools
Closes QUIZ-9848
flag=none

New Quiz LTI provisions are already requesting this  field with g/300117.
With this migration, the existing provisions will also be adapted.

Test plan:
- check that your Quiz LTI ContextExternalTool
  record does not have the canvas_rcs_service_jwt custom field.
- execute rails db:migrate
- check that your Quiz LTI ContextExternalTool
  record HAS the canvas_rcs_service_jwt custom field

Change-Id: I8c7061d8e64637bbfce02ab4a3dfc5863ab7cc83
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/301864
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rajmund Csehil <rajmund.csehil@instructure.com>
QA-Review: Rajmund Csehil <rajmund.csehil@instructure.com>
Product-Review: Rajmund Csehil <rajmund.csehil@instructure.com>
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
2022-09-28 08:24:36 +00:00
paulo.chaves 35b93d1934 Add content_item to content_participations table
Add the content_item column to enable tracking the
read state of each submission item (grade, comment, rubric)

Ensure content_participation_counts doesn't allow negative `unread_count`

closes EVAL-2657
flag=visibility_feedback_student_grades_page

Test plan:
  - Existing test and new tests pass

Change-Id: Ia0a7aaadd944914de56e596736537d6946ce7d3c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/301671
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
QA-Review: Cameron Ray <cameron.ray@instructure.com>
Product-Review: Cameron Ray <cameron.ray@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
2022-09-27 18:48:10 +00:00
Ethan Knapp feafc09667 add file permissions
adds a Course-level setting to control the visibility of uploaded files
also adds a per-file setting to override the Course-level setting

Test Plan:
1. Validate the the Course-level setting can be set and updated. It should
    behave similar to the Syllabus visibility setting, but should allow
    being looser or tighter than the Course itself.
2. Validate that the File-level setting can be modified.
3. Validate that Files can only be accessed based on the setting.
4. Validate that the existing "Only with link" and "Schedule availability
    rules work as expected with the new options.

flag = none
refs PFS-20427

[fsc-max-nodes=20]
[fsc-timeout=45]

Change-Id: Ie688264fff59e81b13c97ef58bf0ae81cf8a5610
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/300000
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
QA-Review: Douglas Rist <douglas.rist@instructure.com>
Product-Review: Jesse Poulos <jpoulos@instructure.com>
2022-09-26 22:51:46 +00:00
Jacob Burroughs 43f00db33e Actually create jobs timestamps not null
Fixes bug introduced in g/284968 and makes the migration match inst-jobs

refs FOO-3107

Change-Id: I09902b7f97450ddd461d6daf51c32906397f794d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/301406
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>
2022-09-20 14:43:15 +00:00
Tucker McKnight 9f79475dcb Re-run the dev key scope fixup
This data fixup should be run again now that 10325309 has been merged
in. Before that, developer keys that had scopes that were defined
in a plugin would have run into a validation error when this job
ran the first time.

Keys that were already fixed the first time around will be unaffected
by this second run.

fixes INTEROP-7615

flag = none

Change-Id: Iecf0be69f072cc1893daf7e72eca6557a3ceb765
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/300179
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Tucker Mcknight <tmcknight@instructure.com>
Reviewed-by: Steve Mcgee <steve.mcgee@instructure.com>
2022-09-08 21:43:45 +00:00
daniel.artner 13248d5e76 Add rcs_host custom field on Quiz LTI tools
refs QUIZ-9572
flag=none

test plan:
- check that your Quiz LTI ContextExternalTool
  record does not have the canvas_rcs_host custom field.
- execute rails db:migrate
- check that your Quiz LTI ContextExternalTool
  record HAS the canvas_rcs_host custom field

Change-Id: I3d66a6d88698b1c83ce047ae21c289f82417beff
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/295040
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
Migration-Review: Ben Rinaca <brinaca@instructure.com>
QA-Review: Endre Berki <endre.berki@instructure.com>
Product-Review: Endre Berki <endre.berki@instructure.com>
2022-09-05 11:16:36 +00:00
Jeremy Stanley 33dd2726dc scheduled publication of pages
test plan:
 - enable the scheduled page publication feature in
   your account
 - create or edit a page and set a publish_at date
   in the near future
 - wait for that time (and ensure jobs are running and
   not backlogged)
 - ensure the page became published (and its module item was
   published if it's in a module)
 - ensure when a page scheduled to be published in the future
   is copied as part of course copy, the copy gets published
   at that time too
   - unless dates are shifted. the publish_at date should be
     shifted the same as the others
   - if a page is scheduled for publication in the near
     future, then the course is copied after the page is
     published, shifting the publish_at date into the future,
     the page in the destination course should be unpublished
     (and the calendar icon should show the publication date)
 - ensure when a page in a blueprint associated course is
   automatically published, future syncs still update the page
   (the auto-publish isn't counted as a downstream change
   that causes sync exceptions)
 - on the pages index, a page that is scheduled for publication
   but not yet published shows a red calendar icon in place of
   the gray circle-slash thing ordinarily seen next to unpublished
   pages
   - same goes for the modules page
     and the button at the top of page show
   - clicking the icon lets you publish the page now,
     unpublish it (remove the scheduled publication), or
     change the publication date
 - when a page that is scheduled for publication is included in
   an unpublished module, publishing the module doesn't publish
   the page (and you get a notice)

if the feature is turned off after scheduling pages to be published,
no evidence of it is visible in the UI and the page will not be
published when the time arrives. (we figure this is easier than
updating all pages in the account to wipe the publish_at date
for a scenario that doesn't seem likely to begin with anyway)

note that I removed the tooltip from the publish button on page show
because it always duplicates the button text, but the tooltip
remains on the publish icon

closes DE-1346

flag=scheduled_page_publication

Change-Id: Iba16b3d788bcb0051e022e2706446020e6b8171b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/297715
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: David Lyons <lyons@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
2022-08-30 16:10:55 +00:00
Xander Moffatt 145a560fe2 replace settings.use_1_3 with lti_version: 1.3
why:
* explicitly set lti version on tool model instead of in settings hash
* remove all direct usage of settings["use_1_3"]
* set lti_version: 1.3 on all tools that have 1.3 in settings

closes INTEROP-7598
flag=none

test plan:
* have a 1.3 ContextExternalTool that has a developer_key associated
with it and `use_1_3: true` in its settings hash
* run `dcr web rake db:migrate`
* reload that tool - it should have lti_version: 1.3 and not have
use_1_3 in its settings hash

Change-Id: Ib82aedaf1a19fec48eab28f9cd408c4712ec21c0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/298327
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
Product-Review: Xander Moffatt <xmoffatt@instructure.com>
2022-08-23 18:14:00 +00:00
Xander Moffatt cb03441f04 fixup lti_version for 1.3 ContextExternalTools
closes INTEROP-7597
flag=none

test plan:
* have a 1.3 tool installed
* by default it should have an lti_version of "1.1"
* `dcr web rake db:migrate`
* reload that tool - it should have an lti_version of "1.3"
* create a new 1.3 tool using an LTI developer key
* that new tool should also have an lti_version of "1.3"

Change-Id: I446a523f62c4de58386375c4223dbfc9ac2e184d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/298589
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Xander Moffatt <xmoffatt@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
2022-08-17 19:52:45 +00:00
Xander Moffatt 74589c2e0f add lti_version column to tool
why:
* explicitly set lti version on tool model instead of in settings hash
* remove assumption that the presence of a developer_key_id means that
a tool is 1.3
* include new column in tool import/export

closes INTEROP-7596
flag=none

test plan:
* run `dcr web rake db:migrate`
* in a Rails console, run `ContextExternalTool.last`
* the model should have an lti_version of "1.1"

Change-Id: I101111a17f6ce06c466c142e7b312e6ba7c5149f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/298326
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
Product-Review: Xander Moffatt <xmoffatt@instructure.com>
2022-08-17 19:52:37 +00:00
Xander Moffatt 7a6b1112a4 fixup more broken course copied resource links
why:
* the last fixup mistakenly only searched for resource links created
since 7/26 (since the first hotfix that introduced this bug)
instead of since 6/12 (the initial commit that added urls to resource
links and made this bug possible)

closes INTEROP-7580
flag=none

test plan:
* with a course with at least one resource link in it
(either LTI assignment, LTI module item, or LTI content item in an RCE),
that has a nil url (this is the old way of doing it and
you may need to manually create one like this)
* create a new course and Import Existing Content
* choose the original course as a source
* in a rails console, find all Lti::ResourceLinks associated
with the newly copied course
* update all of their created_at to be before 6/12,
and all of their urls to be not nil (you could use the tool's url since
that is what happened before the bug fix)
* run `DataFixup::FixResourceLinksFromCopiedCoursesNullUrls.run`
* these resource links should correctly have nil urls

Change-Id: I587a194ba96cc428b3880dd516870f33ba26f8e9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/297808
Reviewed-by: Paul Gray <paul.gray@instructure.com>
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Xander Moffatt <xmoffatt@instructure.com>
2022-08-03 21:34:44 +00:00
Paul Gray bbe1da583a Persist nil resource link urls during course copy
why

With resource_links now having urls, when looked up via retrieve, the
url launched is taken from the resource link's url column. If that
column is nil, then the tool's url will be used. Some resource links
rely on this behavior to launch the url. During course copy, the url in
the export is now included in the export and persisted in the import,
causing all imported resource links to never persist a nil url.

This commit updates the exporter with a new custom property in the cc
export, a resource_link_url, which includes the url column from the
exported resource_link. The importer will use this to populate the new
resource link's url column, and will use the standard cc launch_url
simply to lookup the tool to associate.

fixes INTEROP-7572

flag=none

test plan:
Find an existing course with a resource_link that has a nil url, and
copy that course. the new course should have the same resource_link,
except the url in the new resource link should still be nil.

Change-Id: I62f85689a4a6a7a2cbd8f95f82c6dde343d7b8e0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/297340
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Paul Gray <paul.gray@instructure.com>
2022-07-29 21:31:41 +00:00
Luis Oliveira c2e5418ddc Add course paces to blueprint syncs
fixes LS-3162
flag=course_paces
[fsc-max-nodes=18] [fsc-timeout=30]

test plan:
- Configure course paces in a course
- Make that course a blueprint
- Associate it and sync it to a second course
- Check that the proper assignment durations
  flow downstream
- Alter course pacing in the child course
- Check that on further syncs downstream
  changes aren't overwritten
- Lock the duration for some assignments
- Check that on further syncs those durations
  are now overwritten

Change-Id: I0a92835407566bd47581c7782039def18d31fe2c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/293351
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: Allison Howell <allison.howell@instructure.com>
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
2022-07-28 19:41:51 +00:00
Paul Gray 9b0e44cbcb Prefer a Resource link's own url in export
why

Previous to g/293521 the lti_resource_links table did not have a url
column. That commit added it, and modified resource links added via RCE
to rely on the url in the resource link. The resource link exporter
wasn't updated to copy this url, instead, using the associated tool's
url. When courses were copied, they use the export/import logic, and so
resource links were being copied without the correct url.

test plan:

Create a course with a single assignment, which is RCE text content.
Inside that text, add a Deep link url chosen from the lti13testtool,
when launching, you'll see that the
`https://purl.imsglobal.org/spec/lti/claim/target_link_uri` claim has a
url with a `deep_link_location` parameter.

Copy the course, and find the same assignmnent you created, and click
the link. The launch should contain the same `deep_link_location`
parameter.

fixes INTEROP-7562

flag=none

Change-Id: I62deea4f9fdc232d9e6069e7f02cd399a3bcd923
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/296776
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Alexis Nast <alexis.nast@instructure.com>
2022-07-27 19:07:59 +00:00
Jackson Howe 228f483cbc Add account calendars api controller
This api will be used by students and admins to see what account
calendars are available (all available calendars, not the calendars
that the user is "subscribed" to). It will also be used by admins to
set account calendar visibility.

Includes a miration to add an account_calendar_visible column to the
accounts table. This is preferable to using a setting on Account since
we'll be querying accounts using this valueas a parameter and prefer
the performance of a column.

closes LS-3253
flag = account_calendar_events

Test plan:
 Part 1: index
 - Enroll a user in a few courses in different accounts
 - GET /api/v1/account_calendars as that user
 - Expect to see an entry for each account where the user has an
   enrollment, as well as all of those accounts' parents, up the chain
 - In the rails console, set one of the account's calendars as hidden:
   account = Account.find(x)
   account.account_calendar_visible = false
   account.save
 - GET /api/v1/account_calendars again, and expect the same result as
   before, but without the hidden account

 Part 2: show
 - GET /api/v1/account_calendars/xyz as the user from before, where
   xyz is the account id of one of the user's associated accounts
 - Expect to see the account calendar details
 - Try to request an account calendar that the user doesn't have
   access to; expect to see 401
 - Attempt to access the hidden account calendar; expect a 401
 - As an admin with the manage_account_calendar_visibility
   permission, attempt to access the same hidden calendar; expect
   success

 Part 3: update
 - As an admin with manage_account_calendar_visibility permission,
   PUT /api/v1/account_calendars/xyz with param visible=<true/false>
 - Expect the visibility to be updated accordingly
 - Try to update visibility as a student (or any user without the
   permission); expect 401

 Part 4: all_calendars
 - As an admin with manage_account_calendar_visibility permission,
   GET /api/v1/accounts/xyz/account_calendars, where xyz is the
   *root account* id
 - Expect a list of all account calendars for the entire
   institution, regardless of visibility status
 - Expect this request to return 401 for students or admins without
   the permission

Change-Id: I0a3bcd58b509c62326b0a885b87ec3f8779fcd37
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/296293
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>
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jackson Howe <jackson.howe@instructure.com>
2022-07-22 21:52:10 +00:00
Joshua Richardson db853abd72 Add database migration for blackout dates
Create a new database migration file to add a boolean variable
to the calendar events that shows whether it is a blackout date
or not. Add a test to make sure this field is there in
spec/models/calendar_event_spec.rb

closes LS-3290
flag=account_level_blackout_dates

Test Plan
 - Open the project in the command line
 - Run `rails db:migrate`
 - Run `rails db:migrate RAILS_ENV=test`
 - Run `rails c`
 - Run `CalendarEvent.last`
 - Notice that the `blackout_date: false,` field is somewhere in the output
 - Run `rspec spec/models/calendar_event_spec.rb`
 - Notice that the tests pass

Change-Id: I4ba40323afe92320cdc69ff7b4fddc43ef30fb50
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/296579
Reviewed-by: Jackson Howe <jackson.howe@instructure.com>
QA-Review: Jackson Howe <jackson.howe@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Joshua Richardson <joshua.richardson@instructure.com>
2022-07-20 21:34:15 +00:00
Jacob Burroughs 75b82ebdd6 Improve score details and grade statistics
Adds median and quartile calculations, and uses them to generate a
proper box and whiskers plot.

fixes GH-1871
fixes GH-1139

flag = enhanced_grade_statistics

test plan:
- Grade an assignment for at least 5 students
- Verify the student view score details show median and quartile
  numbers
- Verify the box plot matches those numbers and looks reasonable

Change-Id: I6ce4b792a112eed72df095503a6f4e82da2912c1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/242741
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Aaron Shafovaloff <ashafovaloff@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Jody Sailor
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
2022-07-20 13:24:01 +00:00
Tucker McKnight 690007200c Replace old developer key scopes
Several API routes were changed in ceed52fc49.
This data fixup will change the scopes field for any developer
keys that references those API routes, and change them to
the new API routes.

flag = none

test plan:
- Create a developer key, either in the UI or the rails console,
  and limit it to some API routes.
- Temporarily change one of those API routes in config/routes.rb
- Run the data fixup manually, like so:
```
old_route = "url:GET|/api/v1/your_chosen_route"
new_route = "url:GET|/api/v1/what_you_changed_it_to"
change = [ { old: old_route, new: new_route } ]
DataFixup::UpdateDeveloperKeyScopes.run(0, DeveloperKey.last.id, change)
```
- Also see that it works by running the migration (and adding your
  changed route to the list of routes in the migration file).
- Verify that when you look at developer_key.scopes, the route is
  changed.
- Poke around the developer keys page and verify that things still work.
Change-Id: Ia0f522b12e53c424de1ef48d1c5904c5d21bb899
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/295903
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Tucker Mcknight <tmcknight@instructure.com>
2022-07-19 19:18:52 +00:00
Evan Battaglia ce25d3d508 Refresh MS Sync user mappings after email changes
closes INTEROP-6817
flag=none

Why:
- When a user's primary email changes, if the root account is set up to
  use email as the login attribute, mapping which maps the user to the
  Microsoft 365 user will be out-of-date.
- We never delete UserMappings except when changing Microsoft Sync
  settings at an account level so currently this is almost impossible
  for customers to rectify

I didn't want to actually immediately delete a mapping, because if a
CommunicationChannel changes in the middle of a sync, the missing
UserMapping could cause us to remove the user from the Microsoft 365
group, even if the user's primary email has not even really changed (for
instance, if the user added a non-primary email). So instead I use a
needs_updating field.

Test plan:
- Make sure you have an account set up with Microsoft Sync using email
  as the login attribute.
- Make sure you have a course set up with Microsoft Sync, ideally with
  2+ users. Make sure it is successfully synced so that there are 2+
  users in the group visible in Microsoft 365 admin console.
- Look at one of the users who has a account in the Microsoft 365
  tenant and change their primary email address to another email address
  of a another user on the Microsoft 365 side
- Manually sync the course
  (course.microsoft_sync_group.syncer_job.run_synchronously)
- Look in the Microsoft 365 admin console and check that the old user
  has been removed and the new user has been added to the group.
- Change the email address again to something not corresponding to any
  user on the Microsoft side
- Sync again and see that the user has been removed from the Microsoft
  group
- Make sure one of your tests used the API to update the email address
  - add a communication channel with the POST API endpoint, e.g.:
    tok http://canvas-lms.docker/api/v1/users/123/communication_channels \
      communication_channel[type]=email \
      communication_channel[address]=someaddress@example.com \
      skip_confirmation=true
  - remove the old communication channel
    tok http://canvas-lms.docker/api/v1/users/123/communication_channels
    tok delete http://canvas-lms.docker/api/v1/users/123/communication_channels/456
- Repeat the steps above but update a primary email address from a
  SIS import. You should be able to do this by creating a users.csv file
  like this and uploading with "SIS Import" in the account menu (and
  choose the "Override UI changes" checkbox):
    user_id,login_id,first_name,last_name,email,status
    sisuser1,sisuser1login,FirstNameOne,LastNameOne,myemailaddress@instructure.com,active
- from a console, set the needs_updating on user's UserMapping to false,
  then destroy one of the user's email communication channels with
  commchannel.destroy_permanently!
- make sure the UserMapping has gotten needs_updating set to true
- destroy all email communication channels for a user, or make all their
  communication channels something without a user on the Microsoft 365
  side. Sync the course. The user should be removed from the course
  (note that you cannot remove the last course owner), and the
  UserMapping should no longer exist at all.

Change-Id: I9e2f3d5e439bebc8c9eaf89b1595908213dc1981
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/294820
Product-Review: Alexis Nast <alexis.nast@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Migration-Review: Ben Rinaca <brinaca@instructure.com>
Reviewed-by: Tucker Mcknight <tmcknight@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
2022-07-18 19:53:35 +00:00
Ed Schiebel 359731d4dc Tweak notifications for recurring event series
closes LS-2805
flag=calendar_series

I do not know how to test the message channels
for sms, summary, twitter

test plan:

for notifications to work the email communication channel
must be confirmed for your student(s).  For the student, do

stud = User.find(student_id)
c = stud.communication_channels.where(path_type: "email")
c.first.confirm

it will help to know how to find messages being sent to students
 in the console:
 Message.where(context_type: "CalendarEvent").pluck(:id, :subject)
 #  find the id with the title of the event you just created
 Message.find(:id)[:body]
 # or for html email
 Message.find(:id)[:html_body]

 in psql canvas_development
 select id, subject from messages where context_type='CalendarEvent' order by created_at;
 -- find the id of with the title of the event ou just created
 select body from messages where id=<message_id>;

  first with a single event
  - as a teacher, create a calendar event in your course
  - inspect the messages table
  > expect a message like
    There's a new event scheduled for Course 1 that you should be aware of:
    etc.

  - now create a recurring event series in your course
  - inspect the messages table
  > expect only 1 message for the event series
  > expect the link in the message to point to the first event
    in the series
  > expect the message to now include text about how it repeats.
  > expect the message "html_body" column to also include text
    about how it repeats

Change-Id: I68b576710896c26bef12d15e2ae44fcc8385564d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/295025
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: Allison Howell <allison.howell@instructure.com>
Migration-Review: Alex Slaughter <aslaughter@instructure.com>
2022-07-11 20:29:36 +00:00
August Thornton 1a785fcb9d limit subject field input for help dialog ticket form
also, allow arbitrary length to error report's subject column.

closes FOO-2912
flag = none

Test plan:
 • trigger a HelpDialog CreateTicketForm component to render
   the ticket dialog form
 • ensure no more than a generous 200 characters gets posted
   on form submit for the "error[subject]" input

Change-Id: I2c8f32e25bba1a0c5593fac0e6feb66367f8c3be
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/295080
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: August Thornton <august@instructure.com>
2022-07-05 15:58:07 +00:00
Ed Schiebel 3fd163a375 Recurring events: add update series to calendar_events api
This commit adds the ability to update events in a recurring series.
It should behave like google calendar.
(also slipped in an auth check to destroy_from_series)

when which="one"
- update the one event whose id is in the url
- invalid request if the rrule changed
when which="all"
- update all events in the series
- invalid request if the start_at date changed
  (time is OK)
- if the rrule changed, the series may get more or fewer
  events.
when which="following"
- update the event from the URL and all those after it
- if the rrule changed, the series may get more or fewer
  events
- if the start date or time changed, it creates a new
  series with the updated events

- in all cases, the api returns the updated events
- if a series shrunk as a result, the deleted events
  are not returned by the api.
- if the series spans a DST transition, the wallclock
  time of the event should remain consistent

NOTES: I know nothing about sharding. Did I screw anything up?

closes LS-2804
flag=calendar_series

test plan:
  - with calendar_series site_admin flag on
  - create a recurring event series with the create api
    POST to /api/v1/calendar_events
    the data should be event data + an rrule. For example:
    {"calendar_event":{"title":"abbbaa",
     "start_at":"2022-11-04T12:00:00-06:00",
     "end_at":"2022-11-04T13:00:00-06:00",
     "context_code":"user_1",
     "rrule": "FREQ=DAILY;INTERVAL=1;COUNT=4"}}
  - modify the series with the update api
    PUT to /api/v1/calendar_events/:event_id
    JSON with the new properties. The JSON looks just
    like the create, but with new values in there.
  > expect the returned events (or more easily, refresh
    the calendar in Canvas) to be what you expected
  > expecdt to see only 1 sql UPDATE setting the
    context's updated_at time, no matter how
    many events were updated.

Some interesting test cases
  - the invalid requests (see above)
  - which="following" with a new time
  - which="following' with a new date
  - which="following' with a new rrule
  - which="all" with a new rrule
  - a new rrule that makes the series longer
  - a new rule that makes the series shorter

Change-Id: I9fa6ed0e90887510e9f7a38575dd7aa182e7e09f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/293568
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
Reviewed-by: Jackson Howe <jackson.howe@instructure.com>
QA-Review: Jackson Howe <jackson.howe@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2022-06-15 20:58:15 +00:00
Mysti Lilla d75f7bc72f Fix purgatory for old files
refs MAT-890
flag=none

[ignore-stage-results=Flakey Spec Catcher]

Test plan
- Delete a file using the API like this
  DELETE https://<canvas>/api/v1/files/:id?replace=true
- Then in the console, find the attachment and
  restore using "resurrect_from_purgatory" and
  make sure it works and looks right
- I don't think there's a good way to test
  what happens with mixed instfs/older files

Change-Id: I2a8f506a648c704fafccab8b17620d43aab4b1dc
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/293368
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>
Migration-Review: Alex Slaughter <aslaughter@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2022-06-15 00:16:12 +00:00
Jacob Burroughs 3c5c2c06dc Allow arbitrary length bookmark names and urls
fixes FOO-2891

Change-Id: I9430b2ef463341739ac93fd0718f78c2a1e18c6e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/293834
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Alex Slaughter <aslaughter@instructure.com>
Migration-Review: Alex Slaughter <aslaughter@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
2022-06-13 16:16:10 +00:00
Paul Gray 4aaed099ac Add url to resource links
why:
Resource Links created via the RCE lti integration
include the url as a parameter. This url can be changed
by anyone, and thus a user can launch any tool by modifying
the url parameter.

This path introduces a url column to the resource links
themselves, which keeps track of the urls, so they are
not provided via a paramater that can be modified. Since
existing links are stored in the db as HTML, they will
not be migrated in this patch, and so the retrieve
endpoint will still default to the url for existing links.

In addition to populating the url column for Deep Links
created via the RCE plugin, there are other instances where
it will now be populated:

1. RCE Deep Linking
2. Assignment Deep Linking
3. Content Tag Deep Linking
4. Resource Link Importer

flag=none

fixes INTEROP-7072

test plan:
1. Create an LTI Deep Link via RCE (You can use the LTI Testing Tool)
   Ensure the link's href does not contain a url parameter, and ensure
   that the retrieve endpoint correctly redirects
2. Create an assignment via Deep Linking, and ensure it works properly
3. Create a Content item in a module via deep linking and ensure it
   works properly
4. Export a course that has a resource link, and import it,
   and ensure the resource links still work properly.

Change-Id: Icee4320ab0977f6c18db49a1afe9f588d816084f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/293521
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Migration-Review: Ben Rinaca <brinaca@instructure.com>
Product-Review: Alexis Nast <alexis.nast@instructure.com>
2022-06-13 16:03:03 +00:00
Ben Rinaca eced372060 audit pseudonym deletion
refs FOO-2959

rather than log diving when a user's login is deleted, we can record
the who and where for easy look-up.

test plan:
* create a user with multiple logins
* delete one of those logins
* find the login record in the rails console and do `.auditor_records`
  to it, you should get a record that shows you who did it, when, and
  where

flag = none
although there is a killswitch, pseudonym_auditor_killswitch, if it
needs to be turned off for some reason

[pin-commit-multiple_root_accounts=5dc6158fa2023833311a3c8f7bf037b1d517ac26]

Change-Id: I7828d0b96be4790c2cfbf92d821a371b9a290867
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/293431
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Ben Rinaca <brinaca@instructure.com>
Product-Review: Jesse Poulos <jpoulos@instructure.com>
2022-06-10 15:52:11 +00:00
Jared Crystal da774c6765 add index on assignments workflow_state
flag=none

test plan:
 - assignments table has an index on workflow_state

Change-Id: I0fe95622fb8dce8af6c77c6270a841d0e545227a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/293661
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Alex Slaughter <aslaughter@instructure.com>
Product-Review: Alex Slaughter <aslaughter@instructure.com>
Migration-Review: Alex Slaughter <aslaughter@instructure.com>
2022-06-10 15:34:15 +00:00
Ed Schiebel 683d45daa2 Recurring events: calendar_events table update
closes LS-2797
flag=none

test plan:
  - run bin/rake db:migrate RAILS_ENV=development
  - run psql canvas_development
  - in psql exec \d calendar_events
  > expect to see series_id and rrule columns
  > expect to see an index on series_id

Change-Id: Icd0fcafd18adcd0d277b92d939dd0908d98b7fbd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/293120
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>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
2022-06-06 15:28:18 +00:00
Jacob Burroughs 5dcd66d8c6 Some rails 7 tests passing
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>
2022-06-06 14:23:03 +00:00
Jeremy Stanley c28a19bc45 requeue failed job
test plan:
 - create a job that will fail
   (e.g. `delay.raise "whoops"`)
 - find the failed job in /jobs_v2 and click its id
 - scroll down to the job details table and click the
   "requeue job" button
 - the job should be requeued and the id of the requeued
   job should appear in place of the button
 - search that id and you should find the newer failed_jobs
   entry (after the requeued job fails)

flag=jobs_v2
closes DE-1194

Change-Id: I33d637db616aad1ec431428e7c5c60c6253660aa
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/292334
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>
Migration-Review: Alex Slaughter <aslaughter@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2022-05-28 00:08:22 +00:00
Alex Slaughter a03564ec41 add index for cached_quiz_lti
Change-Id: I14d94148ce5a794a9c107d545c1db8af9ac2535e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/291797
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Migration-Review: Alex Slaughter <aslaughter@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Alex Slaughter <aslaughter@instructure.com>
2022-05-13 00:36:34 +00:00
Spencer Olson a4567a6318 remove assignment visibility for inactive students
Before this change, if an assignment was assigned to a section that a
student was deactivated in AND that student had another enrollment in
the course that was active, the student would maintain visibility of
the assignment. After this change, students will no longer be able to
see assignments that are assigned to sections they are deactivated in.

closes EVAL-2262
closes QO-707
flag=none

[fsc-max-nodes=20]
[fsc-timeout=45]

Test Plan 1:
* Pre-requisites: Migrations have been run, and a student enrolled in
  two sections of the same course (A & B), and an assignment assigned
  only to the B section.

1. As the student submit to the assignment.
2. Assign a grade to the student for the assignment.
3. Go to the user page for the student (courses/:course_id/users/:id),
   click 'more user details...', and then hover over (but do not click)
   the 'Conclude this Enrollment' or 'Delete this enrollment' link for
   the section B enrollment and you should see the URL in the bottom
   left-hand side of your browser that has the enrollment ID in it
   (i.e. /courses/:course_id/conclude_user/:enrollment_id). Take note of
   the enrollment ID and then make an API request to deactivate that
   enrollment:

   DELETE <host>/api/v1/courses/:course_id/enrollments/:enrollment_id
      ?task=deactivate

4. Act as the student and verify the assignment cannot be accessed.
5. Make an API request to reactivate the enrollment:

   PUT <host>/api/v1/courses/:course_id/enrollments/:enrollment_id
      /reactivate

6. Act as the student and verify the assignment can be accessed.

Test Plan 2:
* Pre-requisities: Migrations have been run.

1. Create a course with 2 sections.
2. Create a quiz with access dates in the past assigned to only one
   section
3. Create a student in the course with an active enrollment in one
   section and an inactive enrollment in the other section
   (this should be the section assigned to the quiz). See Step 3 on
   Test Plan 1 for how to deactivate the enrollment.
4. As the student navigate to the quiz and see you do not have access
   to take the quiz. You should see a flash message that reads,
   "You do not have access to the requested quiz." and you should be
   redirected to the quizzes index page.

Change-Id: Ic00d9189ae40972fefa0352e12e137a3ac0cd73f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/289631
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
Product-Review: Jody Sailor
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Aaron Shafovaloff <ashafovaloff@instructure.com>
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
2022-05-10 21:30:34 +00:00
Xander Moffatt 270de02abe add endDateTime directly to Lti::LineItem
why:
* to conform to LTI spec by returning endDateTime
in the response of AGS create/update calls
* though the date is now stored twice (once on Assignment, once on
Lti::LineItem), there is a situation where they can be different
(set on line item that's not the primary for the assignment), even
though that wouldn't actually do anything

refs INTEROP-7265
flag=none

test plan:
* run migrations
* follow test plan from parent commit to create/update line item
using AGS API
* note that the endDateTime attribute is present in the response

Change-Id: Id3bbdd5f328476fb02fd96a005a655902fa8dac4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/291045
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: Alexis Nast <alexis.nast@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
2022-05-04 16:35:41 +00:00
August Thornton 324a3476aa account for assignment override student in user merge
It turns out when we query for effective due dates, which happens
in due_date_cacher, we fetch all students affected by adhoc overrides.
This happens with a join on AssignmentOverrideStudent, so without
accounting for such objects, we have logic that just deletes the
submission if it's not "viewable" to the target user.

fixes FOO-2773
flag = none

Test plan:
• Create an assignment and assign it to the one student with a
  due date (Assignment due date override for individual user)
  excluding the "everyone" default section scope
• Create a second user and merge the first student into the
  newly created user
• Check the submission API for the merged student and assignment
  and notice that the "cached_due_date" displays the assigned due
  date used when creating the assignment and the workflow state is
  is as it was before "unsubmitted"

Change-Id: Ic9701326a9dac0f8a44dbddfad59738032be230a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/290068
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ben Rinaca <brinaca@instructure.com>
Migration-Review: Ben Rinaca <brinaca@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: August Thornton <august@instructure.com>
2022-05-02 16:56:54 +00:00
Isaac Moore 79bf3304fd Add `secret` column to Settings
In a subsequent commit, this will allow a setting to be marked as
"secret", and its value redacted in the forthcoming Settings UI.

refs DE-1138
flag=none

test plan:
- verify the column is added, and `setting=` is successful

Change-Id: I0dfad0ea584e199828ff04fabe91964069d3e676
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/289857
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Isaac Moore <isaac.moore@instructure.com>
Product-Review: Isaac Moore <isaac.moore@instructure.com>
2022-04-25 21:07:23 +00:00
Eric Saupe bfc3956c4a Move Mastery Path to an account/course setting
fixes LS-757
flag=none

test plan
- Verify Mastery Path is no longer in Feature Options
- Verify the setting is there on the account settings
- Verify that locking it disables changing it for subaccount and courses
- Verify that with the setting on all of mastery path still works

Change-Id: I9ee1b243439eb2eefa35885ecfce0db7589fbe13
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/288418
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Jackson Howe <jackson.howe@instructure.com>
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jackson Howe <jackson.howe@instructure.com>
Product-Review: David Lyons <lyons@instructure.com>
2022-04-13 22:26:57 +00:00
August Thornton f2b33f6ec1 add granular permissions for managing course content
closes FOO-129
flag = granular_permissions_manage_course_content
[ignore-stage-results=Flakey Spec Catcher]
[pin-commit-migration_tool=81b53ef64a966e3ba68e952dcef833cc51581ebf]

Test plan:
• Exercise (Smoke Test) the following areas of Canvas:
   • Announcements
   • Assignments
   • Assignments --> blackout dates
   • Calendars
   • Collaborations
   • Conferences
   • Content Imports
   • Content Migrations
   • Viewing and deleting allowable course content i.e.
      [
        all_discussion_topics assignment_groups assignments
        collaborations context_modules enrollments groups
        quizzes rubrics wiki_pages rubric_associations_with_deleted
      ]
   • Context Modules
   • Courses - updating
   • Courses - link validation
   • Courses - visibility (LTI / K5 Dashboard student sections)
   • Courses - ability to manage concluded courses
   • Course Paces
   • Course Tabs
   • Discussion Topics
   • Wiki Pages
• Enable "Granular permissions for managing course content" FF
  • Test the same areas of Canvas above, but mixing and matching
    different permissions for allowable roles i.e. add / edit / delete

Change-Id: I59956d453e523694e0cbc34292ad2e84529fb87d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/287576
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: August Thornton <august@instructure.com>
2022-04-11 20:53:27 +00:00
Aaron Ogata 407c307bd8 allow filtering jobs by account / shard / cluster
refs DE-1048

Change-Id: I0a090f01fa40265aed7c3353f685000453bc2bc2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/288424
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2022-03-30 15:56:24 +00:00
Aaron Ogata a935e17425 improve jobs v2 query performance
refs DE-1108

Change-Id: I6537f03215a40d3789177bcd72a74435551aa6b3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/288384
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2022-03-29 18:24:06 +00:00
Aaron Ogata 0406cbb81a data fixup for removing invalid locales
refs FOO-2774

Change-Id: I0b1a6e99579ba8a64b55f636034b6dc3dbe1253f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/287550
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ben Rinaca <brinaca@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
Migration-Review: Aaron Ogata <aogata@instructure.com>
2022-03-23 14:55:53 +00:00
Eric Saupe 6ba814bed7 Refactor PacePlan to CoursePace
fixes LS-2989, LS-2988
flag=pace_plans

test plan:
- Specs should pass
- Enable the course paces account feature flag
- Enable the course paces setting on a course
- All current pacing related features should work as expected

Change-Id: Ibd1d9f3295f624a3f2411c72ad5ace9410d965ca
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/286519
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Eric Saupe <eric.saupe@instructure.com>
Reviewed-by: Robin Kuss <rkuss@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2022-03-15 19:10:16 +00:00
Jackson Howe cc5db66f80 Change type of content_shares.name to text
closes LS-3036
flag = none

Change-Id: Idf26d753b0bced34f33dc0619b693a93df8e6dd7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/286935
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
Reviewed-by: Robin Kuss <rkuss@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jackson Howe <jackson.howe@instructure.com>
2022-03-11 20:52:15 +00:00
Jacob Burroughs 7d0d80bdc8 Stop leaking siteadmin ids from spec setup
Change-Id: I9370a96eb9eb0fde8c11f0243dc0785489002a55
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/285831
Reviewed-by: August Thornton <august@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
2022-02-25 23:11:11 +00:00
balazs.komaromi 1d88e3fdb9 Add `diffing_threshold_exceeded` field to SIS Import JSON
Test plan:
 - Create SIS Import with
   diffing_data_set_identifier set
 - Create another SIS import with the same
   identifier and diff_row_count_threshold provided

When number of changes is below the threshold the
diffing_threshold_exceeded flag should be false.

When number of changes is above the threshold the
diffing_threshold_exceeded flag should be true.

When diffing_data_set_identifier does not exist,
value should not be in the response.

Closes SOS-2471

flag=none

Change-Id: Ieda0c0d6ba595ea06e6d3dd301bcc4c52268a0be
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/285844
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Tamas Nagy <tamas.nagy@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Balazs Komaromi <balazs.komaromi@instructure.com>
Product-Review: Balazs Komaromi <balazs.komaromi@instructure.com>
2022-02-25 13:07:59 +00:00
Jacob Burroughs 209cea8027 Rails 6.1 basic spec functionality
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>
2022-02-16 17:31:11 +00:00
Mysti Lilla 5a3f391baf Improve performance on backfill identity hash
refs INTEROP-7066
flag=none

Test plan
- Have two tools with the exact same set up
  for name, description, context, key, secret,
  settings, domain, url and workflow_state
- Remove their identity_hash
- Run the database migration
- One should end up with a real identity hash
- The other should end up with "duplicate"
  in their identity hash
- If you need an example, the Vimeo setup on
  eduappcenter is pretty simple
- Try with various set ups of tools that already
  have identity_hash filled in and duplicates
  of those versus tools that don't already
  have an identity_hash that are duplicates
- Should use the identity_hash index on
  large context external tools table, but
  you probably can't tell locally

Change-Id: I1b05e2cdecfd24895cb864e4234e9853290fa3b9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/284611
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2022-02-07 23:54:32 +00:00
Aaron Ogata 12b16265e9 bump inst-jobs and switchman-inst-jobs
refs DE-923

Change-Id: I3720242a11053fe7a6b3e539e159af1df5478686
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/284446
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2022-02-04 18:35:30 +00:00
Jonathan Guardado 45e50601c4 Fix wordcount in attachments being slow in large courses
This PS uses most of the work done in the previous implementation.
The main difference is the moment when the word count is calculated,
a new column was created to store this value at the moment of
saving the file, this will avoid requesting the AWS s3 bucket for
each file when loading the speed grader

flag=word_count_in_speed_grader
fixes LS-2922
test plan:
- Enable word count in speed grader flag
- In a course that has many attachments in speedgrader
- Create an assignment that requires submissions
- Submit a PDF, RTF, TXT, and DOCX file
- In speed grader, verify the word counts are present when
selecting the different files

Change-Id: I7262afe43787ffdf7859fbf2d10cd16a52521996
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/283607
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Eric Saupe <eric.saupe@instructure.com>
QA-Review: Eric Saupe <eric.saupe@instructure.com>
Product-Review: Jonathan Guardado <jonathan.guardado@instructure.com>
2022-02-03 17:37:11 +00:00
Mysti Lilla d928db987b Populate identity hash on existing external tools
fixes INTEROP-7066
flag=none

Test plan
- Have two tools with the exact same set up
  for name, description, context, key, secret,
  settings, domain, url and workflow_state
- Remove their identity_hash
- Run the database migration
- One should end up with a real identity hash
- The other should end up with "duplicate"
  in their identity hash
- If you need an example, the Vimeo setup on
  eduappcenter is pretty simple
- Try with various set ups of tools that already
  have identity_hash filled in and duplicates
  of those versus tools that don't already
  have an identity_hash that are duplicates

Change-Id: I73cf92afb3eceef190d24d169a21ffadf909577e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/282597
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2022-02-02 18:02:15 +00:00
Mysti Lilla 43976e59c1 Add identity_hash to context external tool on save
fixes INTEROP-7064

Test plan
- Save a new context external tool
- Ensure it has an identity hash field on the tool
- Save the exact same context external tool
- Ensure it says "duplicate" in the identity_hash
  field on the tool

Change-Id: I4690b64d3940d2cfd62f982821658fffb459f049
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/282138
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2022-02-02 18:01:35 +00:00
Weston Dransfield 92d13c2948 Add "category" column to attachments
refs MAT-625
flag=none

Test Plan:
- Verify you can create, edit, and delete files
  as before via the UI. UIs can be found at /courses/:id/files
  and /users/self/files.

- In a rails console, run the following:
  ```
  course = Course.find(<some course with files uploaded>)
  course.attachments.last.update!(category: Attachment::BUTTONS_AND_ICONS)
  ```
  and verify no errors are raised.

- In the same rails console, run the following:
  ```
  course.attachments.not_buttons_and_icons
  ```
  Verify the list of returned attachments does not include
  the attachment that was updated in the previous step.

Change-Id: Iab251a0de82a2a1dfcfe0cb19864957b8f440a2c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/283443
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jon Scheiding <jon.scheiding@instructure.com>
QA-Review: Jon Scheiding <jon.scheiding@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
Migration-Review: Alex Slaughter <aslaughter@instructure.com>
2022-01-25 21:55:00 +00:00
August Thornton 1b40241f20 update active global nav menu item badge background/text color
fixes FOO-2671
flag = none

Test plan:
• After checking out this patchset run:
   • `rails db:migrate`
   • `./script/nuke_node.sh`
• Using the default Themes templates found under /brand_configs
  select or ensure you're using the Default Template and navigate
  to the Global Navigation dropdown tab
   • Verify the default "Nav Badge Active" color is set to: #0374B5
   • Verify the default "Nav Badge Text Active" color is
     set to: #ffffff
• To trigger a notification badge to appear on one of the global nav
  menu items, it's easiest to just send a message via Inbox to
  the user in question that is under test. You will then be able
  to verify the badge has a white background with black text
  indicating the number of notifications needed to be read
• See associated Jira for more details and acceptance criteria

Change-Id: Iebbfd850fc5e3cdba47ee8ac145dbaa6ef799484
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/283057
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ben Rinaca <brinaca@instructure.com>
Migration-Review: Ben Rinaca <brinaca@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: August Thornton <august@instructure.com>
2022-01-18 23:23:59 +00:00
Ahmad Amireh a555e4f6d7 stop validating BrandConfig migrations at runtime
refs CORE-1981
flag = none

BrandableCSS and BrandConfig are coupled to 2 migrations for reasons
explained below. There was code introduced to validate the integrity of
these migrations at runtime, which proved very hard to troubleshoot as
code around it changed. Now one of those checks is done at build time,
the other dropped as it's not necessary.

TL;DR you need to compile the assets before migrating the DB. And if you
modify the brand variables but fail to rename the migration files, the
build will fail and tell you about it.

////////
DETAILS
\\\\\\\\

If you follow the trail of patches surrounding the now-removed code in
lib/brandable_css.rb, you will note that the intent was to behave more
friendly towards people who are:

1. modifying the default branding variables
2. setting up canvas for the first time

The case for the former is that anytime you modify a variable value,
or replace an image referenced by a variable, the BrandConfig records
in the DB must be re-generated with those new values in mind. This
process takes place in "special" predeploy and postdeploy migrations.

I say "special" because their names have semantics beyond what
ActiveRecord assigns to DB migration names: the digits in their name
denote not a date, but actually the numeric subset of a MD5 digest of
the brand default variables at the time of writing. This is now clearly
expressed in the migration files themselves. Additionally, the check for
this correspondence between the default variables and their migrations
is now done in a spec as opposed to anytime BrandableCSS is interfaced
with at runtime.

Which takes me to the second case: for BrandConfig records to be written
to the DB, we must be able to calculate that digest, possible only if we
have the fingerprints for images and other static assets, which comes
from Gulp. This makes Gulp, or in practice "rake canvas:compile_assets",
a dependency of this operation, one that is communicated already in our
documentation - both public and internal. This is no longer enforced or
checked for in the codebase.

  ___\______
~ TEST PLAN ~
  ____.

- change some variable value in app/stylesheets/brandable_variables.json
- rerun spec spec/lib/brandable_css.rb and verify it fails and gives you
  instructions on how to address the problem
- apply the instructions and verify it's ok now

reset your changes and let's test for image/static asset changes now:

- change an image like public/images/canvas_logomark_only@2x.png
- run "yarn gulp rev"
- run the test and verify it fails again

Change-Id: I957145f4cebe4e0a3d9c733206bb91ad4dbc3555
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/282579
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: Charley Kline <ckline@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
2022-01-12 21:49:30 +00:00
Mysti Lilla febdd72ba7 Sort object hash for identity
closes INTEROP-7063
flag=none

We're adding a column to context external tools
so that we can dedupe off of it.  For that, we
need a way to verify that two (potentially
deeply nested with arrays and hashes) are
the same

Test plan
- Run the database migration and make sure
  the column shows up
- On a tool, calculate the identity_hash
- Save it to the new column and make sure
  it saves correctly
- Try some tools that should be identical
  and make sure that their hashes are
  identical
- Try some tools with minute differences
  in the identity fields and make sure
  we are seeing differences in the hash

Change-Id: Ie6d15320aa7c6ccb04f760f8dd15ea513f954404
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/282071
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Mark Starkman <mark.starkman@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
2022-01-10 17:58:43 +00:00
Gonzalo Penaranda d5aa1af887 Replace CSS colors with new values
fixes MAT-525
flag=none

Test Plan 1:
 - Click on 'Admin' option and click on the user
 - Go to 'Themes' and select 'Minimalist'. It is possible
 that you need to save it with an alias before applying
 changes
 - On 'Themes', right-click on the 'Current' card for the
 applied theme. Check for the following property:
.ic-ThemeCard-status.ic-ThemeCard-status--is-active-theme
- The "background" value is #0B874B (one of the required
values)

NOTE: this also applies for the 'Apply theme' button

Test plan 2
 - Click on 'Account'
 - Right-click on the avatar element and check for the
 property --Avatar__elMgc-Color. Value is #0374b5.
 Changes apply as expected

** ADDITIONAL DETAILS **

- Considering the number of modified files, the
changes made may affect many different options
that aren't listed here, so the support and
validation from other teams related to the
nature of this fix is being requested.

Change-Id: I973a081d18fee74fa1e4f4b904760276e303b124
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/280894
Reviewed-by: Juan Chavez <juan.chavez@instructure.com>
QA-Review: Juan Chavez <juan.chavez@instructure.com>
Product-Review: David Lyons <lyons@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-12-22 20:10:56 +00:00
Aaron Ogata 1486d79784 bump inst-jobs
Change-Id: I92b3183e60f15872492921aac7f34a622dc89dd7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/281639
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
Migration-Review: Aaron Ogata <aogata@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-12-20 21:22:25 +00:00
Jeremy Stanley 27ca834869 remove unused PG <12 code paths
since we require Postgres 12 or newer, this code can be cleaned up

test plan: specs

Change-Id: I87734a43192ff4accdd9dd44bb4012c25ac8a5f1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/281526
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: 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>
2021-12-17 21:14:19 +00:00
Drake Harper 0e6d47a8de Add is_anonymous_author to discusison_entries
closes VICE-2349
flag=discussion_anonymity

Test Plan:
 - migration works

Change-Id: I4c484a7a21ac71dbea4e428116090ca2d83bb23b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/281503
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Omar Soto-Fortuño <omar.soto@instructure.com>
QA-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
Product-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
2021-12-17 20:31:52 +00:00
Drake Harper 790c57efde Add is_anonymous_author to discusison_topics
closes VICE-2348
flag=discussion_anonymity

Test Plan:
 - migration works

Change-Id: I906e698a4c6faded856d55830b022a62d5f35d8b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/281504
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Omar Soto-Fortuño <omar.soto@instructure.com>
QA-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
Product-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-12-17 20:26:16 +00:00
August Thornton 264c109df6 update default global nav menu item badge backgroud/text color
This change updates the defaults used for generating the ic-brand
global navigation menu item badge background and text colors. Due
to recent A11y contrast standards we're moving from a blue/white
to a white/black combination for background / text colors.

fixes FOO-2592
flag = none

Test plan:
• After checking out this patchset run:
   • `rails db:migrate`
   • `./script/nuke_node.sh`
• Using the default Themes templates found under /brand_configs
  select or ensure you're using the Default Template and navigate
  to the Global Navigation dropdown tab
   • Verify the default "Nav Badge" color is set to: #ffffff
   • Verify the default "Nav Badge Text" color is set to: #000000
• To trigger a notification badge to appear on one of the global nav
  menu items, it's easiest to just send a message via Inbox to
  the user in question that is under test. You will then be able
  to verify the badge has a white background with black text
  indicating the number of notifications needed to be read

Change-Id: Ia9de2cfe4398ca986af98652a5353860cd66b1b2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/281076
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
2021-12-16 18:01:00 +00:00
Jorge Arteaga 30021690da show short term quiz migration limitation message
closes QUIZ-9083

flag = none

test plan:
- import a classic quiz with migrate to NQ enabled
- wait for the import to finish
- navigate to the course
- observe that there's a message about the
limitations of the quiz migrations
- close the alert and refresh the page
- the alert should not appear again

- repeat the same process with a course copy
and a quiz migration

Change-Id: I3afe50f299cd374f17f8bccb88663b583e5928b4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279470
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
Reviewed-by: James Logan <james.logan@instructure.com>
QA-Review: Mark McDermott <mmcdermott@instructure.com>
Product-Review: Susan Sorensen <susan.sorensen@instructure.com>
2021-12-16 13:52:27 +00:00
August Thornton 5b7b65cdd2 add granular permissions for managing LTI tools
closes FOO-2397
refs FOO-2396
flag = granular_permissions_manage_lti

Test plan:
• At a root account level with the feature flag for:
  "managing LTI tools in Account or Course contexts"
  disabled
• Verify against Beta / Prod that behavior around
  permissions to add / edit / delete LTI tools remains
  unchanged
• With the feature flag *Enabled*
• Verify Manage LTI Add/Edit/Delete is on by default for
  the following role types: TeacherEnrollment, TaEnrollment
  DesignerEnrollment, AccountAdmin
• Navigate to Account or Course context settings --> Apps tab
• Verify you are unable to *Add* LTI apps via the |+App|
  button (shouldn't be visible) *without* manage_lti_add
  permission toggled on
• Verify you are unable to *Edit* LTI apps via the COG menu
  dropdown button (shouldn't be visible) *without*
  manage_lti_edit permission toggled on
    • Note: you are no longer able to edit placements, as this
      ability is tied to the manage_lti_edit permission
• Verify you are unable to *Delete* LTI apps via the COG menu
  dropdown button (shouldn't be visible) *without*
  manage_lti_delete permission toggled on
• Verify things work as you would expect with all the manage_lti
  permissions toggled on
• The only permission tied to the API is on tool creation/config,
  which uses :create_tool_manually for legacy FF off or
  :manage_lti_add for granular FF flipped on

Change-Id: I10be8d2fb88503b0d9a76a9eadc9280895048f8f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274399
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>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
2021-12-14 17:34:25 +00:00
Aaron Ogata 5b46e34869 bump inst-jobs
Change-Id: I239d454c7a292d6099bfcb5287dfaddedc71fd0b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/280778
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: Alex Slaughter <aslaughter@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
2021-12-09 20:23:01 +00:00
Rob Orton 98d0e451cf remove settings that allowed counts to run
test plan
 - specs should pass

refs VICE-1934
refs VICE-1996
refs VICE-2020
flag=none

Change-Id: I5a5629d05d1022851b89c02ddca1dc492893e6fa
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/280234
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
Migration-Review: Rob Orton <rob@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-12-03 15:19:14 +00:00
Cody Cutrer c2cba46851 RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation
[skip-stages=Flakey]

auto-corrected

Change-Id: I4a0145abfd50f126669b20f3deaeae8377bac24d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279535
Tested-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
2021-11-25 14:03:06 +00:00
Cody Cutrer e73cf9ddf4 RuboCop: Style/HashSyntax
[skip-stages=Flakey]

auto-corrected

Change-Id: I9371a61046aee6b148f89dd434114a8ba2b1188c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279533
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
2021-11-25 14:02:35 +00:00
Cody Cutrer eaca556b81 RuboCop: Style/NumericLiterals
[skip-stages=Flakey]

auto-corrected

Change-Id: I88363d87d5a70be941aa81b4ffe5306ce7506b98
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279207
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>
Migration-Review: Cody Cutrer <cody@instructure.com>
2021-11-24 23:31:34 +00:00
Cody Cutrer 9b71ed2054 RuboCop: Style/BlockDelimiters, Style/Lambda
[skip-stages=Flakey]

auto-corrected

Change-Id: I642f868d75c079e698f1fe4161bbbe419dbe1827
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279374
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>
Migration-Review: Cody Cutrer <cody@instructure.com>
2021-11-23 21:30:47 +00:00
Cody Cutrer c302dd8bc1 RuboCop: Style/SymbolArray, Style/WordArray
[skip-stages=Flakey]

auto-corrected

Change-Id: Id187ed60c5590025e780d81b85b5212f51368f27
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279196
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>
Migration-Review: Cody Cutrer <cody@instructure.com>
2021-11-23 14:30:08 +00:00
Cody Cutrer c776b6ef3a RuboCop: Style/CommentAnnotation
[skip-stages=Flakey]

auto-corrected

Change-Id: Ic82dbc22b8e63cc5f2ccb9b561cb3b9ed6628966
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279100
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>
Migration-Review: Cody Cutrer <cody@instructure.com>
2021-11-21 00:50:46 +00:00
Cody Cutrer ff99d18138 RuboCop: Style/RedundantSelf
[skip-stages=Flakey]

auto-corrected

Change-Id: I5f26ad1f8210a74c2198b514235d5134dcd0dae1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279070
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-11-20 16:41:21 +00:00
Cody Cutrer ecd0798aeb RuboCop: Style grab bag
[skip-stages=Flakey]

see .rubocop.common.yml changes for enabled cops

auto-corrected

Change-Id: Ia63a1c597c58646394b251ce81b707f32828bd4c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279010
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
2021-11-20 03:04:04 +00:00
Cody Cutrer c056882fb9 RuboCop: Style/EmptyMethod
[skip-stages=Flakey]

auto-corrected, with post review to remove unnecessary empty down methods
in migrations, and change def x(*args); end to just def x(*); end

Change-Id: Ic006bcebb0b073e6c66ed957a561c93c3d368e24
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278893
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>
Migration-Review: Cody Cutrer <cody@instructure.com>
2021-11-19 22:26:24 +00:00
Cody Cutrer c4bc112611 RuboCop: Style/MethodCallWithoutArgsParentheses
[skip-stages=Flakey]

auto-corrected

Change-Id: Idcbd419ab2196101398715e6b8cdd8d70ae5c587
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278698
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>
Migration-Review: Cody Cutrer <cody@instructure.com>
2021-11-18 23:07:30 +00:00
Cody Cutrer 4d43809cae RuboCop: Style/PercentLiteralDelimiters
[skip-stages=Flakey]

auto-corrected, with a post-review looking for multiline strings
to convert to heredocs

Change-Id: I7f7afb11edd63415cde10866822dd2ac5ba0d8be
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278669
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>
Migration-Review: Cody Cutrer <cody@instructure.com>
2021-11-18 23:05:50 +00:00
Cody Cutrer 157f0ae5d4 RuboCop: Style/RedundantPercentQ
[skip-stages=Flakey]

auto-corrected, with post review changing multiline strings into
heredocs

Change-Id: I1d4c543c936e5bf0ff5eb8bf10348652da7036c2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278652
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>
Migration-Review: Cody Cutrer <cody@instructure.com>
2021-11-18 20:26:13 +00:00
Drake Harper bdf626bc84 Add anonymous_state to discussion topic model
closes VICE-2252
flag=discussion_anonymity

Test Plan:
 - migration works

Change-Id: Ia22f62189b3993c91423c61bf8d345a39ae54264
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278612
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
Migration-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2021-11-17 21:26:39 +00:00
Cody Cutrer 9c48318a45 RuboCop: Rails/WhereEquals
auto-corrected, with post-review looking for cases where an unqualified
column would now be (incorrectly) qualified (only one found)

Change-Id: I62ef6d40ce9e7bc062db261d9c6fb9383ecd102e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278432
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-16 21:19:56 +00:00
Cody Cutrer e50edd485f RuboCop: heredocs
[skip-stages=Flakey]

Naming/HeredocDelimiterNaming and Rails/SquishedSQLHeredocs

the former was manual, the latter was automatic. I also changed
some <<- to <<~ to allow for better formatting

I also had to change comments inside squished SQL heredocs to
be block comments (since newlines are removed); searching for those
I found some multi-line strings that are better as heredocs

Change-Id: I6b138f8e32544b97df1e4c56f09ee5316cbdef9d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278184
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-16 06:36:00 +00:00
Jeremy Stanley 26fc3d406a create read-only "secondary" db user for dev/test
and activate this user while on the "secondary" in tests

Canvas uses read-only secondary database replicas, but before now,
GuardRail.activate(:secondary) had no effect in specs. The result
is that specs wouldn't catch attempts to write to a secondary,
and the error would be discovered in production, often requiring
a hotfix.

This patchset sets up a migration that creates a `canvas_readonly_user`
in the database and sets up SELECT permissions for it in each
shard's schema. (The migration does nothing in production.)

It also stubs out GuardRail in specs to run
`SET ROLE canvas_readonly_user` when activating the secondary,
and `RESET ROLE` when returning to the primary.

test plan:
 - specs pass (this PS includes specs that attempt to write to
   the secondary and verify the correct error is raised)
 - use the read-only user in development by adding the following
   to the development section in config/database.yml:

     secondary:
       username: canvas_readonly_user

   then try to write to the secondary in the rails console and
   ensure you get a permission denied error. for example,

     GuardRail.activate(:secondary) { User.create! }

   should result in

     PG::InsufficientPrivilege: ERROR:  permission denied for
     table users (ActiveRecord::StatementInvalid)

flag = none
closes LS-2818

Change-Id: Ibfa75af821eb7f5d65f6b26aea03417378ab255a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/161086
QA-Review: Isaac Moore <isaac.moore@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-10 22:21:23 +00:00
Cody Cutrer 7fdf9d7588 RuboCop: Lint
[skip-stages=Flakey]

the balance. mostly. Lint/UriEscapeUnescape is put in the pending
block because it's so touchy, and I didn't want to deal with it
right now

all manual

Change-Id: Ibeb81e013f56f160d51f7d237a9bcfe98daa1e53
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277569
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>
2021-11-09 21:42:31 +00:00
Eduardo Escobar 16c9812ba8 create endpoint for saving gradebook filters
created some api endpoints to support all CRUD
operations for saving the gradebook filter settings
in the backend.

fixes EVAL-2006
flag=none

test plan:
- create and publish a course with at least 1 teacher
  and one student.
create
  - use a HTTP client to make a POST request to
    /api/v1/courses/:course_id/gradebook_filters
    with the body
    {"gradebook_filter":
      {"course_id": :course_id, "name": "test",
      "payload": {"foo":"bar"}}
    }
  - notice the requests response returns the
    object created with no errors.
update
  - use a HTTP client to make a PUT request to
    /api/v1/courses/:course_id/gradebook_filters/
    :gradebook_filter_id
    with the body
    {"gradebook_filter":
      {"id": :gradebook_filter_id,
      "course_id": :course_id,
      "name": "other",
      "payload": {"bar": "foo"} }
    }
  - notice the requests response returns the
    object with the attributes updated and
    no errors.
show
  - use a HTTP client to make a GET request to
    /api/v1/courses/:course_id/gradebook_filters/
    :gradebook_filter_id
  - notice the requests response returns the
    object with the correct data and
    no errors.
index
  - use a HTTP client to make a GET request to
    /api/v1/courses/:course_id/gradebook_filters
  - notice the requests response returns an
    array of gradebook filters created and with
    no errors.

Change-Id: Ib8819d9c62ae536a40719078e83ef4d2b7b5c083
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275774
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2021-11-09 21:28:19 +00:00
Cody Cutrer d633baf85c bump inst-jobs
Change-Id: If817e41dec9ca56d82e753bfd11a5d7f09b5db19
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277608
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>
2021-11-09 16:10:15 +00:00
Marcus Vinicius Pompeu d97ffa57a8 Make outcome_imports endpoint aware of the parent group
closes OUT-4768
flag=improved-outcomes-management

Test plan:

  - Jenkins verifies this (API change only)

Change-Id: Ib41277d66c1e81b9d7ff7c1b94fe5a521b2552d6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274606
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Brian Watson <bwatson@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
2021-10-27 15:57:14 +00:00
Eric Saupe 023f356e85 Remove pace plans start_date column
fixes LS-2723
flag=pace_plans

test plan:
- Creating and publishing pace plans for courses, sections, and users
should create all relevant assignment overrides with correct dates
- Pace plans frontend should continue to work as expected
- Pace plans should no longer have the start_date column but should
return a start_date for the relevant context's start_at date. For example,
if the pace plan is for the user then the start_date will be the start_at
date for the user's enrollment. Course section pace plans return the
course_section.start_at. The fallback for all start_at is the course's
start_at date.

Change-Id: Iffce86bd0eca65a4f51db5f88e2b35833b7bc1f1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276317
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: Eric Saupe <eric.saupe@instructure.com>
2021-10-20 21:57:54 +00:00
Omar Gerardo Soto-Fortuño 25ecbd523f Create notification preference for Reported Reply
fixes VICE-2010

flag=none

test plan:
  - Go to Account -> Notifications.
  - Make sure you see Reported Reply below
      New Mention ONLY if your user is a teacher.
  - By default it should be on notify immediately.

qa risk: low

Change-Id: I2c11085d68e0d35bdf7446c90975d0f5b207b15e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275514
Reviewed-by: Davis Hyer <dhyer@instructure.com>
QA-Review: Davis Hyer <dhyer@instructure.com>
Product-Review: Davis Hyer <dhyer@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-10-15 16:42:05 +00:00
Omar Gerardo Soto-Fortuño dbd6503886 Add report_type to DiscussionEntryParticipant
fixes VICE-2071

flag=none

test plan:
  - Specs pass

qa risk: low

Change-Id: I73564d485864a585111c6480bbaff4726cc2e343
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275406
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2021-10-14 19:12:30 +00:00
Ethan Vizitei ab0488d753 make plugin zeitwerk compatible
closes FOO-2463
flag=none

TEST PLAN:
  1) specs pass

Change-Id: I0f8a9adf6a4f37192b076be7f5f5182a1c7c7173
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275466
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2021-10-08 17:20:38 +00:00
Ethan Vizitei b72cd379c8 make datafixup classes zeitwerk compatible
closes FOO-2461
flag=none

TEST PLAN:
 1) specs pass

Change-Id: I5f997c721f7ce560af245397d0a76ec419cca76b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275460
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2021-10-08 12:57:11 +00:00
Cody Cutrer 533c3387a9 bump inst-jobs
Change-Id: I1b49f421a6f08b507c6152174cda004f6da76d57
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274869
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>
2021-10-07 20:20:27 +00:00
Adrian Packel a79d13a1f5 Add LTI fields to submission drafts
Add several fields to submission drafts to facilitate saving LTI launch
submissions, and allow drafts to be of the type basic_lti_launch. (To
avoid breaking the new workflow, we don't yet let drafts with this type
be saved as actual submissions.)

To avoid accumulating content from a potentially infinite number of
external tools, a draft may only contain data from a single external
tool at a time. This is fine since drafts of this type will be a link to
work done somewhere else, rather than local work that could be lost.

closes EVAL-1998
flag=assignments_2_student

Test plan:
- Test that the migration works
- Smoke test creating and submitting a draft with one of the existing
  types in the UI to make sure nothing has broken

Change-Id: I2f9d66af5f479812177d47aa1b925fbecbd95d97
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275253
QA-Review: Adrian Packel <apackel@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
2021-10-07 18:23:01 +00:00
Cody Cutrer 6e04277c3a add declared_user_type
closes FOO-2318, FOO-2319, FOO-2320

test plan:
 * verify that /api/v1/users/self/logins includes the declared_user_type
 * use PUT /api/v1/users/self/logins/:id to update the declared_user_type;
   verify it changes

Change-Id: I1e43ab6ead5515b113b1949bdda544b2b5c6834f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273647
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-30 21:51:07 +00:00
Cody Cutrer b973c7ca27 RuboCop: Style/ParenthesesAroundCondition
[skip-stages=Flakey]

(auto-corrected)

this complements Lint/AssignmentInCondition

Change-Id: I8e621631cb8565cc6062398cfab714f61b485cad
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274747
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-30 12:59:18 +00:00
Cody Cutrer 4e7832206d rubocop: ignore extant migration errors
Change-Id: I86dc7240489669f3bac4820898b674fc85146f29
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274525
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-29 03:18:30 +00:00
Cody Cutrer 6f6fead3ba bump inst-jobs
for updated trigger with condition to make the query lots faster

Change-Id: I6c56e1d5c5856f537fdb66b41ee82c7dfcf187ca
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274677
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>
2021-09-28 19:39:56 +00:00
Cody Cutrer fe29b5cb34 RuboCop: Lint/AssignmentInCondition config, db and doc
Change-Id: I95317f45626ccc6cd7efcd17abb93aeb7e3a50f3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274583
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-28 03:33:05 +00:00
Cody Cutrer d93722cffe RuboCop: Layout db
Change-Id: Ief74cf9f6aae31e77f7262d83e2541d7ee706e4c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274071
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-22 16:01:55 +00:00
Rob Orton 55cd9a830c create discussion_entry_drafts
this just creates a table and associations. You could create objects via
rails console, but there is no interaction yet. test will be covered in
the following commits that are creating and consuming the data.

test plan
 - migrations should run
 - canvas should boot

refs VICE-2079
flag=none

Change-Id: I935a6247b5a1f11c669585cf00cfaee36da684ab
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273940
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Matthew Lemon <mlemon@instructure.com>
QA-Review: Matthew Lemon <mlemon@instructure.com>
Product-Review: Matthew Lemon <mlemon@instructure.com>
2021-09-21 22:08:53 +00:00
Cody Cutrer e9d63396ff rubocop: split configuration
* remove spurious .rubocop.yml override files
 * split the configuration into an enforced and optional
 * run both configurations in jenkins (may result in some duplicate
   comments at different levels)
 * auto-correct the enforced configuration in the pre-commit hook
 * fix comments for Gemfile.d and the root dir; enforced configuration
   is only applied to that directory for now

Change-Id: I8da21073d74e19138b1b580d66c7aae6465348d4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273898
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-21 16:02:22 +00:00
Cody Cutrer a6188928a9 bump inst-jobs
Change-Id: I14a8b40edc799e19418e38f998986201124272f8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273868
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-18 15:55:49 +00:00
Cody Cutrer e41dc9167f remove debug logging from trigger
Change-Id: I331d25dccf1363c4d2449292e581253cf6c0aaa3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273732
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-09-16 22:24:55 +00:00