Commit Graph

524 Commits

Author SHA1 Message Date
Ievgenii Matkivskyi bd2f58e127 Validate user csv rows before importing
flag=none
Closes SOS-2621

Test plan:
 - Upload archive with user.csv
 - User.csv should contain broken rows with NULL characters

Change-Id: Ie3a1d6ef7e10eb429edbf99f763ac949e3d30dcd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/283422
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Balazs Komaromi <balazs.komaromi@instructure.com>
Reviewed-by: Hubert Lubaczewski <hlubaczewski@instructure.com>
QA-Review: Ievgenii Matkivskiy <ievgenii.matkivskiy@instructure.com>
Product-Review: Ievgenii Matkivskiy <ievgenii.matkivskiy@instructure.com>
2022-01-30 16:42:09 +00:00
balazs.komaromi f2b3a9b493 Fix removing sticky fields from Pseudonym
When no changes happened for a user and
clear_sis_stickiness flag was on, the
'stuck_sis_field' didn't get cleared on Pseudonym.

This is because the before_save callback didn't
fire in lib/sticky_sis_fields.rb.

By changing the sis_batch_id on the Pseudonym, we
can force an update (and with that clearing the
sticky fields).

Test plan:
 - Import a user
 - Change its login_id to something
 - Do another SIS import, using the same login_id
   and with setting 'Clear UI-changed state'
 - Observe the 'stuck_sis_fields' gets cleared on
   the Pseudonym. Next SIS import will be able to
   overwrite any property

References SOS-2633

flag=none

Change-Id: I80ee45198863785b4c693375bc54557cc13f66e4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/283658
Reviewed-by: Kozma Jozsef <jkozma@instructure.com>
Reviewed-by: Richard Zana <rzana@instructure.com>
Reviewed-by: August Thornton <august@instructure.com>
QA-Review: Balazs Komaromi <balazs.komaromi@instructure.com>
Product-Review: Balazs Komaromi <balazs.komaromi@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2022-01-28 08:04:25 +00:00
Mukhammadsher Shermamatov af11a035f3 Fix validation in user_importer
Closes SOS-2558

Test plan:
- Try to do sis import with a user without status
- Get formatted error message

flag = none

Change-Id: Ib1c4e34c4b4d8d03a125691c0453ae49f1276000
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279541
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: August Thornton <august@instructure.com>
Reviewed-by: Balazs Komaromi <balazs.komaromi@instructure.com>
QA-Review: Mukhammadsher Shermamatov <mshermamatov@instructure.com>
Product-Review: Mukhammadsher Shermamatov <mshermamatov@instructure.com>
2021-12-01 18:30:48 +00:00
Cody Cutrer c2cba46851 RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation
[skip-stages=Flakey]

auto-corrected

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

auto-corrected

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

auto-corrected

Change-Id: Id187ed60c5590025e780d81b85b5212f51368f27
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279196
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
2021-11-23 14:30:08 +00:00
Cody Cutrer 04e28fd25c RuboCop: Style/Next
[skip-stages=Flakey]

auto-corrected

Change-Id: Ia842e948dc2f6f0eb2d39a66e1c56cc4fe90bd5c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279168
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-23 14:29:04 +00:00
Cody Cutrer 25b301e97d RuboCop: Style/IfInsideElse, Style/SoleNestedConditional
[skip-stages=Flakey]

auto-corrected with post review ensuring line breaks continue to
convey original meaning of separated conditions, and cleaning up
some now-duplicated conditions

Change-Id: Ib9b31226de0665a2e4427fe595639d0d91a33f83
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279151
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-23 14:28:35 +00:00
Cody Cutrer efc87c595a RuboCop: Style/LineEndConcatenation
[skip-stages=Flakey]

auto-corrected, with post review looking for opportunities to convert
to heredocs

Change-Id: Ic163882ebb5f4d2d28b5e5fd65188781d8eef3c8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279287
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-23 03:13:13 +00:00
Cody Cutrer c776b6ef3a RuboCop: Style/CommentAnnotation
[skip-stages=Flakey]

auto-corrected

Change-Id: Ic82dbc22b8e63cc5f2ccb9b561cb3b9ed6628966
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279100
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
2021-11-21 00:50:46 +00:00
Cody Cutrer 55428b3440 RuboCop: Rails/Blank, Rails/Present
[skip-stages=Flakey]

auto-corrected

Change-Id: Ia0f5b0a40203d2023200683fa93ab4564372b271
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279084
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-20 21:09:43 +00:00
Cody Cutrer eecafdca0b RuboCop: Style/NegatedIfElseCondition
[skip-stages=Flakey]

auto-corrected

Change-Id: I973e75a76d2103c802fab2c52676baf080bd516d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279080
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-20 21:09:31 +00:00
Cody Cutrer ff99d18138 RuboCop: Style/RedundantSelf
[skip-stages=Flakey]

auto-corrected

Change-Id: I5f26ad1f8210a74c2198b514235d5134dcd0dae1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279070
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-11-20 16:41:21 +00:00
Cody Cutrer 16bb07021f RuboCop: Style/AndOr, Style/Not
auto-corrected

Change-Id: I410fc4618aa834c62fccf8370866e115b437386a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278802
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-19 22:22:35 +00:00
Cody Cutrer 2152076574 RuboCop: Style/ZeroLengthPredicate
[skip-stages=Flakey]

auto-corrected, and also introduced empty? method on several
file-like classes so that the autocorrect is safe on them

Change-Id: I7c84a39fc3f11cad50bf4ccb3cd97883881c2129
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278756
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-18 23:07:03 +00:00
Cody Cutrer 4d43809cae RuboCop: Style/PercentLiteralDelimiters
[skip-stages=Flakey]

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

Change-Id: I7f7afb11edd63415cde10866822dd2ac5ba0d8be
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278669
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
2021-11-18 23:05:50 +00:00
Cody Cutrer b5f542abdc RuboCop: Style/SingleArgumentDig
[skip-stages=Flakey]

auto-corrected

Change-Id: If1958cfa805c0c8f4081ab4deac90c892a0e20d8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278742
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-18 21:37:03 +00:00
Cody Cutrer d6cc861d50 RuboCop: Style/NegatedUnless, Style/NegatedWhile
auto-corrected

Change-Id: I382bbd776e89244784652751a7efb642827d0209
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278762
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-18 19:04:00 +00:00
Cody Cutrer fa07d9b198 RuboCop: Style/HashTransform*
auto-corrected, with post-review to look for things that are only
hash-like (one found; fixed by calling `to_h` beforehand)

Change-Id: I1a1f273513ff466197a4da6a7b6f68565a08abe0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278500
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-17 15:17:59 +00:00
Cody Cutrer 5970adfb0f RuboCop: Style/HashConversion
auto-corrected

Change-Id: Iac81f55bb4f8d58bde910d7aa4c98112df65f6a3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278497
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-17 15:17:51 +00:00
Cody Cutrer 14ee01c805 RuboCop: Performance/Sum
[skip-stages=Flakey]

the form .map { }.sum was autocorrected to .sum {}.

.map {}.inject(:+) and variations was manually corrected

Change-Id: I44b8ef3b8257e8acf70f259aed35f1e16cde9856
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278335
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-16 17:10:38 +00:00
Cody Cutrer eb258d1a9b RuboCop: Performance/Casecmp
manual

Change-Id: Iea0317442d4068cc9f75f325dcedb7922f8bf95e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278330
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-16 16:45:36 +00:00
Cody Cutrer 58eb4175fb RuboCop: Performance/MapCompact
[skip-stages=Flakey]

auto-corrected

Change-Id: I9e768e051924cfe58bf282f85d3cf6ca48735e9d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278264
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-16 16:20:07 +00:00
Cody Cutrer 294d98c6fd RuboCop: Style/MutableConstant
auto-corrected

Change-Id: Ib1b3c85711578a33014ea90f0662bd46f7b2288b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278214
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-16 16:19:54 +00:00
Cody Cutrer 3512a9557e RuboCop: Style/SafeNavigation
[skip-stages=Flakey]

auto-corrected

Change-Id: I0a907a6fa6229f05b4f756faf53a8dd2b18ea0c5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278213
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-16 06:36:38 +00:00
Cody Cutrer fd6b50710c RuboCop: Style/CaseLikeIf
[skip-stages=Flakey]

auto-corrected

Change-Id: I1f6b8a5f58a97a3ef17004ba9bf7a0940632dd55
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278161
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-12 20:24:23 +00:00
Cody Cutrer a690e90aa8 RuboCop: Style/RedundantReturn
[skip-stages=Flakey]

auto-corrected

Change-Id: Ic472ca1cc04423fc966cd4a1ead467604d2904fc
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278130
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-12 16:33:45 +00:00
Cody Cutrer 322f9d8a09 RuboCop: Style/OrAssignment
auto-corrected

Change-Id: I971ad156ed981867644c098969c1ea179735d264
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278030
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2021-11-12 01:12:09 +00:00
Cody Cutrer 299314b162 RuboCop: Style/NegatedIf
auto-corrected

Change-Id: Ieab0b9525c1342f900721196c6694bef17378ec0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278024
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:55:11 +00:00
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
Rob Orton 49369bb585 allow adding a second login with same unique_id
test plan
 - create user login_id in canvas
 - create second login for user with other auth provider
 - it should work

fixes FOO-897
flag=none

Change-Id: I7c34d6211c302e2c8dfdb0f6c1394c748682c235
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/246498
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2020-09-09 20:32:31 +00:00
James Williams e269370644 fix enrollment creation race condition with built-in role fixup
also split up the enrollment migration into multiple jobs

refs #INTEROP-6045

Change-Id: I68eab86d9c56bbadda84548592726baac3610cfa
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/246899
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-08 15:18:07 +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
Rob Orton 238bd5992c pass enrollment_info for better errors
right now it fails cause MRA is not creating proper errors for bulk
insert. This allows the errors to stay consistent and still function
for finding the root_account

test plan
 - run import with invalid root_account_id
 - it should not fail import but should have a valid error
 - it should skip line

fixes VICE-686
flag=none

Change-Id: I5b17507045dfe23666f6dd29f347d61b102bc5e0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244313
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Caleb Guanzon <cguanzon@instructure.com>
2020-08-26 00:03:12 +00:00
Simon Williams c04efb31b5 fix recording sis csv error
closes FOO-855
flag=none

test plan: I'm not sure how to manually cause this to happen

Change-Id: I5a9f04913df5078487d4c425ab0085938be04a3c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/245016
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-08-18 15:39:55 +00:00
Rob Orton 9af1c96d20 remove duplicate where clause
test plan
 - specs should pass

refs VICE-686

Change-Id: I6db0ce5ae35ed0ae3bab1ff0445a0f69d474b50a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244307
Reviewed-by: Drake Harper <drake.harper@instructure.com>
QA-Review: Drake Harper <drake.harper@instructure.com>
Product-Review: Drake Harper <drake.harper@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-08-10 16:14:04 +00:00
Rob Orton 90f6f4b8c1 don't bother updating deleted inaccessible data
test plan
 - send enrollment file that tries to update an enrollment that is tied
   to a deleted login and the enrollment is also already deleted
 - it should not update the enrollment

fixes VICE-685

Change-Id: Id42b03c3f9596fdfe9d7717f78f07fc7bfd16128
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244306
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2020-08-10 16:11:56 +00:00
Rob Orton fab1fb12ca don't process updates on previously deleted users
test plan
 - run sis import with users
 - run sis import marking users as deleted
 - run sis import again
 - fewer queries should happen on the last import

fixes VICE-684

Change-Id: I01369227c6b15a0eef04f26102015bd6720031c5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244320
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2020-08-10 16:11:28 +00:00
Rob Orton f66372aab2 add error for courses import with invalid account
test plan
 - import a course with an invalid account
 - it should have an error for that line
 - the rest of the import should work

fixes VICE-704

Change-Id: I307488aaad26459e508c2d0a3ac63707ee2b3ea3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244305
Reviewed-by: Drake Harper <drake.harper@instructure.com>
QA-Review: Drake Harper <drake.harper@instructure.com>
Product-Review: Drake Harper <drake.harper@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-08-10 16:01:56 +00:00
James Williams 0e96dbad90 stop course touch on enrollment creation
test plan:
* specs

closes #LS-1221

Change-Id: I9ec8d166730681ce648c30c5e8fb0d29d25ae343
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/242819
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2020-07-20 17:22:16 +00:00
August Thornton 8f00d2cdc8 add ability to send notifications for SIS batch enrollment
This change allows us to trigger course enrollment notifications
via the SIS enrollment batch importer. The default will be to not
broadcast the notifications unless the optional param is included
and set to *true*. We only send out one notification as to avoid
spam or duplicates in case of re-upload or a failed import.

closes FOO-652
flag = none

test plan:
 * create a new course and have an existing user to work with
 * ensure the communication channel for that user is verified
 * create an enrollments.csv with the required fields and omit
   the optional field `notify`
 * navigate to `/accounts/self/sis_import`
 * import the .csv from above
 * verify no notification is sent via MailCatcher or
   `/users/:id/messages` for the SIS user
 * add the `notify` header field to the same .csv with a value
   of `true` for the particular user enrollment
 * import the .csv and verify an email *was* sent
 * delete the newly added course enrollment for that user
 * import the same .csv and verify we don't send another enrollment
   notification for that user
 * ensure no documentation errors found for /doc/api/file.sis_csv.html
   with the newly added optional field name _notify_

Change-Id: Ibddb11bce765b3830370bc07219e34e5ec982f5d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/241370
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Ahmad Amireh <ahmad@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2020-07-09 18:41:12 +00:00
Rob Orton 49c2e4c2df remove pronoun feature flag
the feature has been enabled everywhere and it can be removed

test plan
 - specs should pass and pronouns should be the same

flag=account_pronouns
fixes KNO-523

Change-Id: Ic9d17826bace508080ab65d180a08bf3b4d8bca0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/239205
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-06-04 01:23:45 +00:00
Rob Orton bb183c23f6 allow publishing claimed courses via sis
test plan
 - really, specs should pass
 - but manually, create a course in the ui
 - give it a sis id
 - run sis import to publish course
 - it should be published

fixes SOS-1495

Change-Id: I79e04812471dd121017316c95d17c051903425b2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/237745
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Drake Harper <drake.harper@instructure.com>
Reviewed-by: Eka Tjung <etjung@instructure.com>
QA-Review: Drake Harper <drake.harper@instructure.com>
Product-Review: Drake Harper <drake.harper@instructure.com>
2020-05-31 06:06:44 +00:00
Drake Harper 6c97039fd6 Add pronouns to sis import
Test plan:
-have pronouns enabled
-should respect sticky settings
-use a default pronoun
-add a custom pronoun
-use custom pronoun

Fixes KNO-398

flag=account_pronouns

Change-Id: Iae1d30ba7139a78847d2b9c9cc5abf7eca508dac
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236359
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-05-08 15:46:50 +00:00
Rob Orton 1d6bbda2ca allow publishing courses via sis import
test plan
 - course imports should work
 - should allow setting a course to published

closes SOS-1437

Change-Id: I221c75be775b1f1276bd4b8cda163298f1f0fc06
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/234913
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Eka Tjung <etjung@instructure.com>
Reviewed-by: Kevin Qiu <kqiu@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2020-04-24 04:09:25 +00:00
Rob Orton 6482e14dae add unique constrain retry to course importer
test plan
 - course import should work
 - specs should pass

flag=none
qa risk: low
fixes SOS-1386

Change-Id: Icec5068bb005b773520f2c16cf36e37177ac6f93
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/231537
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
QA-Review: Ahmad Amireh <ahmad@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2020-03-26 20:57:39 +00:00
Eka Tjung 5f19a5c654 Remove unneeded log output lines
fixes SOS-1354

Change-Id: Ib2a4c1b1dc74e952a1f9c1e7860d64113f53eb05
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/226039
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Eka Tjung <etjung@instructure.com>
Product-Review: Eka Tjung <etjung@instructure.com>
2020-02-13 17:10:04 +00:00
Simon Williams 4693861183 remove action_controller_test_process shim
it was used for two things:
- file_fixture_upload, which now comes from
  ActionDispatch::TestProcess::FixtureFile
- Rack::Test::UploadedFile which comes from the rack-test gem

Change-Id: I27957b410fcf4677dac77aed1b00b04dfd1b012e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/222555
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-01-10 18:54:48 +00:00
Rob Orton 6e82029a16 add disabled to grade_passback_setting
closes CORE-3356
flag: none

test plan
 - specs should pass

Change-Id: If1cc3258aceb5036a70c5426299838dca9729e99
Reviewed-on: https://gerrit.instructure.com/210870
Tested-by: Jenkins
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2019-09-25 13:55:20 +00:00
James Williams 71c4296401 don't infer sortable name in sis csv if explicitly provided
closes #CORE-3296

Change-Id: I3845e5f2fcd9680cda33b000e603c01a21b2d252
Reviewed-on: https://gerrit.instructure.com/209824
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2019-09-23 13:06:56 +00:00
Rob Orton 1fac78417e keep api errors consistent
fixes CORE-3257

test plan
 - specs should pass

Change-Id: I56a1e7b02b84a063b9816556d163bb3e247f8d73
Reviewed-on: https://gerrit.instructure.com/206616
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2019-08-26 19:25:44 +00:00