Commit Graph

1780 Commits

Author SHA1 Message Date
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