Commit Graph

445 Commits

Author SHA1 Message Date
Cody Cutrer 551e4d137c RuboCop: Performance/StartWith
auto-corrected, with post-review checking for possible nilness

Change-Id: I89c30b92691a2a5f73d98d9c8ac721c50d3a4ba7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278014
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-11 22:53:48 +00:00
Cody Cutrer 1832881748 RuboCop: Performance/RegexpMatch
[skip-stages=Flakey]

auto-corrected

Change-Id: Icf79dc86947cde22d0853b3db8afa3db853e7b8a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278013
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-11 22:02:06 +00:00
Cody Cutrer 6bdee6ed50 RuboCop: Style/SlicingWithRange
[skip-stages=Flakey]

auto-corrected (with manual post-review looking for possible non-array,
non-string slices that might go bad, with none found)

Change-Id: I00feba96f58f701ed1f668f86928b8871d0d8ef2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277991
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-11 21:56:43 +00:00
Cody Cutrer 6311053d81 RuboCop: Style/ColonMethodCall
[skip-stages=Flakey]

auto-corrected

Change-Id: I46f0ee2c3fb97f3ca37627c0edd8eecffaf0aa59
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277986
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-11 17:39:58 +00:00
Cody Cutrer a38ba75856 RuboCop: Style/RedundantCondition
auto-corrected

Change-Id: I5b6b6d5e75a5573d621a728a676c64bb908e8b63
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277971
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-11 17:39:32 +00:00
Cody Cutrer 8d4fee2d25 RuboCop: Style/RedundantAssignment
[skip-stages=Flakey]

auto-corrected

Change-Id: I73517db1000afa49b81fdd4f40d610faa760e6ff
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277967
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-11 17:39:20 +00:00
Cody Cutrer ba1fdaf2a9 RuboCop: Style/ConditionalAssignment
auto-corrected

Change-Id: Ie87e4c1b6c05bc31ce13481a94c413dcf7b20278
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277964
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-11 17:39:06 +00:00
balazs.komaromi b14445880f Populate deleted_at of pseudonym during sis import
During user deletion, workflow_state was changed to
'deleted' on the Pseudonym, but deleted_at property
was not set. This change fixes this, deleted_at
will be set to the current time.

Closes SOS-2378

Test plan:
 - Do a SIS import with one active user in it
 - Change the status of the user to 'deleted' in CSV
 - Run SIS import again
 - Check the deleted_at property for the given user
   in the pseudonyms table of the Canvas database

flag = none

Change-Id: I6ea6cfedc5e2889ff8ce6914978137025f49cd68
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277663
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2021-11-11 09:09:08 +00:00
Cody Cutrer ddfd72ca17 RuboCop: Style/RedundantBegin
[skip-stages=Flakey]

auto-corrected

Change-Id: I6a29a9d2fa1057e2278c105a8331d2c79e496897
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277904
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-11 02:19:27 +00:00
Cody Cutrer cf213ee24b RuboCop: Style/RedundantFreeze
[skip-stages=Flakey]

auto-corrected

Change-Id: Id1b8bafdd744219a4797e6e1ba5891cd7ce4bccd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277888
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-11 02:06:47 +00:00
Cody Cutrer b2d5e59698 RuboCop: Style/RedundantParentheses
[skip-stages=Flakey]

auto-corrected

Change-Id: I773f1128042a03265d6e925cfd86d69f0dc11892
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277877
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-11 02:06:22 +00:00
Cody Cutrer 7fdf9d7588 RuboCop: Lint
[skip-stages=Flakey]

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

all manual

Change-Id: Ibeb81e013f56f160d51f7d237a9bcfe98daa1e53
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277569
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-09 21:42:31 +00:00
Cody Cutrer 649e5b36a2 RuboCop: Lint/ShadowingOuterLocalVariable
[skip-stages=Flakey]

all manual

Change-Id: Ieb74efcd4206426973dd72eb2ca7c5f5af5167f4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277394
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-04 14:02:24 +00:00
Cody Cutrer 61e5b3a6dc RuboCop: Lint/UnusedMethodArgument lib
all manual

Change-Id: I0db0dbf9ffec3ac6675f6d159f8d038fe2f09256
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276489
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-10-27 15:54:27 +00:00
Cody Cutrer 44614b47d7 RuboCop: Lint/UselessAssignment app, config, doc, gems, lib
(everything except spec)

all manual

Change-Id: I6c49a3139efb0f0802ba63a15cab4d4d2cd0b8dd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276310
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-10-27 15:36:29 +00:00
Cody Cutrer 3b38d39572 support suspending users via SIS import
closes FOO-2414

test plan:
 * create a user via SIS
 * run another SIS import with the user's status set to "suspended"
 * that use should no longer be able to login

Change-Id: I31b177ee797b3dd8962112960bda11c5c4fa575a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276557
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-10-26 15:26:11 +00:00
József Kozma 46f2947903 Store declared_user_type while importing CSV
Closes SOS-1917
flag=none

Test plan:
- import a csv with declared_user_type provided
- verify that the user has declared_user_type set
- import a csv with declared_user_type not provided
- verify that the user still has declared_user_type set previously
- import a csv with declared_user_type=<delete>
- verify that user's declared_user_type is unset

Change-Id: I9a26247b20f65cdb96a5a84e0eb53dd29f391467
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275475
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Kozma Jozsef <jkozma@instructure.com>
Product-Review: Kozma Jozsef <jkozma@instructure.com>
2021-10-12 09:26:28 +00:00
Rob Orton dddd8d8b4c remove group leaders on user deletion via sis
test plan
 - specs should pass

fixes VICE-2068
flag=none

Change-Id: I939895a817d03fb654590d3e3734337704a669d4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275649
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>
2021-10-12 06:26:00 +00:00
Ethan Vizitei aa2edaaf29 do away with non-conventional "common" module
closes FOO-2459
flag=none

move defined constants into the sis module proper

TEST PLAN:
  1) specs pass

Change-Id: I053e551055a65b7de2a0c23cd571599dc4a8d64f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275450
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2021-10-07 21:55:24 +00:00
Cody Cutrer b973c7ca27 RuboCop: Style/ParenthesesAroundCondition
[skip-stages=Flakey]

(auto-corrected)

this complements Lint/AssignmentInCondition

Change-Id: I8e621631cb8565cc6062398cfab714f61b485cad
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274747
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-30 12:59:18 +00:00
Cody Cutrer dbd8c46655 RuboCop: Lint
[skip-stages=Flakey]

auto corrections applied:
 * Lint/AmbiguousOperator
 * Lint/AmbiguousOperatorPrecedence
 * Lint/AmbiguousRegexpLiteral
 * Lint/DeprecatedClassMethods
 * Lint/DeprecatedOpenSSLConstant
 * Lint/NonDeterministicRequireOrder
 * Lint/ParenthesesAsGroupedExpression
 * Lint/RedundantRequireStatement
 * Lint/RedundantSafeNavigation
 * Lint/RedundantSplatExpansion
 * Lint/RedundantStringCoercion
 * Lint/RedundantWithIndex
 * Lint/SendWithMixinArgument
 * Lint/SymbolConversion

Change-Id: I222ec19978033544513bb99755994d109435abad
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274551
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-29 03:38:23 +00:00
Cody Cutrer 223aedadff rubocop: update to 1.21
[skip-stages=Flakey]

new cop autocorrected: Layout/LineEndStringConcatenationIndentation

Change-Id: Ib59a7fadeb2d9af68d90eb82b9ac855dead29121
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274524
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-28 02:40:46 +00:00
Cody Cutrer c65d57737a RuboCop: Layout lib
Change-Id: I0655d9a9d750f2debd6378b03d8ddc1403ebc31b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274158
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-22 20:01:52 +00:00
Rob Orton 25fbdc45e7 ignore BOM for csv imports
test plan
 - upload file with BOM
 - it should just import

fixes VICE-2058
flag=none

Change-Id: Ibc9b6743390b7f74769f61caf063b7c8a3c00988
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273489
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2021-09-14 03:05:20 +00:00
Rob Orton 8741d6dda4 allow the retries to happen without failing the sis job
refs VICE-2001
flag=none

Change-Id: I89c05e536ee27adf5b26a93c03d8b5ca7e6007f2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272638
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2021-09-01 19:48:36 +00:00
Rob Orton e1bbee5e88 Setting.get works better
...whoops

flag=none
refs VICE-2001

Change-Id: I4c743c19d1849abfd30dbf8445c88dc6f3a6ba3c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272630
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-08-31 21:45:54 +00:00
Rob Orton 84ff473268 log stat for each parallel worker
test plan
 - specs should pass

refs VICE-2001
flag=none

Change-Id: I3073e72c2b4e5d44300e583311286fa7db8b512c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272625
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-08-31 21:09:59 +00:00
Rob Orton 998d1d3f2e add more resilient retries to sis imports
instead or retrying with the same process, retry with a new job

test plan
 - run sis import
 - it should work

fixes VICE-2001
flag=none

Change-Id: I18034482c4cb37c74999f6a6935274e959a5e822
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272624
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2021-08-31 21:01:43 +00:00
Rob Orton 321245c6d8 remove course dates via sis import with <delete>
test plan
 - import course file with dates and use <delete> to remove the dates
 - it should work, see specs

fixes VICE-1993
flag=none

Change-Id: I7ac72679077bf86669ac87a7f231c0744fb4ede2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272540
Reviewed-by: Matthew Lemon <mlemon@instructure.com>
QA-Review: Matthew Lemon <mlemon@instructure.com>
Product-Review: Matthew Lemon <mlemon@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-08-30 21:34:26 +00:00
Jeremy Stanley 4c0800f696 disallow enrolling students in blueprint courses via SIS import
test plan:
 - set up a blueprint course
 - give it a SIS ID in course settings
 - in account settings, attempt to enroll a student via
   SIS import, providing an enrollments.csv containing
   something like the following:

course_id,user_id,role,status
SIS_BLUEPRINT_COURSE_ID,SIS_USER_ID,student,active

 - you should get a warning message that says the student
   enrollment in the blueprint course isn't allowed

flag = none
fixes LS-2552

Change-Id: Ic5bf97ed742b6fee9a35df9d7777b650095560f8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271937
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Ed Schiebel <eschiebel@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2021-08-23 16:07:43 +00:00
Cody Cutrer 0847dc9670 allow suspending pseudonyms
where suspending means they still show up everywhere, but the user is no longer
allowed to login

closes FOO-2039

test plan:
 * have a regular user with an access token, and an active session
 * (via a separate session or access token) suspend a pseudonym
   via the API as an admin (logins API, set workflow_state to
   suspended)
 * ensure the original user gets logged out when they refresh, and
   that their access token doesn't work
 * but as the admin, you can still see the user

Change-Id: Idc0c61bcc244697e3c89b9beb2edfbe2a504b00e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269878
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-08-16 19:40:52 +00:00
David 5ae4487e31 add update_sis_id_if_login_claimed param
If a pseudonym is found during a user import but the SIS ID doesn't match,
this flag would override the old (or non-existent) non-matching SIS ID
with the new SIS ID in the upload.

closes SOS-1922

Test plan:
 - Do a SIS import
 - Change the SIS ID of one user in the input file
 - Run SIS import again
 - Check the SIS ID of the changed user in Canvas

flag = none

Change-Id: I2b29904c1e34e7a7beebd5f41176e35f3fb54ef1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/267749
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2021-06-28 17:22:12 +00:00
Cody Cutrer f1b857bff8 feature flag to disable self service user merge
closes FOO-1906

Change-Id: I7375fede11e02a98c11cb3b3e777a57af13dc752
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/264564
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Ahmad Amireh <ahmad@instructure.com>
2021-05-25 15:54:52 +00:00
Jeremy Stanley 716e5150e6 add homeroom_course to SIS import
test plan:
 - render docs, and click "SIS CSV Format" in the left nav
 - see the field name for homeroom_course under courses.csv
 - ensure you can use this field to create a homeroom course or
   update an existing course'd (with SIS ID) homeroom setting

flag = canvas_for_elementary

closes LS-2122

Change-Id: Ica7ceff2bdfb5035c15cf237cc230b6cd117a603
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/263947
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: Jeremy Stanley <jeremy@instructure.com>
2021-05-03 15:55:41 +00:00
Cody Cutrer df936044ec don't recompute due dates multiple times
when moving students between sections in a sis import

Change-Id: Ia04fb6c5d2d17ea4a6da24080735319f787a7622
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/263374
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>
2021-04-26 23:06:38 +00:00
Rob Orton 686271a82e always use jobs to update cached_due_dates
there is a known condition in our submission upsert that cause a
deadlock to happen because of a bunch of history that I have mostly
forgotten. see 7fd0528c3a for more context

The logic will rescue a dead lock, and then the job knows to retry if it
hit the dead lock. If it is not run in a job, we don't get the retry,
and it it hits the deadlock and fails the import.

test plan
 - specs should pass
 - move to section should not hit visible dead lock errors

fixes FOO-1555
flag=none

Change-Id: If8c7e6fa1d24e92a8dab1d6ebf5b29a7802ba5d3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/257699
Reviewed-by: Michael Ziwisky <mziwisky@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2021-03-26 22:34:54 +00:00
Ethan Vizitei d66b291eea make sure strings don't sneak into bulk imports
closes FOO-1366
flag=none

TEST PLAN:
  1) run sis enrollments import that adds a string error
     to "messages"
  2) it gets inserted as a SisBatchError, no explosion

Change-Id: I87f54f5300448c5ed005612c44639d33bc4d41c7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/255603
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-12-18 22:04:54 +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
Rob Orton 6bdb14b887 allow deleting pronouns via sis import
test plan
 - specs should pass
 - run sis import with <delete> as the pronoun
 - it should remove the users pronoun
 - rake doc:api should work

fixes VICE-955

Change-Id: I2112b785641148a5a3edfe5313ab067ef47005e2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251672
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-11-03 17:58:32 +00:00
Ethan Vizitei 14c4210c6e keep scope query within x-shard block
closes FOO-1126

TEST PLAN:
  1) try to import a user that has more than 100
     paths with the same email address
  2) SIS import should not bomb

Change-Id: I642ea259accdc3b50060f9f28a803211f026830e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251650
Tested-by: Ethan Vizitei <evizitei@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2020-11-02 18:06:21 +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
Ethan Vizitei 866948ca01 validate channel uniqueness on the correct shard
closes FOO-1148
flag=none

TEST PLAN:
  1) import sis batch with an x-shard user and an existing
     communication channel for the target email address.
  2) we should detect the channel already exists and not
     try to create a new one
  3) the batch should succeed.

Change-Id: I20e4b0a7f61545715ff014e96492cc7a88916297
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251391
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
2020-10-29 16:51:47 +00:00
Cody Cutrer 06763dd519 add # frozen_string_literal: true for lib
Change-Id: I59b751cac52367a89e03f572477f0cf1d607b405
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251155
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-27 20:49:50 +00:00
Ethan Vizitei e322c643b0 retry on malformed parallel importers
closes FOO-1112

TEST PLAN:
  1) force your attachment reading flaky (see test)
  2) try to import, first malformed csv failure should
     redownload and retry
  3) truly malformed csv should raise after 2 attempts

Change-Id: I3373a45f75965381604c28b05c42932491cc51f8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250761
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2020-10-22 18:04:01 +00:00
Cody Cutrer dfc0fe5f6a ruby 2.7/rails 6: several deprecation warning and spec fixes
Change-Id: I6314b3f304e8befc18ee2f832993a0740690d786
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249956
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-10-14 16:13:04 +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 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
Rob Orton 5cf46175b2 create communication_channels on users shard
also look for the communication channel on the users shard

test plan
 - have an account with a trust in place
 - have a user with a login on both accounts
 - on the account that is not on the same shard as the user
 - run a user import that adds an email to the sis_id of the login
 - it should be on the users shard

fixes VICE-889
flag=none

Change-Id: I1a4155892d519691d26797620a0d9a1b9c00d8e4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249192
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-10-05 22:24:32 +00:00
Rob Orton 968347af50 import all pronouns
SIS is considered source of truth, and sis may change pronouns and don't
want to manage a second list of accepted pronouns

test plan
 - run sis import with pronoun
 - it should add it even when not in account list

fixes VICE-838
flag = none

Change-Id: I51804ac73c8a1934d5c135c736de0a3dfa6131b2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/248782
Reviewed-by: Caleb Guanzon <cguanzon@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Caleb Guanzon <cguanzon@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-09-30 18:55:57 +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