Commit Graph

1987 Commits

Author SHA1 Message Date
Wagner Gonçalves 1eb9475aad persist resource_link_lookup_uuid at homework submission
closes INTEROP-6315, INTEROP-6319
flag=none

test plan:
* Have an LTI tool installed with homework submission and RCE editor
  placement enabled;
* Have a Course recorded;
* Have a Student enrolled to this Course;
* Have an Assignment recorded to this Course;
* Have LTI links added to the RCE editor in that assignment (later,
  we'll check if this link still working because we're changing the
  resource_link_lookup_id to resource_link_lookup_uuid LTI tool launch
  parameter)
* As a Student you should be able to access the Assignment to submit your
  homework. At the submission homework page you should be able to find
  LTI tool (usually rendered in a tab);
* Specify the custom params do you want to record, and submit it from the
  tool. You can add some comment too, and click to the submit assignment
  button;
* When accessing the Submission Details page you should be able to see
  that the tool was launched. At this point, the tool is launched via m
  eta refresh tag  https://www.w3.org/TR/WCAG20-TECHS/H76.html.
  You can check the application logs to see that a request was performed
  with resource_link_lookup_uuid parameter and you could check that the
  custom claim contains all custom params specified in the previous step;
* As a Teacher/SiteAdmin when accessing the SpeedGrader via Gradebook
  page you should be able to acces the homework submission via tray.
  After selecting the desired student you should be able to see the tool
  launched via iframe and the src URL should have the
  resource_link_lookup_uuid (I did this by inspecting the HTML elements)
  parameter. You should check if the custom claim has all expected
  parameters;
* You can Re-Submit a homework with different custom params to check
  that the custom claim was changed and was generate a new resource link
  (resource_link_lookup_uuid);
* Check if the LTI links added to the RCE editor still working;
* Add new links to the RCE editor and check if is working as expected;

[fsc-timeout=30]

Change-Id: I00c2bcdc02c7a5134efff1deff836657071067fa
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256716
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
Product-Review: Karl Lloyd <karl@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
2021-02-19 17:58:11 +00:00
Weston Dransfield 1499dfd03c Support custom params at collaborations placement
Closes INTEROP-6440,INTEROP-6441
flag=none

Test Plan:
- Use a 1.3 tool to do a deep linking response
  at the `collaborations` placement that includes
  custom parameters
- Verfy a collaboration is created
- Verify clicking on the collaboration launches the
  tool and includes the custom parameters
- Check for regressings with LTI 1 by creating a
  collaboration via an LTI 1 content item selection
  response

Change-Id: I935bdd38802f4d4204c494d6139cf8d5147fe806
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/257063
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Wagner Goncalves <wagner.goncalves@instructure.com>
QA-Review: Wagner Goncalves <wagner.goncalves@instructure.com>
Product-Review: Karl Lloyd <karl@instructure.com>
2021-02-19 17:56:47 +00:00
Wagner Gonçalves c836fea722 part 4: change lookup_id and resource_link_id to UUID datatype
This is part 4 of changing the datatype from varchar to UUID of
lookup_id and resource_link_id from lti_resource_links. We're removing
the old columns and add a not null constraint to the new columns.

refs INTEROP-6488
flag=none

test-plan:
* Before running the migration, you should create assignments with
  an external submission tool and persist the custom params, as we did
  here https://gerrit.instructure.com/c/canvas-lms/+/256029 to check
  later if everything is working fine;
* You should execute the migration and none errors should be raised;
* You should check if LTI is launching as expected in the assignments
  created before;
* You should check if the tool is saving the resource link properly for
  new assignments;

Change-Id: Ibfe43519462eaae88aee00de2ca307df111fc7d5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/258268
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Wagner Goncalves <wagner.goncalves@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
2021-02-18 17:47:51 +00:00
Augusto Callejas 92e03a64cd Allow reassignment from SpeedGrader
closes OUT-4033

[fsc-timeout=50]

flag=reassign_assignments

This feature allows teachers to reassign an assignment
to a student after they've submitted to the assignment
and the teacher has provided feedback via comments.

The reassignment will appear in their planner with
a "Redo" tag visible next to the assignment.

Only supports assignments of submission type "Online".

test plan:
  - enable "Reassign Assignments" feature option
  - in a course, create a student account
  - as a teacher, create an assignment with a due date
  - as a student, confirm the assignment appears in
    their planner
  - as a student, submit to the assignment
  - as a teacher, open the submission in SpeedGrader
  - reassign the assignment to the student by:
    * adding a comment to the assignment
    * clicking the "Reassign Assignment" button
  - as a student, confirm the assignment appears
    with a "Redo" pill in the planner, along with
    the comment from the teacher
  - as a student, resubmit to the assignment and
    confirm the assignment shows as completed again
    in the planner without the "Redo" pill
  - repeat the above steps, except with an assignment
    that has "Anonymous Grading" enabled and it should
    behave in the same way
  - repeat the above steps but with more students and
    no due date on the assignment, but with various
    assignment overrides with due dates and some students
    assigned to those overrides (using course sections)
    and confirm the "Resassign Assignment" button only
    appears for those students with assignment overrides
    (and hence due dates), with the button being disabled
    until the student both submits to the assignment and
    the teacher has provided a comment.

Change-Id: Id745b50f3810378804e0728e544ebf6bff8f756a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251663
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
Product-Review: Jody Sailor
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
Reviewed-by: Pat Renner <prenner@instructure.com>
2021-02-17 00:28:25 +00:00
Simon Williams a048d65b2e create granular manage student permissions
refs FOO-165
flag=granular_permissions_manage_users

test plan: turning on the flag should show add/remove student
permissions. They are not functional yet. Note that "Manage Students"
will also still be visible for now.

Change-Id: Ifea19f6153decbbf1703d7a044a0b11eab9ad554
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/258629
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: August Thornton <august@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: August Thornton <august@instructure.com>
2021-02-15 17:53:14 +00:00
Mysti Lilla 877a7f7905 Fix attachment root_accounts for assessment question context
fixes OUT-4196
flag=none

Test plan
- Set up an attachment on a question bank
  (account and course, maybe?) and set the
  root_account_id on the attachment to 0
- Run the migration and ensure the root_account
  gets set correctly for the assessment_question's
  root account

Change-Id: I02f7cefc161368d4760135464da01c3ab2d6359d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/257985
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
2021-02-12 16:38:55 +00:00
Wagner Gonçalves 005e90871c part 3: change lookup_id and resource_link_id to UUID datatype
This is part 3 of changing the datatype from varchar to UUID of
lookup_id and resource_link_id from lti_resource_links.

We start to read from the new columns created lookup_uuid and
resource_link_uuid.

Adding a migration to remove the not-null constraint of lookup_id and
resource_link_id columns. As part 3.1 we'll stop writing into these
columns, we need to execute this postdeploy migration at this point.

refs INTEROP-6488
flag=none

test-plan:
* specs should pass;
* you should check if LTI is launching as expected, and if the custom
  params was expanded as expected in all records that were created in the
  part 1 and 2;
* you should be able to new persist custom params, for example you can
  use the RCE editor placement;
* you can follow the test-plan:
    * https://gerrit.instructure.com/c/canvas-lms/+/256029
    * https://gerrit.instructure.com/c/canvas-lms/+/254453

[fsc-timeout=30]

Change-Id: I401f53a82f4dbef66c45932eb2eed8727488313d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/258246
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Wagner Goncalves <wagner.goncalves@instructure.com>
2021-02-11 18:02:20 +00:00
Wagner Gonçalves 20f555c08c part 2: change lookup_id and resource_link_id to UUID datatype
This is part 2 of changing the datatype from varchar to UUID of
lookup_id and resource_link_id from lti_resource_links.

We're adding a data fixup to fill the new columns `lookup_uuid` and
`resource_link_uuid`. In case, the value of the related columns
`lookup_id` or `resource_link_id` is invalid we'll generate a new UUID
and set the related columns as the same value to keep consistency.

refs INTEROP-6488
flag=none

test-plan:
* Before you apply the new migrations you should create some resource
  links records and keep sure that `lookup_uuid` and `resource_link_uuid`
  fields has nil value and `lookup_id` and `resource_link_id` fields has
  invalid value;
* You should be able to execute the migration and it should works fine
  without raising exception;
* You should check for those records created before, if lookup_uuid has
  the same value of resource_link_id and if resource_link_uuid has the
  same value of resource_link_id;

Change-Id: I34ebd3368e70cd1166349981e30e9bc9beaa197c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/257953
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Wagner Goncalves <wagner.goncalves@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
2021-02-05 18:29:49 +00:00
Wagner Gonçalves e083f3fcd4 part 1: change lookup_id and resource_link_id to UUID datatype
This is part 1 of changing the datatype from varchar to UUID of
lookup_id and resource_link_id from lti_resource_links. We're adding the
new columns lookup_uuid and resource_link_uuid.

refs INTEROP-6488
flag=none

test-plan:
* specs should pass;
* you should check if LTI is launching as expected;
* you should check that the tool is saving the resouce link properly,
  and lookup_uuid should be the same value of lookup_id,
  and resource_link_uuid should be the same value of resource_link_id;
* you can follow the test-plan:
  * https://gerrit.instructure.com/c/canvas-lms/+/256029
  * https://gerrit.instructure.com/c/canvas-lms/+/254453

Change-Id: Ie19b64e48cb407e53459c26d901f9e922e548d65
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/257852
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Wagner Goncalves <wagner.goncalves@instructure.com>
2021-02-05 16:55:29 +00:00
Stef Schenkelaars 77ffd0875f Fixed typo in data migration
During the update of the send_later syntax, a typo was introduced in the split user preferences data migration.
This commit fixes that typo so the migration will run again.

Closes: gh-1808

Test plan:
- Check out the code before the introduction of this migration
- Ensure you have filled your database with at least one user
- Check out the code including this new migration
- Run the migrations and check that there are no errors

flag=none

Change-Id: Ic326bc4536646af98fcf03d3db893ffa7424adcf
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/258245
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Alex Slaughter <aslaughter@instructure.com>
Product-Review: Alex Slaughter <aslaughter@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-02-05 15:32:45 +00:00
August Thornton 018c34044d remove granular permissions for course sections FF
closes FOO-1552
flag = none

test plan:
 • permissions around course_sections function as they did before,
   but now they are granularized and permanent

Change-Id: I5918a4c6ccce2ccaaf87d4b92772c31ad3e6280c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/257619
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>
2021-02-01 16:14:42 +00:00
August Thornton 940f47ec07 add granular permissions for course files
Note: we'll want to re-run the data fix-up when we're ready to turn
on the feature flag permanently; in hopes to capture any differences
made to course files permissions between now and then.

Modified the files_controller quota and api_quota permission checks
to make them more lenient in regards to accepting any or all of the
files permissions role overrides. This allows legacy grouping and
new granularized files permissions to live in harmony and be modified
without causing unauthorized errors on the quota resource.

This commit will cover the backend permissions required to granularize
files / folders permission calls, however there will be a follow-up
ps to clean up the course file page to hide elements the user might
not be authorized to use.

closes FOO-130
refs FOO-1501
flag = granular_permissions_course_files
[fsc-max-nodes=18]
[fsc-timeout=30]

Test Plan:
  - Run the migration and make sure there are no errors
  - With the granular_permissions_course_files FF turned off,
    course sections and REST API should work the same with this patch
    set checked out as it does in beta/production
  - Some things to check:
    * How it acts as a teacher, student, and public user
      in course files/folders and personal files/folders
      with the various settings above toggled to different states
    * How it acts as a teacher, student, and public user
      in discussions, modules, content migrations/import/exports
      (RCE should behave similarly throughout the site)
  - With the granular_permissions_course_files feature flag turned on
    course files/folders and REST API should work as expected. The same
    list checked above should be done so again, but this time:
    * Should only be able to upload or add folders if the
      Course Files - add permission is enabled for the user's role
    * Should only be able to manage file access, usage rights, move,
      or rename course files/folders if the Course Files -
      edit permission is enabled for the user's role
      • Check Toolbar header at the top of Course files
      • Check Cog (hamburger menu) to the right of each file/folder
      • Check Usage Rights Indicator under usage rights column
        that can be found in course and group file pages. This can
        be enabled under course settings if not available
    * Should only be able to delete course files/folders if the
      Course Files - delete permission is enabled for the user's role
    * Any given user/role should have full access to their respective
      personal files/folders regardless of granted permissions. The
      same also applies to a group context with some caveats
      • Should not be able to modify file access in a group context
      • Should not be able to modify usage rights in personal files
    * A student enrollment not granted any file permissions (the default)
      should only be able to _view_ and _download_ files unless granted
      additional access from an authorizing role
    * REST API works as expected
    * UI works as expected with no additional javascript errors

Change-Id: Ieb2d10915c274959e8da4c623f7aba11d3540c2b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/253777
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: August Thornton <august@instructure.com>
Reviewed-by: Michael Ziwisky <mziwisky@instructure.com>
2021-01-27 17:02:38 +00:00
Cody Cutrer 885e009da9 Account.site_admin may not exist on a new db
Change-Id: I4b60cb9509371338775aab6d848baa9b17ab51b7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256515
Reviewed-by: Ryan Norton <rnorton@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-01-12 02:40:14 +00:00
Cody Cutrer e5aec36e36 rails 6: update_all doesn't accept AR objects anymore
Change-Id: Ie8739b0b168dd1ee485f34637656e516ce3c16b0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256441
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-01-11 22:24:00 +00:00
Mysti Lilla 253243d8ad Don't try to delete content tags with no context
flag=none
fixes INTEROP-6443

Test plan
- Specs pass
- Migration runs

Change-Id: I0a215fe41d02117a40a39d6e11a6e4ae17145bb2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256283
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
Reviewed-by: Tucker Mcknight <tmcknight@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
2021-01-08 19:33:33 +00:00
Charley Kline d0693ea69c Turn off transactions for granular admin users migration
Refs FOO-171
flag = none

There's no reason this migration has to tie everything up by
running in a transaction

Test plan:
* this makes more sense

Change-Id: Ib489616235c5797dc6ebb48b8a21fd81a5f2c89e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256270
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-01-07 23:10:10 +00:00
Charley Kline 8dab0c9cf0 Tweak the admin users in courses permission groups
Refs FOO-171

After some discussion with Product, it was decided to
redo the way that the "manage admin users" permission
gets broken up into granulars and groups.

Test plan:
* You now have four group permissions for managing all
  non-student enrollments (Teacher, TA, Designer,
  course Observer)
* You agree that the text on the permisisons page for
  these is self-explanatory and correct.

Change-Id: I7765e2256a5a207014a6cf83b3902f9b2543985d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/255397
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
2020-12-22 00:34:08 +00:00
Caleb Guanzon ac7e9136e9 migration: AddReplicaIdentityForWebConferenceParticipants
flag=none
refs VICE-972

TEST PLAN:
- migration works
- tests pass

Change-Id: Idf13e524722e290b83c13059dfb8911a7f003a7c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/255338
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>
2020-12-16 19:55:43 +00:00
Caleb Guanzon 92a3cb6f61 migration: AddReplicaIdentityForWebConferences
flag=none
refs VICE-972

TEST PLAN:
- migration works
- tests pass

Change-Id: I2e0215eebc0cba0890c9977703b9ff746fa9e22e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/255337
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>
2020-12-16 19:52:41 +00:00
Caleb Guanzon d667711d4b migration:AddReplicaIdentityForDiscussionTopicParticipants
flag=none
refs VICE-972

TEST PLAN:
- migration works
- tests pass

Change-Id: I911f89555a262fc9fce2cc180601563575cb2981
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/255360
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>
2020-12-16 19:22:34 +00:00
Caleb Guanzon 8fa8b4950c migration:AddReplicaIdentityForDiscussionEntryParticipants
flag=none
refs VICE-972

TEST PLAN:
- migration works
- tests pass

Change-Id: I7f44ff027e29e901d10ba9d089d64a5f39cac3a5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/255224
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>
2020-12-16 18:47:10 +00:00
Caleb Guanzon 184d199489 migration: AddReplicaIdentityForDiscussionTopics
flag=none
refs VICE-972

TEST PLAN:
- migration works
- tests pass

Change-Id: I643bd7a03cdc980823e3f4b8c85d7ea2760cc387
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/255222
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>
2020-12-16 17:11:07 +00:00
Caleb Guanzon eed674bec1 migration: AddReplicaIdentityForFolders
flag=none
refs VICE-972

TEST PLAN:
- migration works
- tests pass

Change-Id: I4ae26cb026a525d819ececdc0f42b9b811b500ab
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/255240
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>
2020-12-16 16:19:15 +00:00
Caleb Guanzon bcc85793cc migration: AddReplicaIdentityForDiscussionEntries
flag=none
refs VICE-972

TEST PLAN:
- migration works
- tests pass

Change-Id: I80ca68f26d14f4fc66a46d3b4ecdf5e9cf4499f3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/255223
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>
2020-12-16 16:19:04 +00:00
Caleb Guanzon a7870c51c9 migration: AddReplicaIdentityForGroupCategories
flag=none
refs VICE-972

TEST PLAN:
- migration works
- tests pass

Change-Id: I8784d40a208d316121a50f68123dee40935aa5c0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/255210
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>
2020-12-16 16:18:52 +00:00
Caleb Guanzon 07d4ae57be migration: AddReplicaIdentityForGroupMemberships
flag=none
refs VICE-972

TEST PLAN:
- migration works
- tests pass

Change-Id: Ib13603e8beb9c8ea68f1fc0995e563734bdd3f7d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/255212
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>
2020-12-15 19:35:14 +00:00
Caleb Guanzon 66e52826e7 migration: AddReplicaIdentityForGroups
flag=none
refs VICE-972

TEST PLAN:
- migration works
- tests pass

Change-Id: Iaaa11fee80888b25584fce147380cdf63a3a59fa
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/255214
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>
2020-12-15 19:33:56 +00:00
Caleb Guanzon 8c919a3a4d migration: AddReplicaIdentityForFavorites
flag=none
refs VICE-972

TEST PLAN:
- migration works
- tests pass

Change-Id: Ieded227477205995f69a6265b1e05061af870550
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/254943
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>
2020-12-15 17:15:16 +00:00
Wagner Gonçalves 35c5b2c39e add custom fields to lti resource link
We're adding context_id, context_type, custom and lookup_id fields to
lti resource link. And, we're providing a datafixup service to fill
the new fields properly.

closes INTEROP-6309
flag = none

test plan:
* first of all, you need to apply the migrations to the database by:
rake db:migrate;
* check that the context_id, context_type, custom, and lookup_id columns were
created properly;
* check that if the indexes were created properly by:
  * SELECT indexname, indexdef FROM pg_indexes WHERE
    indexname = 'index_lti_resource_links_by_context_id_context_type' OR
    indexname = 'index_lti_resource_links_on_lookup_id';
* check that if the `NOT NULL` constrain were applied properly:
  * SELECT column_name, is_nullable FROM information_schema.columns
    where table_name = 'lti_resource_links';
* check if current lti resource links attributes were filled properly;
* Into the Course context, you should be able to add a new Assignment using
External Tool as the Submission Type without errors (you could use the LTI test
the tool previously installed);
* at the end you just need to check if our migrations are reversible by:
rake db:rollback STEP=5 (the current step of all migrations related to this
change);

Change-Id: I8a80ebad31462f0df860583c3d64d663085948b4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/253841
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Karl Lloyd <karl@instructure.com>
2020-12-14 17:37:45 +00:00
Mysti Lilla 3712a4c1de Set up replica identity index for lti line items
closes INTEROP-6356
flag=none

Test plan
- Verify that the replica identity index has been
  created
- Verify the replica identity for lti_line_items
  has been set to index (SELECT relname, relreplident
  FROM pg_class WHERE relname = 'lti_line_items';)
- Ensure the old root_account_id index has been
  removed for the table

Change-Id: I93b89f9b3c848f0902f5db71252a360962974431
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/253274
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2020-12-11 23:08:02 +00:00
Mysti Lilla 6a53b0fcd3 Set up replica identity index for DK account bindings
closes INTEROP-6364
flag=none

Test plan
- Verify that the replica identity index has been
  created
- Verify the replica identity for developer_key_account_bindings
  has been set to index (SELECT relname, relreplident
  FROM pg_class WHERE relname = 'developer_key_account_bindings';)
- Ensure the old root_account_id index has been
  removed for the table

Change-Id: I5a85804a14ec2dbb6b3fbc71dda914bf5c0603ea
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/253775
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2020-12-11 23:05:20 +00:00
Mysti Lilla bc0e2b48ac Set up replica identity index for lti resource links
closes INTEROP-6355
flag=none

Test plan
- Verify that the replica identity index has been
  created
- Verify the replica identity for lti_resource_links
  has been set to index (SELECT relname, relreplident
  FROM pg_class WHERE relname = 'lti_resource_links';)
- Ensure the old root_account_id index has been removed
  from the table

Change-Id: Idbf81d9ce933472442957264d20be69f4756a918
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/253276
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2020-12-11 22:42:55 +00:00
Mysti Lilla b2f0f6a6b1 Set up replica identity index for content tags
closes INTEROP-6243
flag=none

Test plan
- Verify that the replica identity index has been
  created
- Verify the replica identity for context_external_tools
  has been set to index (SELECT relname, relreplident
  FROM pg_class WHERE relname = 'content_tags';)

Change-Id: Ib67ad6ef5360b259673fe646a26625ae4edb057c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/252748
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2020-12-11 22:42:04 +00:00
Mysti Lilla a46cb7df7d Change plagiarism subscriptions to be tool proxy guid
fixes INTEROP-6354
flags=none

Test plan
- Set up a tool proxy with live events
- Ensure the live events that get sent
  have the appropriate associated integration id
- Ensure that the subscriptions are getting created
  with the appropriate associated integration id
- Ensure the data fixup corrects the subscriptions

Change-Id: Icdd82b42ead45eadc5b9456a66c52eedb23d6be5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/253160
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2020-12-11 22:32:19 +00:00
Mysti Lilla a963c18185 Set up replica identity index for originality reports
closes INTEROP-6239
flag=none

Test plan
- Verify that the replica identity index has been
  created
- Verify the replica identity for context_external_tools
  has been set to index (SELECT relname, relreplident
  FROM pg_class WHERE relname = 'originality_reports';)

Change-Id: I92d53283a1e7a4d69aaa2df2c7d606ea113c3ad8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/252930
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Wagner Goncalves <wagner.goncalves@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2020-12-11 18:57:10 +00:00
Mysti Lilla f242522577 Set up replica identity index for developer keys
closes INTEROP-6363
flag=none

Test plan
- Verify that the replica identity index has been
  created
- Verify the replica identity for developer_keys
  has been set to index (SELECT relname, relreplident
  FROM pg_class WHERE relname = 'developer_keys';)
- Ensure the old root_account_id index has been
  removed for the table

Change-Id: I1d736cf975b9f47c3024144c23c5d0b650a670d5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/253774
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Wagner Goncalves <wagner.goncalves@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2020-12-11 18:56:44 +00:00
Mysti Lilla cb95b3d269 Set up replica identity index for lti results
closes INTEROP-6242
flag=none

Test plan
- Verify that the replica identity index has been
  created
- Verify the replica identity for context_external_tools
  has been set to index (SELECT relname, relreplident
  FROM pg_class WHERE relname = 'lti_results';)

Change-Id: I24c387378fab0bdc93d92657b3f5e51bcad0b35a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/252933
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Wagner Goncalves <wagner.goncalves@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
2020-12-11 18:56:19 +00:00
Spencer Olson 5885cbecd9 add workflow_state to rubric_associations
Adds a workflow_state column to rubric_associations and backfills
all records to be 'active'. Support for soft-deletion (and the
'deleted' state) will be added later.

closes EVAL-1325
flag=none

Test Plan:
1. Before checking out this commit, on master, create a rubric and use
   it to grade a few students for an assignment. This will result in
   some rubric_associations records getting created.
2. Check out this commit and run migrations.
3. Check that the rubric_associations table now has a workflow_state
   column, with a default of "active" and a NOT NULL constraint.
4. Check that every rubric association record has workflow_state set
   to "active".
5. Create a new rubric association (you can do this by grading a new
   assignment with an existing rubric). Check that the newly-created
   rubric association has its workflow state set to "active".

Change-Id: Ib7a4874f3918b2f0d18a490c5b942a34804bf5ce
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/253663
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
Reviewed-by: Syed Hussain <shussain@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
2020-12-08 17:32:35 +00:00
Pat Renner fcfe6fe18e add outcome_friendly_description model
closes OUT-4017
flag=none

Test plan:
- run migrations
> dc run --rm web bundle exec rake db:migrate
- open rails console
- create a learning outcome if you dont already have one in
your account
- verify you can create a friendly description
OutcomeFriendlyDescription.create! context: Account.default,
description: 'great!', learning_outcome: LearningOutcome.first
- verify you can create one friendly description
per context and learning outcome
  > create a second learning outcome if you dont have one
in your account
  > via the rails console:
 OutcomeFriendlyDescription.create! context: Account.default,
description: 'great!', learning_outcome: LearningOutcome.last
 > confirm a RecordInvalid error is not raised

Change-Id: I65f2771bf46312e1ea4b4120eed714c7814dcd91
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/253751
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Pat Renner <prenner@instructure.com>
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
2020-12-07 16:48:23 +00:00
Mysti Lilla 3812d21600 Set up replica identity index for context external tools
closes INTEROP-6237
flag=none

Test plan
- Verify that the replica identity index has been
  created
- Verify the replica identity for context_external_tools
  has been set to index (SELECT relname, relreplident
  FROM pg_class WHERE relname = 'context_external_tools';)

Change-Id: Ic9540381a82a1f10b8f930f40bf90b1fdf370aa9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/252622
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Wagner Goncalves <wagner.goncalves@instructure.com>
QA-Review: Wagner Goncalves <wagner.goncalves@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2020-11-25 22:39:43 +00:00
Rob Orton e97a058aa6 Revert "handle overrides for students concluded in section"
This reverts commit 7440be62db.

Reason for revert: The makes concluded enrollments inconsistent,
solving the problem that this meant to fix from the sis import
side, see 02bf0ae6b8

fixes FOO-1153
flag=none

Change-Id: Iec597760abc3e8b7968babdcdac7643812fe3510
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250672
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Caleb Guanzon <cguanzon@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Caleb Guanzon <cguanzon@instructure.com>
2020-11-24 21:23:42 +00:00
August Thornton 9df3026063 Add granular permissions for course sections
Note: we'll want to re-run the data fix-up when we're ready to turn
on the feature flag permanently; in hopes to capture any differences
made to course section permissions between now and then.

fixes FOO-131
flag = granular_permissions_course_sections

Test Plan:
  - Run the migration and make sure there are no errors
  - With the granular_permissions_course_sections FF turned off,
    course sections and REST API should work the same with this patch
    set checked out as it does in beta/production
  - Some things to check:
    * How it acts as a teacher, student, designer, and public user
      in the course with the various settings above toggled to
      different states
  - With the granular_permissions_course_sections feature flag turned on
    course sections and REST api should work as expected. The same list
    checked above should be done so again, but this time:
    * Should only be able to Add course sections if the
      Course Sections - add permission is enabled for the users type
    * Should only be able to edit course sections if the
      Course Sections - edit permission is enabled for the users type
    * Should only be able to delete course sections if the
      Course Sections - delete permission is enabled for the user type
    * That the REST API works as expected
    * That the UI works as expected

Change-Id: Ia79a020e9b02c9362f837d146910707f830d2f47
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/253107
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
2020-11-20 19:09:47 +00:00
Charley Kline 9831b444e0 Create new "Manage course admin roles" granulars and FF
Refs FOO-171
flag=granular_permissions_manage_admin_users

Creates the granular permissions for adding and removing teachers,
course designers, and TAs in courses. The granulars and group are
behind a root-account feature flag for now.

Test plan:
* Make sure the migration runs error-free
* UI looks the same as it used to with the feature flag off
* New granular permissions show up in the UI with the FF on
  (note that they will not actually work yet)
* I'd welcome suggestions for better wording of the text
  for the granulars on the permissions page

Change-Id: Ia11859f0cb69084606fb0c4cef5174cbb223cce7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/248227
Reviewed-by: August Thornton <august@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: August Thornton <august@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-11-20 00:50:45 +00:00
Rob Orton 15167548bd fix media folder migration
this was hitting a unique constraint violation because it was also
trying to update deleted folders to be hidden. Also running this on
beta took a couple of minutes, so decreased batch size and now it is
a few seconds per batch.

test plan
 - migration should run

fixes VICE-979
flag = none

Change-Id: Icd892ec2e1e8fd1742b9f1916071cad0cd4417ba
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/252643
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Caleb Guanzon <cguanzon@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Caleb Guanzon <cguanzon@instructure.com>
2020-11-12 16:23:08 +00:00
Evan Battaglia 494207756c Populate root_account_id if only 1 root account
i.e., open-source Canvas users.

Test plan:
- ensure you do not have any courses or groups related to the site
  admin, and have only one root account
- have a variety of records in the different groups of models mentioned
  in the code with root_account_id not filled
- have some developer keys with account_id=null and
  root_account_id=null, and associated account tokens
- run migrations
- check that developer keys and access tokens have root_account_id set
  to the site admin id
- check that the other models have root_account_id filled to the
  non-site-admin root account

closes INTEROP-6275

Change-Id: I1e7057e81555db305f2f143c2d9fa4c1416219e1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250763
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Mysti Lilla <mysti@instructure.com>
Product-Review: Evan Battaglia <ebattaglia@instructure.com>
2020-11-10 21:04:09 +00:00
Ethan Vizitei fc97202aa6 remove migration shims for auditors datastore
closes FOO-1024

rather than provide migration instructions for all
users to get off of cassandra and on to postgres
for their auditors data, this will
default any un-configured installs to write
both places for now.

After a year, which is the retention window for
auditors data, we can force reads to come from AR
and deprecate/remove any cassandra code
entirely.

also clean up some model tests to not reach so deeply into
the implementation of auditors

Change-Id: If4ca01682618f85d04c9ee7a91522f4c1deac1ac
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249162
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-11-09 16:30:30 +00:00
Cody Cutrer 5ccdcd19ef chain &. in invalidatebuiltinrolecaches migration
Change-Id: Ia9fa63754fc312727f34d80b3d4f101472c7047c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251659
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: Cody Cutrer <cody@instructure.com>
2020-11-06 17:24:59 +00:00
Rob Orton bb3d27be56 create "media uploads" folder as hidden
test plan
 - have rcs running
 - in canvas have rce_enhancements flag set to on
 - in a new course in a quiz, use rce to embed an image
 - it should create a new folder in the course
 - it should be set to hidden
 - the image should work for the student when taking a quiz
 - there should not be notifications for the file upload

another simpler way to test this is to just test the api for folders
when calling media_folder it should create the folder as hidden

then in beta or production do the same test above, but manually set the
folder to hidden in the UI or in console to see that users can still see
the files that are in the quiz.

fixes VICE-948
flag=rce_enhancements

Change-Id: I664b08e3918880ec134f5c31fb69efe3886366d8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250860
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Matthew Lemon <mlemon@instructure.com>
Product-Review: Matthew Lemon <mlemon@instructure.com>
QA-Review: Matthew Lemon <mlemon@instructure.com>
2020-11-04 21:59:12 +00:00
Michael Ziwisky 688de4caec add `confirmation_redirect` to CommunicationChannel
refs FOO-913

test plan:
 - add the `catalog_provisioner` plugin to your local dev env
 - check out the other commits that are associated with this ticket (for
   catalog_provisioner and gallery)
 - run catalog and canvas side-by-side, and set up the catalog
   DeveloperKey in canvas
 - provision a catalog account for one of your local canvas accounts by
   going to http://<canvas-domain>/gallery
    - uncheck the "Canvas dashboard links will navigate to the Catalog
      dashboard" box in the provisioning form
 - create a canvas course and a catalog course and link them. set
   catalog course visibility to "visible"
 - enroll in the catalog course as a new user
 - check mailcatcher for the account confirmation email
 - click the link in the email and set your password
 - you should be taken to your catalog dashboard where you are now
   authenticated and confirmed, i.e. you can see the course you just
   signed up for

Change-Id: Ie25921c8d017661d2be55164923cca0fddf06b35
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250389
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Michael Ziwisky <mziwisky@instructure.com>
Product-Review: Michael Ziwisky <mziwisky@instructure.com>
2020-11-02 22:15:10 +00:00
Cody Cutrer 548a2a1732 update all invocations of send_later and friends to new syntax
Change-Id: I7f40ed058b50882121da69f0cb05966854b8e920
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250924
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2020-10-30 19:13:54 +00:00
Rob Orton 7440be62db handle overrides for students concluded in section
test plan
 - have student enrolled in section1
 - have override to only show assignment1 to section1
 - conclude enrollment for student and enroll in section2
 - the student should not have access to the assignment1

fixes FOO-1153
flag=none

Change-Id: I7c2786b3fd4bd19b185836c698bb8f9dc10b4d52
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251517
Reviewed-by: Gary Mei <gmei@instructure.com>
QA-Review: Gary Mei <gmei@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2020-10-30 01:39:34 +00:00
Simon Williams 6f41788f17 run old predeploy null backfill synchronously
this avoids an issue with queueing a job too early in predeploy
migrations.

closes #1731

test plan: migrations should run successfully

Change-Id: I7c00785bc8aba3f4e977fe517ea8e3aa400ad17e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251230
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-10-27 20:14:48 +00:00
Cody Cutrer ee759dde12 rails 6: some fixes
_TRIGGER_RAILS6_

Change-Id: Ia545cb3fe6cb2e4cd61f593275de3f54f2684920
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250793
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>
2020-10-24 01:55:05 +00:00
Cody Cutrer 5929869101 set default for assignments.workflow_state
so that the canvas doesn't have to explicitly

Change-Id: I19c2df3464fdd10b8b09d97139ea3f973663d5a4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250803
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-10-23 18:13:51 +00:00
James Williams 46b7a3ff2d set old role root account ids to 0 instead of deleting them
Change-Id: Ic88d1a1f77a171fb258da7ad4792320585a9736f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250302
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2020-10-23 15:58:48 +00:00
Cody Cutrer 837e589cf4 rails 6: a few fixes
Change-Id: I81a86ae0fa59b5eca3849e51848f16843309983a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250437
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-10-20 15:31:51 +00:00
Matthew Lemon 074c4d72eb add setting for changing pronouns
This allows schools to lock down a user's ability to change their
pronoun within Canvas.

Fixes VICE-837
flag=none

TEST PLAN:
- As an admin navigate to the account settings
- Enable personal pronouns and note the additional check box to allow
  users to change their pronouns in Canvas
- With it enabled navigate to a users settings and attempt to edit their
  settings
- Note that you should be able to change the user's pronoun
- Disable the setting on the account attempt to edit a users settings
  again
- Note that the dropdown should be disabled and you shouldn't be able to
  change the user's pronoun

Change-Id: I7d7d454e1b5df9a0afa2b39768159a86910cb7d2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249883
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>
2020-10-14 22:12:17 +00:00
Mysti Lilla 6ad68c713c Add SubmissionEvent endpoint to live event integration id
fixes INTEROP-6250
flag=none

Test plan
- Set up tools with varying endpoints and verify
  we're sending the "closest/latest" endpoint ids
  from among a plethora of similar tools on courses/
  sub-accounts/accounts
- Verify the migration does the same thing

Change-Id: Iac761e94cfeee01588cae5cd8b4797faa1bcb643
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249736
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2020-10-09 21:28:52 +00:00
Mysti Lilla 07ca7ae86f Ensure plagiarism tools with different endpoint get their own subscriptions
fixes INTEROP-6247
flag=none

Test plan
- Create tools with different endpoints but matching
  product families
- Ensure they get different subscription ids
- Delete those IDs and run the data fixup
  and ensure they get different IDs that way as well

Change-Id: I5b427616b3caf5850ef54e033d3ab72f37b532ba
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249673
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2020-10-09 03:40:09 +00:00
James Williams 1467961992 allow configuring rce favorites on sub-accounts
test plan:
* before checking out the patchset,
 have some editor button tools installed on a root account
 and at least one set to be an rce favorite
* after checking out the patchset but before running
 migrations, ensure that the previously configured
 rce favorite tools still show up in the rce
 and still are marked as a favorite in the root account settings
* after running migrations, ensure that everything appears the
 same again

* now, should be able to configure sub-accounts external tools
 to have their own set of rce favorites

closes #LS-1420

Change-Id: Ie95b9860149ab11ad5227544e4881d6b36bb6ee3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/248632
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-10-08 16:34:31 +00:00
Rob Orton 3323d45448 create group_and_membership_importer
test plan
 - run the following with group category object and file contents
 - GroupAndMembershipImporter.create_import_with_attachment(category, file)
 - it should return a progress
 - it should import groups and group members

closes VICE-813
flag=none

Change-Id: Iccc7a4f491d7efbe035057a2915f318fd695deb1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249030
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: Rob Orton <rob@instructure.com>
2020-10-07 18:19:48 +00:00
Cody Cutrer 3d1ca55209 rename request throttle to approvelist and blocklist
(allowed? is already used)

closes FOO-991

test plan:
 * sanity check of request throttling

Change-Id: I366cb237a5b7edb52808f3b53098a959ad9c8056
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249250
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>
2020-10-06 22:06:52 +00:00
Cody Cutrer c5227d3f1b shackles was renamed to guardrail
closes FOO-989, FOO-990

Change-Id: I49dfa130cb74c34dd0eb25952790176ae4951058
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249365
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>
2020-10-06 19:23:08 +00:00
Alex Slaughter d912e3a13d backfill root_account_id for quiz_submission_events table
flag=none
closes: QUIZ-7765

Test plan:
- Have existing models with null root_account_id for:
  Quizzes::QuizSubmissionEvent
- Run DataFixup::PopulateRootAccountIdOnModels.run
- Verify records have root_account_id

Change-Id: I1ce7fa047c7d70f6a9d75e7d6048b42ad42f8e71
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/248919
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
QA-Review: Alex Slaughter <aslaughter@instructure.com>
Product-Review: Alex Slaughter <aslaughter@instructure.com>
2020-10-06 19:03:00 +00:00
Rob Orton 404bb682c1 just send the job even if site_admin doesn't exist
test plan
 - specs should pass

Change-Id: I207aa5f16f481db74a0d3dd6536bbc033a07f538
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249336
Reviewed-by: John Koropchak <jkoropchak@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
Tested-by: Rob Orton <rob@instructure.com>
2020-10-06 02:29:58 +00:00
Mysti Lilla 142276c152 Fix job timing on plagiarism resubmit, don't run with migration
refs INTEROP-5767
flag=none

Test plan
- Set up a couple of submissions associated to a plagiarism
  tool
- Set Setting.set('trigger_plagiarism_resubmit', '1,10')
  in the console
- Change the resend_plagiarism_events.rb file and remove
  the "if_production" parts, change to send_later_enqueue_args
  so you can see the jobs try to work
- Run DataFixup::ResendPlagiarismEvents.run and verify
  you get a couple of jobs in the Delayed::Jobs queue that have
  reasonable run_at times.
- Ensure that the live-event sends properly when they fire

Change-Id: I3441ebbdf722961445703ba13f0ce03490a28c7a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/248967
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2020-10-02 18:56:20 +00:00
Kyle Rosenbaum 025556caf3 bump rubocop version to 0.68.0 to support ruby 2.6
this changes upgrades to the earliest version of rubocop
supporting ruby 2.6 while also choosing a version that fixes
a breaking 0.60.0 change to revert psych version change.

namespace changes were made on multiple cops to support
the new rubocop version requirements as well as the change to
move performance cops out of the rubocop gem in to
rubocop-performance.

the Layout/IndentFirstParameter cop is currently broken but a
rubocop version upgrade will fix that. the FreezeConstants cop
also required a fix to handle nil types.

refs DE-289

test plan:
- ensure rubocop runs completely

Change-Id: I0ca68f426e287b5a973b96a4ae0e975f1cbc0240
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/248786
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
Product-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
Reviewed-by: Ryan Norton <rnorton@instructure.com>
2020-09-29 16:09:54 +00:00
Cody Cutrer 42d6ba4f43 fix typo in migration
Change-Id: I461931817aa2f400569e884b9e3fee7470157a94
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/248785
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Michael Ziwisky <mziwisky@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-09-29 00:59:54 +00:00
Mysti Lilla ca60b98366 Resubmit submissions that should have originality reports
refs INTEROP-5767
flag=none

Test plan
- Specs pass

Change-Id: Ied05b5a09ed0c22b3015605c70b5a7ed87397ce3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/247067
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Mysti Lilla <mysti@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2020-09-28 22:17:15 +00:00
Mysti Lilla 7f7962e310 Add subscription to all LTI 2 Plagiarism tool installations
fixes INTEROP-6130
flag=plagiarism_tool_subscriptions (removes it)

Test plan
- Have a Lti::ToolProxy for TurnItIn or Urkund
  or some other Plagiarism service that does
  not have an associated subscription
- Run the data fixup.  Verify the tool has
  a working subscription

Change-Id: I21a85321caf1a735e0034661e175da3423548967
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/246411
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
2020-09-28 22:16:32 +00:00
Cody Cutrer 4211945c1f use shard settings, not Setting, for common core group id
Change-Id: I3324d727ea16760c4b28a0b8d0d3cbea676948a5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/248463
Tested-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-09-28 17:22:17 +00:00
Alex Slaughter a1112c340b Add root_account_id for quiz_submission_event
Test plan:
 - Specs Pass

Fixes: QUIZ-7766, QUIZ-7764
flag = none

Change-Id: I57c13defb93e559823a41fd91dbaab1f6f1ca7c1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/248622
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
Reviewed-by: 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>
2020-09-25 20:13:01 +00:00
Ethan Vizitei 68198567df move AUA log compaction state to local table
closes FOO-1003

TEST PLAN:
  1) aua log compaction continues to work
  2) state on plugin setting and in metadata
     table is in sync

Change-Id: Ie161fcb079f80a4072ddd99f3a561c97d33026fd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/248501
Reviewed-by: Jacob Burroughs <jburroughs@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>
2020-09-25 16:35:01 +00:00
Evan Battaglia c3c184d5bb remove root acct id FK constraint - quiz_questions
There are quiz questions which have a cross-shard quiz_id.

flag=none
refs INTEROP-6194

Test plan:
- before and after running migrations, try to create a QuizQuestion with
  a cross-shard (global) quiz_id.

Change-Id: Ifd600774eb1aeea697e93a206cc4e26d0dd05530
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/248376
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>
2020-09-25 16:14:49 +00:00
Michael Ziwisky 291a774810 remove uniqueness constraint from UserMergeDataRecords index
fixes FOO-888

Repro (before applying this migration)
 - create a course and publish it
 - create a quiz in the course and publish it
 - create two users, A and B, and enroll both in the course as students
 - have user A start the quiz but don't finish it
 - have user B start and finish the quiz
 - merge user B into user A
 - canvas go BOOM. unique key constraint violation.

After applying this migration, I went through the same repro, verified
that the issue was fixed, and indeed you end up with multiple
UserMergeDataRecords for the same QuizSubmission, but that doesn't seem
to be a problem. You can still do SplitUsers on the resulting user and
UserMergeData without issue.

Change-Id: I6752544cec8ed08e8229334d73efe02af5a31507
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/248267
QA-Review: Michael Ziwisky <mziwisky@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Michael Ziwisky <mziwisky@instructure.com>
2020-09-25 15:27:51 +00:00
Cody Cutrer 77ef90663b make role_overrides.context NOT NULL
Change-Id: I95c6d6fe59172a41fe0a90205bf3cd896b4db8f8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/248331
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>
2020-09-24 00:49:45 +00:00
Cody Cutrer 2255e612eb folders get dummy root_account_id for context user
refs FOO-960

Change-Id: I815dc6f89fd283dcc067899bf97147fa53d3553c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/248189
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-09-23 19:16:38 +00:00
Cody Cutrer b2ef0367da stop using deprecated form to reload default shard
Change-Id: I34290b6f0aaaceecc98f11f64a9ef96562e30cc1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/248039
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>
2020-09-21 19:42:48 +00:00
James Williams 82b72a01f0 clear caches with objects referencing deleted roles
test plan:
* migrations should run

closes #LS-1464

Change-Id: I8da5b9e2347a6e32d42b738d9e38ebb237b1771a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/247651
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2020-09-21 14:51:35 +00:00
Augusto Callejas edfd81521e Add outcome proficiency permissions
closes OUT-3944

flag=none

test plan:
  - confirm that these account permissions are
    enabled for account admins (account roles)
    and disabled but available for teachers and
    designers (course roles)
  - create a custom account role
  - enable the "Learning Outcomes - add / edit / delete"
    permission
  - either run the data fixup code again or perform
    the two steps above before running the migrations
    from this patch set
  - confirm the proficiency permissions are now enabled
    on the custom role (reload Canvas permissions page
    before confirming)

Change-Id: I6fb52c4f9eb0d5146453b55dba1fd14912818b7b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/247047
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Jody Sailor
2020-09-15 21:54:11 +00:00
Evan Battaglia 3d46b6d850 backfill root_account_id on Comm.Channels again
* run specs and test

Partially adapted from efe298c1c8
(clearing old User root_account_ids)
See also old CommunicationChannel backfill commit
8502957025

flag=none
closes INTEROP-6091

Test plan (multi-shard canvas):
- have some users and communication channels in different shards, with
  some with cross-shard associations, and some comm channels in a
  different shard as the user.
- run DataFixup::PopulateRootAccountIdOnModels.run on all shards to make
  sure the Users all have root_account_ids.
- make sure you have some communication channels with root account ids
  (this is not what we are testing here, if none are there, just set some)
- run migrations
- make sure the root account ids on the communication channels are
  cleared (if you are running jobs they may start backfills so it's best
  to not be running a jobs container)
- delete all jobs on all shards
  (Shard.with_each_shard{Delayed::Job.delete_all}) to simulate the state
  on production (with users backfill complete and no jobs)
- run DataFixup::PopulateRootAccountIdOnModels.run on all shards
- check that all communication channels have the correct root
  account ids (comm channels should match the users)

Change-Id: I1ae5d4fb50bd5dadd62fe394ec8b4072f03edb3d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/247183
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Evan Battaglia <ebattaglia@instructure.com>
2020-09-14 22:54:37 +00:00
James Williams 1a147b896c remove built-in-role split condition handling
and make role root_account_id not null

the datafix is done so we can remove the code
handling the old built-in roles

test plan:
* specs

closes #LS-1425

Change-Id: Ic8a115b71383c561b55275636bd93c194d752610
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/247327
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2020-09-14 13:11:35 +00:00
Brian Watson b02d569900 Remove Granular Permissions Wiki Pages FF
closes OUT-3890
flag=none

Test-plan:
 - Verify that user interactions behave as expected
   when testing with various different permissions
   turned on/off when using various different user
   roles
 - Granular pages permissions can be found under
   /accounts/self/permissions > Manage Pages

Change-Id: I0718a781991bf66fd90a14489710f0a68a4e4cb9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/245714
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Pat Renner <prenner@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
QA-Review: Augusto Callejas <acallejas@instructure.com>
Product-Review: Jody Sailor
2020-09-10 04:43:12 +00:00
Cody Cutrer 45a09ef420 optimize ObserverAlert.create_assignment_missing_alerts
also run it less often

the gist is to iterate by users, instead of alerts, so that indexes can be more
effective. also, don't join against the world - select only the columns we actually
need, and carefully form our joins. this way we can also avoid a bunch of queries
post-load as well. it also makes the final query much easier to grok

on a middle sized database, this changes from ~75 queries of ~22s each (with no
improvement with a warm cache) to ~22 queries of ~10s each (down to ~30ms on a
warm cache)

Change-Id: I9f2cbae3aa3fce4d5ff9a1e2fa424ffca11e042f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/246829
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-09-09 16:39:11 +00:00
Jeremy Stanley 719037925d drop unused wiki_pages.view_count column
flag = none
closes LS-1436

Change-Id: I4f303f09976bc4be377bc560dcb2c5ce5d9fc7dd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/247127
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2020-09-08 17:52:47 +00:00
Ethan Vizitei 2cf7f03656 cleanup AUA log compaction
and fix bug with zeroing out
wrong iterator

Change-Id: I7e94d3d256c128b690c9b6fb2df038dca449ee3a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/247090
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2020-09-06 13:10:35 +00:00
Ethan Vizitei 08e2238dc6 aua views via log compaction
closes FOO-937

 * 7-tables by day-of-week
 * infer write table from timestamp
 * plugin with default settings values
 * instructions on setting the local shard to use log-&-compact
 * write path switches on setting to log compaction for view bumps
 * compaction job
 * single write per log segment (multpile updates)
 * truncates previous partition
 * periodic job harness with available settings

Change-Id: Idd5cbaf0d83436724c5d72038e0dbc78cdc23619
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/247083
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2020-09-06 03:56:53 +00:00
Evan Battaglia 575c8cdbb0 Have backfill migration run for new tables
refs: INTEROP-6153
flag=none

Test plan
- N/A

Change-Id: I8c773073969975dc0f69725bc9437ba8e01b40d0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/246952
Reviewed-by: Mysti Lilla <mysti@instructure.com>
QA-Review: Mysti Lilla <mysti@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2020-09-03 22:29:11 +00:00
Charley Kline 4cb9e145ab Migration: remove view_learning_analytics overrides
Refs FOO-905
flag=none

We've removed this permission from Canvas, so let's just also
go remove all role overrides everywhere that reference it.

Test plan:
* If you had any RoleOverride records referencing the
  :view_learning_analytics permission, they should be gone after
  running DataFixup:ClearAnyCanvasInsightsViewRoleOverrides.run

Change-Id: I028eaa929dc4ae1176b683980ad2d3cb07c2dfbf
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/246805
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-09-03 19:31:38 +00:00
Ethan Vizitei ea14dcca1b optimize most time-consuming production query
Change-Id: Ia0e8eff177df99cd24d55c3e113d84925a081723
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/246914
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>
2020-09-03 17:42:49 +00:00
James Williams a6e6fd0670 split built-in role rows by root account
test plan:
* a multi-tenant shard should still work
 creating enrollments and account admins before and after
 running postdeploy migrations
* the postdeploy should successfully run a datafixup
 to split up build-in role rows and reassign the role_id on
 other tables (account_notification_roles, account_users,
 enrollments, and role_overrides) accordingly

closes #INTEROP-6045

Change-Id: I8325acb635397ac1b008b9d09788595da597cec7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/243906
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
2020-09-01 19:21:27 +00:00
Ethan Vizitei 16abf15de4 yank migrations and table management from canvas ddb
Change-Id: I3d2a60443e9b514f690a236b05dd2f437ad8e3c2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/246391
Reviewed-by: Michael Ziwisky <mziwisky@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>
2020-08-31 20:26:17 +00:00
Cody Cutrer bedf970aab optimize planner wiki page query
it's far more common for wiki pages to not be linked to wiki pages, so only look up their
assignment visibilities if necessary

Change-Id: Idf3f05e2c5e59a2163bd692497160c2388551be2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/246533
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-08-31 16:53:05 +00:00
Cody Cutrer 2af7da3928 add index on account_report_rows(created_at)
so that clean up is much faster

Change-Id: I265091dc328a54fb849b3eff39cad685e7889ae1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/246525
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-08-31 16:22:55 +00:00
Mysti Lilla 66115e206c Revert "Revert "Create dummy Account 0""
This reverts commit 2548a2bc38.

Reason for revert: <INSERT REASONING HERE>

Change-Id: Icfb9e1a2bcc660b66b8ee740299d390ca844c261
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/245091
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2020-08-28 20:57:49 +00:00
Mysti Lilla 2548a2bc38 Revert "Create dummy Account 0"
This reverts commit 2a7fcdd792.

Reason for revert: <INSERT REASONING HERE>

Change-Id: I0f75b86493f5b24b91cee2b00ec9e0c07d496d49
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/245090
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Mysti Lilla <mysti@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2020-08-28 18:22:13 +00:00
Mysti Lilla 2a7fcdd792 Create dummy Account 0
flag=none
closes INTEROP-6094

Test plan
- Run the database migration
  and ensure Account 0 is created

Change-Id: I9a5e6f8934c76ea97997a41eeecdd7fef7e76e95
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/245895
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Michael Guymon <mguymon@instructure.com>
Product-Review: Michael Guymon <mguymon@instructure.com>
2020-08-28 16:17:09 +00:00
Jacob Burroughs ae5ab6bfb6 Bump inst-jobs + switchman-inst-jobs
Change-Id: I69c7a60bf65f1ef8914171413adb91bb2eae95a5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/246089
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-08-27 16:25:49 +00:00
Adrian Packel abe50c3b3c Add grading_period_id to Cassandra
flag=none
closes EVAL-1128

Test plan:
- Migrations on Cassandra run successfully
- Grade changes save the grading_period_id of the associated submission
  in both Cassandra and AR

Change-Id: I7ae0ff54093b9bf1eaea43106d4788f22c6c920e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/245734
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Adrian Packel <apackel@instructure.com>
Product-Review: Jody Sailor
2020-08-26 19:21:32 +00:00
Mysti Lilla 3251306ff0 Delete DeveloperKey shard split artifacts
refs INTEROP-6080
flag=none

Test plan
- Have some developer keys with account ids
  from a different shard
- Run DataFixup::CleanupCrossShardDeveloperKeys.run
  and verify they get deleted

Change-Id: Ib389ef37b33a8a6e73c4926d9db775542dc6629f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/245434
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2020-08-20 20:01:21 +00:00
James Williams 4403eb3c2a fix cross-shard content shares
shares belong to the user's shard, not the content export's

so shares created for a course on a shard
that the user doesn't belong to will break

and shares sent to cross-shard users that create "received"
copies of the original share will also break

also semi-inadvertently fixing share sender info in API
and some problems on the import side when the correct
shard isn't active

test plan:
* cross-shard content shares should work
 (both when sharing content from a course from a shard
 the sending user is not native to, and when sharing content
 to a user on a shard different than the content's course)

closes #LS-1337

Change-Id: Ib91529ffa5de0ee7a6f20f63281d6c5508982063
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/245496
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: James Williams <jamesw@instructure.com>
2020-08-20 17:07:08 +00:00
Cody Cutrer ecd05261cc filter assessor asset by courses too in submissions_needing_peer_review
test plan:
 * specs pass

Change-Id: Ib66137d96d8ae06634f4e305b9354b306a0a2405
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/245475
Reviewed-by: James Williams <jamesw@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-08-19 16:28:49 +00:00
Cody Cutrer 45aa6d632f tweak indexes for dashboard queries
Change-Id: I8e35155c8e1cff3be11db8c0de9fe9502951c6e1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/245106
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-08-14 18:52:04 +00:00
Pat Renner 466271355c soft delete outcome proficiency and proficiency ratings
closes OUT-3841
flag=none

test-plan:
- run migrations
- Ensure you can soft delete outcome proficiencies
(and their associated ratings)
- dc run --rm web script/rails c
> o = OutcomeProficiency.first (alternatively,
copy the factory code from factories/outcome_proficiency_factory
to create one for an account)
- ensure it has a workflow state (should be "active" by default)
- ensure the ratings have an "active" workflow state by default
> o.outcome_proficiency_ratings.map(&:workflow_state)
> o.destroy
- Ensure the outcome proficiency was soft deleted
(it should now have a workflow state of deleted)
- Ensure the ratings were soft deleted
> o.outcome_proficiency_ratings.map(&:workflow_state)
- Ensure calling undestroy restores both the proficiency and the ratings
> o.undestroy
> o.outcome_proficiency_ratings.map(&:workflow_state)
- Calling destroy_permanently! should hard delete
both the proficiency and all associated ratings (examine SQL output)
> o.destroy_permanently!

Change-Id: I6421fdfdd97b991e76fb08b528cddbc668495ac8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244166
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
QA-Review: Augusto Callejas <acallejas@instructure.com>
Product-Review: Augusto Callejas <acallejas@instructure.com>
2020-08-13 23:50:03 +00:00
Cody Cutrer 8ce6b71a3a optimize assignments_needing_grading_query
especially for courses with mostly-deleted-assignments

Change-Id: Icbb010dd0406e2206148ce08ee849babf4d7a459
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244991
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2020-08-13 20:34:53 +00:00
Jacob Fugal 2b3886c5f4 extend client_credentials oauth2 grants for CD2
refs SAS-1540

* adds an audience setting to developer keys, so a key can be set to
  target external audiences with its credentials grants
* when a key with an external audience grants credentials, the token is
  signed with an asymmetric key instead of the internal symmetric key
* external audiences can retrieve the corresponding public keys from
  /login/oauth2/jwks
* credentials issued by developer keys with an account id include the
  account's guid in a custom claim

includes a refactor of key storage and rotation in consul, which had
already been done for LTI. but it wasn't really a feature of lti, just
something used by LTI, and we needed the same for key management for
this. moved it to be part of Canvas::Security

Change-Id: Ie5c0fcee6fc21687f31c109389a3bcc1ed349c5d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/243606
QA-Review: Jonathan Featherstone <jfeatherstone@instructure.com>
Reviewed-by: Jonathan Featherstone <jfeatherstone@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2020-08-13 18:52:47 +00:00
Evan Battaglia efe298c1c8 Clear old (always global) user root account ids
Must be merged and deployed with the "Make Users root_account_ids
relative to user shard" (g/244742) commit.
The migration here is named to run before
20200806175207_populate_root_account_id_on_models
kicks off the users backfill.

flag=none
refs INTEROP-6063

Test plan:
- make sure you have some users with root account ids with all global
  ids (ids are still global when on same shard as user)
- run migrations
- make sure those root account ids are cleared (if you are running jobs
  you will also start backfills so you may notice users filling up again
  but they will have local root account IDs for root accounts on the same
  shard as the user)

Change-Id: I047afe45989f2e86ca711e24683beca4557ce1c6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244804
Reviewed-by: Mysti Lilla <mysti@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Evan Battaglia <ebattaglia@instructure.com>
2020-08-12 15:22:31 +00:00
Mysti Lilla 6b10d90197 Populate root account id on roles
fixes INTEROP-5887
flag=none

Test plan
- Ensure you have a role without a root
  account id
- Run DataFixup::PopulateRootAccountIdOnModels.run
- Ensure your roles have their root account ids
  populated

Change-Id: I9fd7fa4ac40b92716b746f0e7424b85212f118ff
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244525
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2020-08-07 21:05:15 +00:00
Pat Renner 5949862ab8 ensure outcome_proficiency.context cannot be null
closes OUT-3805
flag=none

test-plan:
- run migrations
- cannot create an outcome_proficiency with nil context

Change-Id: Ie01742f0df539e7f6b8f31e1fedd80cd31eadfed
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/242529
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Pat Renner <prenner@instructure.com>
2020-08-06 15:11:36 +00:00
Pat Renner 40fa8bd397 ensure calculation_method.root_account cannot be null
closes OUT-3847
flag=none

test-plan:
- Run migrations
- Ensure you cannot create a calculation method without a root account:
> OutcomeCalculationMethod.create! context: Account.find(id),
      calculation_method: :latest, calculation_int: nil
> method = _
- Confirm root account is set on method
- Update root account to be null (calling update_column skips
activerecord callbacks)
> method.update_column(:root_account_id, nil)
- Should trigger NotNullViolation

Change-Id: I1fa31c39f79d969e915872a2b420a6b583564be8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/243759
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Pat Renner <prenner@instructure.com>
2020-08-06 15:11:25 +00:00
Pat Renner e846eaec57 remove account_id from outcome_proficiency model
closes OUT-3760
flag=none

test-plan:
- Run migrations
- Ensure outcome proficiencies cannot be made
without defining context (or context_type/id)
> rating1 = OutcomeProficiencyRating.new(
description: 'best', points: 10, mastery: true, color: '00ff00')
> rating2 = OutcomeProficiencyRating.new(
description: 'worst', points: 0, mastery: false, color: 'ff0000')
> OutcomeProficiency.create!(
outcome_proficiency_ratings: [rating1, rating2])
- Should pass with provided context
(may need to delete current proficiency ratings for Account.first)
> OutcomeProficiency.create!(
outcome_proficiency_ratings: [rating1, rating2], context: Account.first)

Change-Id: I67ea2237641e02e3339dbb7c468f9e91381422b2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/242532
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Reviewed-by: Brian Watson <bwatson@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Pat Renner <prenner@instructure.com>
2020-08-06 15:11:15 +00:00
Evan Battaglia a45b1e1036 Add index to users root_account_ids
Needed for communication_channels backfill (it depends on users being
backfilled to needs the index to efficiently check).

refs INTEROP-6038
flag=none

Test plan:
- run migration up, check index exists on table
- run migration down, check index no longer on table

Change-Id: I27a5001a42bbd52cf630204148cd64900c80a1d5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244273
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Ryan Hawkins <ryan.hawkins@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Evan Battaglia <ebattaglia@instructure.com>
QA-Review: Ryan Hawkins <ryan.hawkins@instructure.com>
2020-08-05 21:54:18 +00:00
Mysti Lilla 05b02fc11c Have backfill migration run for new tables
refs: INTEROP-5842
flag=none

Test plan
- N/A

Change-Id: If7459b1890c25c00194a429b528a5b1aeeef8eaa
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244282
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2020-08-05 17:28:12 +00:00
Adrian Packel 72620b417b Update grade change tables for override grades
flag=none
closes EVAL-1065

Test plan:
- "up" migration:
  - Ensure migrations run properly
  - After the migration finishes, check that the assignment_id,
    submission_id and submission_version_number columns in the
    auditor_grade_change_records_* tables do *not* have not-null
    constraints
  - Check that the grading_period_id column exists on said tables, along
    with an accompanying foreign key
- "down" migration:
  - Check that the assignment_id, submission_id and
    submission_version_number column once again have a not-null
    constraint
  - Check that the grading_period_id column no longer exists

Change-Id: I82d0325ea88f88138e78901415ed8fbe0d7d2814
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/243691
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
QA-Review: Adrian Packel <apackel@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
2020-08-04 14:41:30 +00:00
Evan Battaglia 05e2c90f6b Remove RA id FK constraint on asset_user_accesses
Although we're not sure why, there are lots of asset_user_accesses with
a cross-shard context and thus would have a cross-shard root account ID.

flag=none
closes INTEROP-6042

Test plan:
- run migration and make sure you can set root_account_id to a global ID e.g.
  12340000000000123 on a AssetUserAccess
- set it back to null
- run `rake db:migrate:down VERSION=20200730144201` and make sure that you
  cannot set root_account to a global ID anymove

Change-Id: Idf1db168c52e0d76bdaeed9e02466fe465276e89
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/243922
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ryan Hawkins <ryan.hawkins@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ryan Hawkins <ryan.hawkins@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2020-08-03 21:19:06 +00:00
wdransfield 1a78816bab Bump date of root_account_id backfill migration
Closes PLAT-6031
flag=none

We have several new root_account_id population
data fixups. This date change will ensure the
new fixups included in the same release are
scheduled to run.

Change-Id: I45490e6a2dacb182de48df54b33ced658aa7e436
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/243485
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2020-07-27 19:30:18 +00:00
Michael Brewer-Davis cd9eb4fab7 add outcome calculation method model
closes OUT-3759
flag=account_level_mastery_scales

Test plan:
- run migrations
- in the canvas ui or rails console, create subaccounts
- in the rails console, add outcome calculation
  methods to the root account and some of the subaccounts:
  > ap Account.all.pluck(:id, :name)
  > OutcomeCalculationMethod.create! context: Account.find(id),
      calculation_method: :latest, calculation_int: nil
- verify that calculation methods are found through
  `account.resolved_outcome_calculation_method`

Change-Id: Iba4b8db2e1c78b7f7c5964eec270ed75c4f94d66
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/242745
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
QA-Review: Augusto Callejas <acallejas@instructure.com>
Product-Review: Augusto Callejas <acallejas@instructure.com>
2020-07-22 17:53:42 +00:00
Evan Battaglia 005df77737 Remove root_account_id from communication_channels
This was replaced with plural root_account_ids.

Test plan:
- run migrations and check that communication_channels no longer has
  root_account_id column
- `rake db:migrate:down VERSION=20200713124612` and check that
  root_account_id column is there again

Change-Id: I6524ed6230687c8866e714a57c366bc31aa1d5a6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/242524
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Evan Battaglia <ebattaglia@instructure.com>
2020-07-22 15:55:11 +00:00
Pat Renner 49b9636f7f add context_type/id to outcome proficiency
flag=none
refs OUT-3758

DO NOT MERGE (migration freeze)

test-plan:
- ensure you have at least one outcome proficiency
created for an account
- run migrations
- ensure that for your existing outcome proficiencies,
context_type and context_id are set
- create an outcome proficiency (using
outcome_proficiency_factory provides a nice template) and
ensure context_id, context_type is set on save

Change-Id: Iabd21ce00386959f12498f7fa0c1f5bd58d57127
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/242140
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
Product-Review: Michael Brewer-Davis <mbd@instructure.com>
2020-07-22 15:09:08 +00:00
Drake Harper 079860ea4d Drop gender and birthdate columns from User
Test Plan:
-specs should pass

flag=none

fixes VICE-591

Change-Id: I20595e1f7aefe8e4c6237db60b3eac9139780fef
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/242087
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>
2020-07-20 17:49:46 +00:00
Xander Moffatt 24153c85c9 backfill conversations_* tables
* read from `conversations`, which already has root_account_ids
* copy those, which are comma-separated values in a string, to:
  * conversation_messages
  * conversation_participants
  * conversation_message_participants, through conversation_messages

closes INTEROP-5853, INTEROP-5854, INTEROP-5855, INTEROP-5856
flag=none

test plan
* specs
* in the UI, create a conversation chain between two users
* in a rails console, note that the conversation has a root_account_ids field
* note that the Conversation's `conversation_messages`,
`conversation_participants`, and
`conversation_message_participants`
all have those root account ids as well, since there is logic to populate those on save
* for each of those associations, run `association.update_all("root_account_ids=NULL")`
* then run `DataFixup:PopulateRootAccountIdsOnConversationsTables.run`
* note that the root_account_ids fields for all associations
match the field on the conversation

Change-Id: I98ac281291c2105240610b0a0690a544c7d082a7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/241978
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Xander Moffatt <xmoffatt@instructure.com>
2020-07-16 17:24:56 +00:00
Cody Cutrer 74d6822704 disable pg12 COLLATION for the moment
it doesn't work well in a mixed environment

Change-Id: I90b72e7a0fce1a9e4f815cc89f75b9a6b258ddfa
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/242679
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>
2020-07-15 00:19:33 +00:00
Xander Moffatt 81f3dbad4f populate root_account_id on calendar_events
closes INTEROP-5844
flag=none

test plan:
- have existing CalendarEvents without root account id,
  preferably at least one with each context type
  (Course, CourseSection, Group, User w/no effective
  context, User w/effective context, AppointmentGroup)
- run `DataFixup::PopulateRootAccountIdOnCalendarEvents.run`
- verify all events (except User w/o effective context)
  have a root_account_id

Change-Id: I7d3c3c7221c25b3ae2d8c1b8819307cc66be229e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/242024
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
Product-Review: Xander Moffatt <xmoffatt@instructure.com>
2020-07-14 19:28:38 +00:00
James Williams d3189e9f01 fix remove_foreign_key with if_exists and column
refs #LS-1201

Change-Id: I4240f4b642b1c99bb6dfe3ce88713b597797bea1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/242590
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Keith Garner <kgarner@instructure.com>
Product-Review: Keith Garner <kgarner@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
2020-07-14 14:56:47 +00:00
Evan Battaglia 0c876829d4 Remove FK constraints for more global RA ids
root_account_id on these tables can be cross-shard, so cannot have an FK
constraint.

flag=none
closes INTEROP-6006

Test plan:
- run migration and make sure you can set root_account_id to a global ID e.g.
  10000000000001 on a AccessToken and RubricAssociation
- run `rake db:migrate:down VERSION=20200713144312` and make sure that you
  cannot set root_account to a global ID anymove

Change-Id: I5ea00506f9eacba4ff0106133bcd0e8dcbaa6dc1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/242539
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-07-13 22:13:24 +00:00
Evan Battaglia 386c44e691 Add root_account_ids to communication_channels
communication_channels can have multiple root account IDs
(they can have no pseudonym and instead just belong to a user,
which can have multiple root account IDs).

flag=none
refs INTEROP-6003

Test Plan:
- Verify the new migration can be run up and down.
- Verify the root_account_ids attribute on the CommunicationChannel
  model can be set and saved.

Change-Id: I8009ff62c3560d1de5d761ddf8d8a042b48327ca
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/242522
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-07-13 21:06:54 +00:00
Mysti Lilla 597f0a7274 Ensure backfill job runs per shard
fixes INTEROP-5997
flag=none

Test plan
- Specs pass

Change-Id: I857548924a618eeb068e129e16292ced6494abba
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/242414
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Mysti Lilla <mysti@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2020-07-13 20:15:16 +00:00
Evan Battaglia cc23faaac3 Remove FK constraints for possibly global RA ids
root_account_id on these tables can be cross-shard, so cannot have an FK
constraint.

Test plan:
- run migration and make sure you can set root_account_id to a global ID e.g.
  10000000000001 on an Attachment, AttachmentAssociation, Folder,
  CommunicationChannel (this one you need to use update_all() with SQL
  to avoid validations apparently)
- run `rake db:migrate:down VERSION=20200713114812` and make sure that you
  can not set root_Account to a global ID anymove

Change-Id: Ibcb8b54d1ba3af96bf4fad64a8ea3b7e4a613c2e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/242500
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-07-13 20:00:21 +00:00
Clint Furse 54212b43da data fixup for MC LTI tool
closes LS-1182
flag = submission_type_tool_placement

Test Plan:
- spec runs ok

Change-Id: I36eb9050e9dc4114cad87ebf4101413d69d7b93e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/242136
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Clint Furse <cfurse@instructure.com>
2020-07-13 16:16:08 +00:00
Gary Mei 42cb2c1529 add root_account_id to grading_period_groups
closes EVAL-702
flag=none

Test Plan
- Run migrations.
- Create a grading period group for an account.
- Verify in a console that the group's root_account_id is set to the
  root account's id.
- In the console, set the root_account_id to nil.
- Edit the grading period group in some way and save it.
- Verify in the console that the root_account_id is set again.

Change-Id: Ic38d227066297d5cc247aab37760f9c6df958d2b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/239943
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Syed Hussain <shussain@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Spencer Olson <solson@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
2020-07-13 15:29:45 +00:00
James Williams d99b163828 remove root account foreign key for favorites
closes #LS-1201

Change-Id: If55f2237528e855e2cb41314a412c0935fc117f4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/242375
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
2020-07-10 17:52:47 +00:00
Mysti Lilla 54a51a11f9 Performance improvements for backfill jobs
refs INTEROP-5836
flag=none

Test plan
- Specs pass

Change-Id: I41adaffe60c359537d8baaad4a4d3d60daaa9333
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/242322
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-07-10 01:08:43 +00:00
Rob Orton 7b24afd223 cleanup invalid observer_alerts
fixes KNO-498

test plan
 - migrations should run

Change-Id: I727d9178d00bb88d5656def43df3d0417d3eadda
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/241840
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Davis Hyer <dhyer@instructure.com>
QA-Review: Davis Hyer <dhyer@instructure.com>
Product-Review: Davis Hyer <dhyer@instructure.com>
2020-07-09 16:21:38 +00:00
wdransfield 905df065e9 bump root_account_id migration timesamp
Change-Id: Ieddea338feca60316c8253ffc297df47530acdac
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/242205
Reviewed-by: Rob Orton <rob@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-07-08 22:32:07 +00:00
Ahmad Amireh cf98f71cd3 send upcoming assignment alert to unaware students
Fills in the stub for actually sending the notification to the selected
students.

Test Plan:
In a Rails console
 - Grab a student who has Due Date notifications set to Immediate (u)
 - Grab an assignment that the student is assigned, but has not
     submitted and is due in the future (a)
 - `s = Submission.find_by(user_id: u.id, assignment_id: a.id)`
 - `n = BroadcastPolicy.notification_finder.by_name('Upcoming Assignment Alert')`
 - `AssignmentUtil.alert_unaware_student(n, assignment: a, submission: s)`
 - Verify that a notification was sent

fixes VICE-445, VICE-446
flag  = smart_alerts

Change-Id: I56032152c8f9a0c4c2387d28420c419f990440d1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/240397
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>
2020-07-07 19:31:53 +00:00
Mysti Lilla 37da106359 Populate root account id on DiscussionTopic
fixes INTEROP-5905
flag=none

Test plan
- Have discussion topics without root
  account ids
- Run Datafixup::PopulateRootAccountIdOnModels.run
- Ensure discussion topics have root
  account ids

Change-Id: I44f071a8984086974b0a8b5b01a78d7f121e051d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/241632
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2020-07-01 20:43:22 +00:00
Ahmad Amireh 17f6cacaff fix collation migrations for PG < 12
the DETERMINISTIC option is introduced only in 12[1][2] but we were
version checking for >= 10, causing the migrations to fail on PG 10

relates to g/241190

[ TEST PLAN ]
  ---------

Verify you can run the migrations using PG 10 or 11.

[1]: https://postgresql.verite.pro/blog/2019/10/14/nondeterministic-collations.html
[2]: https://www.postgresql.org/docs/12/sql-createcollation.html

Change-Id: I049bc49d3598be5709c630980580bc8583dca121
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/241438
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2020-06-30 16:50:22 +00:00
Simon Williams a2c7c54485 fix too long index name
Change-Id: I159965be92113b41f1865700f4fdbb8e5cc246c0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/241499
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-06-30 02:45:34 +00:00
Cody Cutrer ee3456849d use a different temporary index name for collkey migration
since the temp index will still exist if you're running all predeploy migrations,
then all postdeploys

Change-Id: I5a139212f06bc49604e6f9c6f31764c8cc054a62
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/241492
Reviewed-by: Mysti Lilla <mysti@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2020-06-30 01:55:59 +00:00
Cody Cutrer 8936b5803a use PG10's built in collation support
test plan:
 * with PG <10, nothing should change/break (migrations shouldn't even try to run)
 * with pg >=10, run migrations
 * it should create collations, and recreate a couple indexes
 * going to the users page should not be broken
 * specs ensure that the sorting is to our liking

Change-Id: I3eaf42dd2207d733c164c12ef2a43a1c1b417ff2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/241190
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-06-26 18:50:05 +00:00
Matthew Lemon acebf1dfb1 create trophy tables
flag=trophy_case

/ ---- ---- \
| Test Plan |
\ ---- ---- /

- N/A

Change-Id: I7fce9298f1c582e7801033d19b05951d86f5b1ca
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/240878
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>
2020-06-26 17:34:34 +00:00
Cody Cutrer 735bb2719e tweak scheduled smart alerts table
Change-Id: I226b6adcdc89a4845e4e58d9709f279bef22b954
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/240519
Tested-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-06-18 00:03:30 +00:00
Michael Brewer-Davis 2c8badd7ed add index to learning_outcomes root_account_ids
refs OUT-3641
flag=none

Change-Id: I6d42dccdd438f4e63cf3ba5f63ad619879ad7ef0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/240481
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-06-17 20:05:08 +00:00
Michael Brewer-Davis 2b054eb5d4 add root_account_ids to learning_outcomes
refs OUT-3641
flag=none

Change-Id: If12ee39e323e0f7b36f403595f66af1176de229d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/240474
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-06-17 18:43:50 +00:00
Matthew Lemon 9373400817 add root_account_ids to conversations tables
Conversation, and ConversationParticipant already have the
root_account_ids column so we only need to add it to ConversationMessage
and ConversationMessageParticipant.

fixes VICE-550
flag=none

/ ---- ---- \
| Test Plan |
\ ---- ---- /

- Run the migration
  - bundle exec rake db:migrate:up VERSION=20200616085312
- Verify that the ConversationMessage and ConversationMessageParticipant
  tables have the `root_account_ids` column

Change-Id: I7259e710208378c0ab852b3a2b51cc3a08216160
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/240321
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>
2020-06-17 18:30:35 +00:00
Michael Brewer-Davis 247db4d6c2 remove root_account_id from learning_outcomes
refs OUT-3641
flag=none

Change-Id: Id5266509346638ca0100a7f47426c339f984b64a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/240473
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-06-17 18:14:43 +00:00
Ben Nelson 245b5664aa schema change for reminder smart alert
refs VICE-466

Change-Id: I4461ba85aa4dd4c030719dadcbecd014a89ea7e7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/240470
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
QA-Review: Ben Nelson <bnelson@instructure.com>
Product-Review: Ben Nelson <bnelson@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-06-17 17:48:52 +00:00
Matthew Lemon e85fa83a78 drop root_account_id from conversations tables
This removes the root_account_id from Conversation,
ConversationParticipant, ConversationMessage, and
ConversationMessageParticipant. We are opting to do something similar to
whats already being done in conversation with multiple root account ids
instead.

fixes VICE-549
flag=none

/ ---- ---- \
| Test Plan |
\ ---- ---- /

- Run the migration
  - bundle exec rake db:migrate:up VERSION=20200615170938
- Verify that the Conversation, ConversationParticipant,
  ConversationMessage, and ConversationMessageParticipant tables no
  longer have the `root_account_id` column

Change-Id: I7f736d96556ef86dc033aeb30bb37497809a0a29
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/240320
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>
2020-06-17 15:33:25 +00:00
Clint Furse ed4127c72e basic launch and response from MasteryConnect
closes LA-728
flag = submission_type_tool_placement

Test Plan:
- find a LTI 1 tool that can be configured to do
  submission_type_selection placements.  The
  tool will also need to be able to send a
  ContentItemResponse back to Canvas.  I used
  a tool called lti_tool_provider_example (github)
  and modified it.  The response should include
  the following data for MasteryConnect:
  "https://canvas.instructure.com/lti/mastery_connect_assessment": {
          "points": 10,
          "objectives": "6.R.P.A.1, 6.R.P.A.2",
          "trackerName": "My Tracker Name",
          "trackerAlignment": "6th grade Math",
          "studentCount": 15
        }
- Install the tool under an account or course
- Create an assignment using the submission type
  that matches the tool (not 'External Tool')
- interact with the tool to send a response item
  back to Canvas
- The new data should be displayed below the button
- Save the assignment and verify that the data is
  persisited to the DB as JSON (content_external_tag.external_data)
- also verify data is still correclty displayed when
  editing an assignment

Change-Id: I5b1457e5dcfb8988ec75fbe3dfa1a3ca88bf0a77
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/240130
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Clint Furse <cfurse@instructure.com>
2020-06-17 15:21:23 +00:00
Simon Williams 3a045c6e3b squash old migrations, p34 (through 2016)
Change-Id: I1786323eb8aee2996f2762719dfe7d6204cb92fa
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/238238
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2020-06-17 15:16:34 +00:00
Simon Williams 48b9cd268d squash old migrations, p33 (string limits edition)
Change-Id: I315cad3b16178bbf112c2cfe0127034efc013b4c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/238237
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>
2020-06-17 14:10:18 +00:00
Simon Williams 354b2fc5c9 squash old migrations, p32
Change-Id: I58a7083f764b03b607ca776a03fa6bb1067eca30
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236784
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2020-06-16 18:59:16 +00:00
Cody Cutrer 4f597e78d4 split submissions root_account_id migration into two
Change-Id: I8e0ded3a504a71d2e727f03909c4f378bc673b01
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/240245
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-06-16 17:18:37 +00:00
Mysti Lilla bbc73d8fdd Add subscription_id to Lti::ToolProxy
refs PLAT-5765
flag=none

Test plan
- N/A

Change-Id: Ie00a8d0feaa1193ee2a4c46aa5c72c9b781fb45d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/240278
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-06-15 23:09:46 +00:00
Evan Battaglia ae518dc85f Delete assignments when deleting line items in API
1. Adds "coupled" column which is set only when the line item is the
   default line item created when the user creates an external tool
   Assignment in the UI
2. Allows the API to delete all line items it created
3. Allows the API to delete assignments it created via the line items
   API (that is, deletes the associated assignment if a line item is the
   main line item and was created in the UI)

closes PLAT-5772
flag=none

Test plan:
- before checking out this commit:
- install the LTI 1.3 test tool
- create an Assignment in the UI, choosing external tool as the
  submission type and the test tool as the tool
- create an adition external tool Assignment in the UI
- Go to http://web.lti-13-test-tool.docker/ags/new and create a new line
  item with external_tool as the submission type
- Create a new line item with no submission type
- Create a new line item that is attached to one of the manually-created
  assignments. To do this you must give the `assignment.lti_context_id`
  as resource link ID when creating the second line item
- check out the commit and run migrations
- open a rails console and check that the default line item for the
  manually-created assignments have coupled=true. The other three line
  items should have coupled=false
- create all the line items created above again. Again, only the
  manually-created ones should have coupled=true.
- delete the last line item created (the extra one attached to the
  manually-created assignment) with the test tool. the line item should
  be deleted but the assignment/resource link/first line item should not
  be.
- try deleting (with the test tool) the rest (four) of the last batch
  line items. The ones with coupled=true should get a 401 response.
  The other two should be deleted and their assignments and resource
  links should be deleted.

Change-Id: I992c10f0c36aa5ed84f0e58e1e6c549b14a9d0ee
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/238693
Product-Review: Karl Lloyd <karl@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
2020-06-11 19:23:23 +00:00
Cody Cutrer e760c87d7e switch some migrations to add FK with the column to avoid locking
Change-Id: Icea0c41f49642f9da2c22a6df80066e69e80b125
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/239703
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2020-06-09 21:54:47 +00:00
Cody Cutrer ec32fbefe1 add if_exists option to remove_index
and apply to recent non-transactional migrations

Change-Id: I3ef72208f4c39906905229eb3188eaf4df89c68a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/239699
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-06-09 21:54:40 +00:00
Cody Cutrer d2a8477627 make several recent non-transactional migrations idempotent
Change-Id: I1f311ec2f4569a7d264b141e7a734e8588652741
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/239695
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-06-09 21:54:33 +00:00
Cody Cutrer fd03b83f1f add if_exists option remove_foreign_key
also fix foreign_key_for to prefer the obvious FK

Change-Id: I494c4a73aa136bc4a6735231c0957a9f062bdb11
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/239688
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-06-09 21:54:19 +00:00
Cody Cutrer 4d1ac60e03 add if_not_exists to add_foreign_key
also fix delay_validation with rails 5.2, and constraints can be re-validated
without dropping them

Change-Id: Iab4d2dc374c7b4707d67323d05e8e8e8ff203e47
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/239656
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2020-06-09 21:53:28 +00:00
Jacob Burroughs 0e83411d14 Move root account index addition to a separate postdeploy
Change-Id: I386ca689471a272a5ee2eac4dde41dff6eb97a46
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/239654
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-06-09 19:16:11 +00:00
Adrian Packel bf1be2fe0d Add root_account_id to submissions
closes PLAT-5552
closes TALLY-706
flag=none

Test plan:

Migration:
- Verify migrations run
- Verify a root_account_id can be set on a
  Submission record
- Verify Submissions always live on the same shard
  as their root account

DueDateCacher:
- Do something that triggers a DueDateCacher run (e.g., add some
  students to a course)
- The root_account_id of the resulting submission objects should match
  the owning course's root account ID

Change-Id: Ib4cd4396b736c4e5329c67caeb92cb9b74ddb1ca
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/239395
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Adrian Packel <apackel@instructure.com>
Product-Review: Oxana Jurosevic
2020-06-09 18:15:54 +00:00
Cody Cutrer 69f76f3871 add some missing if_not_exists calls on recent migrations
Change-Id: Ibaa80b9643a5e3754af0a152510b13e68fc6de44
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/239648
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>
2020-06-09 16:37:03 +00:00
Ethan Vizitei 96c6d38b1a auditors read path
refs CNVS-48876
flag = none

make all auditors pass
backend strategy from dynamic
settings

configure indexes in
event_streams with columns
on db tables to search by

use a bookmarked collection
to return results with a simple
paginator

TEST PLAN:
  1) use a dual-writing system for a while
  2) examine API or UI results from auditor
     endpoints
  3) enable reading from postgres
  4) API and UI results from auditor endpoints
     should be equivalent
     (and loaded via SQL queries)

Change-Id: If5b10736077b7721348ede323a34dd843d08c75f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236498
Reviewed-by: Simon Williams <simon@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>
2020-06-09 16:10:33 +00:00
Cody Cutrer 54b53bc094 add if_not_exists option to add_column
and use it for a recent non-transactional migration

Change-Id: I28e6fcc22ff1b22064cde2baf600c86a7728038a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/239564
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2020-06-09 15:36:06 +00:00
Cody Cutrer 1ac2a1b581 add if_not_exists option to add_index
and use it in recent non-transactional migrations

Change-Id: Ie96e3cbf727403c5dfe9d04bc3403170c076d5b6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/239560
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2020-06-09 15:35:59 +00:00
Cody Cutrer d85aa95894 make it easy for add_column_and_fk helper to be idempotent
Change-Id: I4d5c8d85a7cd0a7aa2c84f3278bfcecef0425398
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/239559
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2020-06-09 15:35:51 +00:00
Cody Cutrer a69b2d18cc skip populating course id in migration if they are all already populated
this query is fast, because there is already an index on the column

Change-Id: Iee781570bb897001724d5753a02dbb8b03911619
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/239478
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2020-06-09 15:18:28 +00:00
James Williams 99c5a44fec drop conditional release template models
despite all initial appearances it turns out these are
functionally unused and probably won't change any time soon

test plan:
* specs

closes #LA-1108

Change-Id: Ia5411d355659471465971e3f154292230841a709
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/239380
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2020-06-08 16:58:54 +00:00
Simon Williams ffd987116a squash old migrations, p31
Change-Id: I55fcceb76bae8f3d13d5b34c1cfc77b8e57a192e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236783
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2020-06-07 00:45:02 +00:00
Simon Williams 9535bee361 squash old migrations, p30
Change-Id: Ic70fd33a97c388cf4e1a1dfd6ad26c023f5f3040
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236782
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2020-06-06 03:44:59 +00:00
Simon Williams a72e6cd4fd squash old migrations, p29
Change-Id: I14eb45f796dfdf102f37b1aeb9ad664ab593465b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236781
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2020-06-06 02:55:12 +00:00
Mysti Lilla 57ed77011a Migration for root account id backfill
closes PLAT-5837,PLAT-5838,PLAT-5839
flags=none

- On running this, it should fill root_account_id
  for any tables currently in the migration_tables
  method in the referenced data fixup

Test plan
- Running this migration should cause any
  developer keys and developer key account bindings
  to have their root account ids populated as well
  as Context Modules

Change-Id: I1020f67475465b63f88a83353f5cb93ffe8d6b51
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236779
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2020-06-06 02:17:03 +00:00
wdransfield f33b0c2662 Add root_account_ids to users
This change prepares Canvas Data 2 to route user
events to the proper customers

After getting feedback from folks all over the org,
we've decided to store root_account_ids on the users
table.

The intent is to populate this column with all with
global root account IDs as user_account_associations
are created, updated, and deleted for root accounts.

This population feature will be introudced in a
later commit with the ability to be turned off in
cisco accounts where a user can have many
user_account_associations with root accounts.

Here is some data that led us to this decision:

user -> root account association numbers for
all non-cisco canvas:

*One root account association:* 63% of users
*Five or fewer root account associations:* 90% of users
*Ten or fewer root account associations:* 96% of users
*Max root account associations:* 316 root accounts (1 user)
*Total Users: 118,216,506*

Closes PLAT-5596
flag=none

Test Plan:
- Verify the new migration can be run up and down
- Verify the root_account_ids attribute on the User
  model can be set and saved

Change-Id: I0a3e738d7a4cbdef224d381df488918d65e6cbc4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/238281
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2020-06-05 15:04:29 +00:00
wdransfield 08110b6cda Add root_account_id to content_participation_counts
Closes PLAT-5561
flag=none

Test Plan:
- Verify migrations run
- Verify a root_account_id can be set on a
  ContentParticipationCount record
- Verify ContentParticipationCount records
  always live on the same shard as their root account

Change-Id: Iab1ca4aca9ba78d81f01ed427b13350edf26de44
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/233684
Reviewed-by: Clint Furse <cfurse@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Clint Furse <cfurse@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2020-06-05 15:04:01 +00:00
wdransfield cbf359cdb5 Add root_account_id to web_conference_participants
Closes PLAT-5817
flag=none

Test Plan:
- Verify migrations run
- Verify a root_account_id can be set on a
  WebConferenceParticipant

Note that backfill and model logic will come in a
later commit

Change-Id: I2790395aafe9921852b1ee814b30dff2a796c3ff
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/238662
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2020-06-04 14:56:55 +00:00
wdransfield feaa24b7d1 Add root_account_id to web_conferences
Closes PLAT-5816
flag=none

Test Plan:
- Verify migrations run
- Verify a root_account_id can be set on a
  WebConference

Note that backfill and model logic will come in a
later commit

Change-Id: If16f1bc10d752a57368764da1471644c1ae29834
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/238663
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2020-06-04 14:56:27 +00:00
James Williams f16f2867b9 add conditional release tables and model scaffolds
- should only bring over the relevant tables (i.e.
 no copies of canvas objects or infrastructure tables)
 or rename the copied table if useful data is stored through it
 (i.e. cr's "assignments" are now "assignment_set_associations"
  because they were used to join to canvas assignments)

- should denormalize references to go directly to canvas
 tables (also use integers instead of strings for ids)

test plan:
* migrations and specs run

closes #LA-1093

Change-Id: I864e5332cf9f51d41f685a229c36c1afb8ac42ff
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/239016
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2020-06-03 20:52:05 +00:00
Ethan Vizitei e60716629c index foreign keys for test student reset
Change-Id: Ib0454b8ea2fec96e822d12b1535efdb83e9f3ddd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/239131
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-06-03 18:29:56 +00:00
Xander Moffatt 30dca612db add root_account_id to favorites
closes PLAT-5605
flag=none

test plan:
* verify migrations run
* verify a root_account_id can be set on a
  Favorite record
* verify Favorites always
  live on the same shard as their root account

Change-Id: I2990a7d86f7c558b3a798a91926e7512cc037390
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236955
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Xander Moffatt <xmoffatt@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2020-05-29 15:28:20 +00:00
wdransfield 3923e16041 Add root_account_id to asset_user_accesses
Note that the root_account_id should be
set to the root account ID of the asset
being accessed.

If the asset being accessed is not tied
directly to a root account (a user
attachment for example), root account id
will be left blank

Closes PLAT-5580
flag=none

Test Plan:
- Verify migrations run
- Verify a root_account_id can be set on a
  AssetUserAccess record
- Verify AssetUserAccess always live on
  the same shard as their root account

Change-Id: Iebf25798ec27023233be7eb0f9debdf3783b1a8e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236877
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
2020-05-29 14:51:44 +00:00
Ethan Vizitei 8f328d531f annotate job-ids on auditor records
refs CNVS-48876
flag = none

TEST PLAN:
 1) run backfill
 2) migration cells should have job ids for logs

Change-Id: If716a1f673bd45ecc44a4c9cee2e1c7577d27d45
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/238687
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2020-05-29 01:26:43 +00:00
James Williams 3f4a5d1084 drop submission.context_code in favor of submission.course_id
test plan:
* smoke test todo list
 (needs grading and peer review lists in particular)

closes #LA-952

Change-Id: I613ffa2499986700744482c56976bba207cfb971
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/234903
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2020-05-28 23:31:13 +00:00
wdransfield 5532679416 Add root_account_id to custom_gradebook_columns
Closes PLAT-5543
flag=none

Test Plan:
- Verify migrations run
- Verify a root_account_id can be set on a
  CustomGradebookColumn record
- Verify CustomGradebookColumn records always live on the same shard
  as their root account

Change-Id: I0d2c3c25afe50fc9abdf57e2a3d8d089a9c8ee2b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/235209
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2020-05-28 17:27:41 +00:00
wdransfield 96a1743858 Add root_account_id to post_policies
Closes PLAT-5547
flag=none

Test Plan:
- Verify migrations run
- Verify a root_account_id can be set on a
  PostPolicy record
- Verify PostPolicy records always live on the same shard
  as their root account

Change-Id: I5c274ba14d78969e1b3b71a7daedc12518f7f3b7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/235198
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2020-05-28 17:27:20 +00:00
wdransfield b58ffab2e7 Add root_account_id to discussion_entry_participants
Closes PLAT-5736
flag=non

Test Plan
- Verify migrations run
- Verify you can set the root_account_id
  of a DiscussionEntryParticipant

Change-Id: Id9266ac7b38542d50dd9f39bd246eb2bf1131532
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/238593
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2020-05-28 17:26:16 +00:00
wdransfield 906a7732af Add root_account_id to conversation_participants
Closes PLAT-5603
flag=none

Test Plan:
- Verify migrations run
- Verify a root_account_id can be set on a
  ConversationParticipant record
- Verify ConversationParticipant records
  always live on the same shard as their
  root account

Change-Id: I396cd193512cae37976241c73ff6e595b4e6083c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/235265
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
2020-05-27 18:59:00 +00:00
Xander Moffatt 56f9db167a add root_account_id to account_users
closes PLAT-5579

test plan:
* verify migrations run
* verify root_account_id can be set on an AccountUser
* verify AccountUser_s live on the same shard as their root account

Change-Id: I5a227a9d62552803085eb2db6d6568f58020d0d0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/235721
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Xander Moffatt <xmoffatt@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Clint Furse <cfurse@instructure.com>
QA-Review: Clint Furse <cfurse@instructure.com>
2020-05-27 16:16:23 +00:00
wdransfield c5fe88bfc0 Add root_account_id to submission_versions
Closes PLAT-5554
flag=none

Test Plan:
- Verify migrations run
- Verify a root_account_id can be set on a
  SubmissionVersion record
- Verify SubmissionVersion always live on the same shard
  as their root account

Change-Id: I89953ce6be4c27c9226d454a50a968e9d56ad3e9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/235011
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2020-05-27 16:02:06 +00:00
wdransfield 7140eed397 Add root_account_id to grading_periods
Closes PLAT-5549
flag=none

Test Plan:
- Verify migrations run
- Verify a root_account_id can be set on a
  GradingPeriods record
- Verify GradingPeriods always
  live on the same shard as their root account

Change-Id: I4a1935c7d7956dcc07919033a14e56136eb5ce63
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/235018
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2020-05-27 14:58:50 +00:00
Xander Moffatt 22b191cd7f add root_account_id to user_account_associations
closes PLAT-5595

test plan:
* verify migrations run
* verify root_account_id can be set on a UserAccountAssociation
* verify UserAccountAssociation_s live on the same shard as their root account

Change-Id: Id337a5c0761de3491cb7e29b77acd989ec9dfab8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/235727
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Xander Moffatt <xmoffatt@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2020-05-27 14:41:21 +00:00
Xander Moffatt eaa7807bbb add root_account_id to user_notes
* note that only some UserNotes will have a root account id
(those associated with a faculty journal)
* all others will have blank root account ids

closes PLAT-5588
flag=none

test plan:
* verify migrations run
* verify a root_account_id can be set on a
  UserNote record
* verify UserNotes always
  live on the same shard as their root account

Change-Id: Ib734d3bb9f8365d315ee8bda5d9e1f1ae9736ae3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236933
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Xander Moffatt <xmoffatt@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
2020-05-27 14:41:03 +00:00
Xander Moffatt 1090a01f40 add root_account_id to conversation_messages
closes PLAT-5602
flag=none

test plan:
* verify migrations run
* verify a root_account_id can be set on a
  ConversationMessage record
* verify ConversationMessages always
  live on the same shard as their root account

Change-Id: I2e04a5eb6b3156fd14064954e73bbb6adafe8d3c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236953
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Xander Moffatt <xmoffatt@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2020-05-27 14:40:49 +00:00
Xander Moffatt c5d108b3ce add root_account_id to folders
* note: records that have a context of course, group,
or account will have a root_account_id
* records with a user context will not have one

closes PLAT-5606
flag=none

test plan:
* verify migrations run
* verify a root_account_id can be set on a
  Folder record
* verify Folder always
  live on the same shard as their root account

Change-Id: Iaebeb34416a47279ec7e0bcb560dcc142afdf504
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236935
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Xander Moffatt <xmoffatt@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2020-05-27 14:40:33 +00:00
Xander Moffatt b62fb7aad9 add root_account_id to communication_channels
closes PLAT-5600
flag=none

test plan:
* verify migrations run
* verify a root_account_id can be set on a
  CommunicationChannel record
* verify CommunicationChannels always
  live on the same shard as their root account

Change-Id: I9cfcc6bf52beeec5b7d697acc708ec509cbdca8c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236952
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Xander Moffatt <xmoffatt@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
2020-05-27 14:40:19 +00:00
Xander Moffatt 9b57ba1be1 add root_account_id to calendar_events
* note: only records with a context of course, group, or account
will have a root_account_id
* records with a user context will not have one

closes PLAT-5599
flag=none

test plan:
* verify migrations run
* verify a root_account_id can be set on a
  CalendarEvent record
* verify CalendarEvents always
  live on the same shard as their root account

Change-Id: I6b2c1f25aba2ddca32eaea14a121f8aedc4525c0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236934
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Xander Moffatt <xmoffatt@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2020-05-27 14:40:03 +00:00
Xander Moffatt 6961fc81aa add root_account_id to discussion_topics
closes PLAT-5776
flag=none

test plan:
* verify migrations run
* verify a root_account_id can be set on a
  DiscussionTopic record
* verify DiscussionTopic always
  live on the same shard as their root account

Change-Id: I18c6e815490abea9633d466f2d8213f4894f8eae
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236956
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Xander Moffatt <xmoffatt@instructure.com>
Reviewed-by: Clint Furse <cfurse@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Clint Furse <cfurse@instructure.com>
2020-05-27 14:39:51 +00:00
Xander Moffatt 2daa198644 add root_account_id to access_tokens
closes PLAT-5587

test plan:
* verify migrations run
* verify root_account_id can be set on an AccessToken
* verify AccessToken_s live on the same shard as their root account

Change-Id: I0183d39de21ae957eb49a2a68a6e750ab27060ad
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/235726
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Xander Moffatt <xmoffatt@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
2020-05-27 14:39:36 +00:00
Xander Moffatt ab62e1d4aa add root_account_id to conversation_message_participants
closes PLAT-5601
flag=none

test plan:
* verify migrations run
* verify a root_account_id can be set on a
  ConversationMessageParticipant record
* verify ConversationMessageParticipants always
  live on the same shard as their root account

Change-Id: Ib6eff6b6d8a2cdac2c00db6eeda45b5290927493
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236954
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Xander Moffatt <xmoffatt@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2020-05-27 14:39:15 +00:00
Xander Moffatt ebd86d2497 add root_account_id to content_shares
closes PLAT-5563
flag=none

test plan:
* verify migrations run
* verify a root_account_id can be set on a
  ContentShare record
* verify ContentShares always
  live on the same shard as their root account

Change-Id: I3261791c49996047296b23c555eeb325d4cc8826
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236932
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Xander Moffatt <xmoffatt@instructure.com>
Reviewed-by: Clint Furse <cfurse@instructure.com>
QA-Review: Clint Furse <cfurse@instructure.com>
2020-05-27 14:38:59 +00:00