Commit Graph

135 Commits

Author SHA1 Message Date
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 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 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
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 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
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
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
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
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
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
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
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 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 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
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
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
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
James Williams 32615c5823 add updated_at to enrollment_states
Change-Id: I5d66e52d993dc2d9692dbe1690a2060a3336220d
Reviewed-on: https://gerrit.instructure.com/202960
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-08-20 17:06:58 +00:00
Rob Orton ac733ee807 allow for creating logins through sis importer
fixes PFS-13047

test plan
 - check documentation for login importer
 - import a login
 - it should work
 - user importer should work

Change-Id: I0e72aa75d1abd26b7b00a1d416401bc1cbc8732a
Reviewed-on: https://gerrit.instructure.com/198678
Tested-by: Jenkins
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2019-07-02 23:22:09 +00:00
Rob Orton 282f6ed170 allow for creating pseudonyms on consortium users
refs CORE-3093

test plan
 - specs should pass

Change-Id: I1eb0345f9672e8eae842bfd0a3cf612d7b8552b7
Reviewed-on: https://gerrit.instructure.com/187495
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-06-22 17:05:10 +00:00
James Williams 62d567efb1 delete linked observer enrollments after deleting student via sis
test plan:
* use a sis csv import to create
 a course,
 a student and an observer user,
 a user_observer link between the two users,
 and an enrollment for the student
* make sure the observer was automatically enrolled
 in the course along with the student
* use another sis csv to delete the student user
* the observer enrollment should be deleted

closes #ADMIN-2469

Change-Id: I54b237c8a727464f58505f7de380eea38a522a29
Reviewed-on: https://gerrit.instructure.com/184298
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-03-08 21:27:32 +00:00
James Williams 971f5f9a95 don't search for more than 100 merge candidates
closes #CORE-2249

Change-Id: I4f857b84dcf0fccb43661c0d908b7786c871b88e
Reviewed-on: https://gerrit.instructure.com/175251
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2018-12-13 17:00:11 +00:00
Rob Orton e148f7cf0d add row_info to the sis import api response
Change-Id: Ieb64f4f2cd5880bba1e815b6d4e2c28a45606e45
Reviewed-on: https://gerrit.instructure.com/171073
Tested-by: Jenkins
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2018-11-07 15:41:36 +00:00
Rob Orton acdcbf3250 remove the old sis importer
Change-Id: Ifef519776e4358204dd6625acd6cd9f841cd7fcb
Reviewed-on: https://gerrit.instructure.com/152331
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2018-08-17 15:30:27 +00:00
James Williams 287321a80c don't run giant transaction around user_importer
refs #CORE-1467

Change-Id: I57d2f3315e7c908bfb7f5944b650e4153a965908
Reviewed-on: https://gerrit.instructure.com/151863
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2018-06-04 19:47:08 +00:00
Rob Orton 6abcee9d7a users are not deleted or tracked
Change-Id: I50c3f37199545e747233f73e014752fecd850e07
Reviewed-on: https://gerrit.instructure.com/151809
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2018-05-29 23:46:58 +00:00
Rob Orton f3e4827e15 batch is required for sis imports
Change-Id: Ia1ff87b2b610c8e54e3ddd88e72242d92786ffb7
Reviewed-on: https://gerrit.instructure.com/150548
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Rohan Cheeniyil <rcheeniyil@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2018-05-29 21:28:50 +00:00
Rob Orton 91a4234bd3 create roll back data for users
closes CORE-1395

test plan
 - import users
 - workflow_state changes should be logged

Change-Id: I1466d6ec9f0ac3d38f74fd1b7a68dd0fa1c77a2f
Reviewed-on: https://gerrit.instructure.com/150103
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Rohan Cheeniyil <rcheeniyil@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2018-05-29 21:28:29 +00:00
Rob Orton a3b55cdb11 add ability to skip deletes in sis imports
closes CORE-1185

test plan
 - pass skip_deletes as true to sis imports
 - it should not delete any records
 - rake doc:api should work

Change-Id: I91bfa260bfd48d349aeb16703143cf4345fae0bb
Reviewed-on: https://gerrit.instructure.com/144438
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2018-03-29 15:07:35 +00:00
Rob Orton d8cb87252f add row number to sis_batch_errors
fixes CORE-870

test plan
 - enable sis refactor feature
 - import a file with errors
 - the errors should have a row number

Change-Id: I8d890aa94a5621cbbfbf959f4f038bd189645e55
Reviewed-on: https://gerrit.instructure.com/143872
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2018-03-21 19:19:37 +00:00
Rob Orton d4eeccea21 remove to_lower_column
this was needed when we supported mysql

test plan
 - specs should pass

Change-Id: I2d7a29920a32f92a228537bfa2dbe50d742c9353
Reviewed-on: https://gerrit.instructure.com/144162
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
2018-03-21 18:58:32 +00:00
Rob Orton af0ae43107 don’t send every sis import error to sentry
fixes CORE-1121

test plan
 - import a user with a really long login_id
 - the error should be on the sis import
 - sentry should not get an error

Change-Id: Ie38b8f3e1faa80308f63904c34e67690aac5f66e
Reviewed-on: https://gerrit.instructure.com/143205
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2018-03-12 21:06:42 +00:00
James Williams c496ed62e9 use parallel importers to do stuff in smaller jobs
and overall maybe suck a little less

test plan:
* enable the feature "SIS Import Refactor"
* lower the threshold to use multiple parallel jobs
 via "/plugins/sis_import" to a number like 2
* regression tests for sis batch imports

closes #CORE-927 #CORE-928

Change-Id: I91b0bb0cc0e0957cae7897af453ed2d19555303d
Reviewed-on: https://gerrit.instructure.com/140535
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2018-03-01 20:05:33 +00:00
Rob Orton d5bb5cb12e update bounce count when email changes
fixes CORE-1031

test plan
 - have invalid email with bounce count
 - update email through sis and it should have a
   bounce count of 0

Change-Id: If756f77cca6120bb140d393f6b5da4a9c9a5257b
Reviewed-on: https://gerrit.instructure.com/141579
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2018-02-21 23:47:46 +00:00
James Williams 6313d034de don't overwrite sortable_name with full_name in sis import
test plan:
* import a user csv with full_name and sortable_name specified
* the user's sortable_name should be brought in from
 the sortable_name column

closes #CORE-1006

Change-Id: Iad06a8a269c69bbf8c6df8ea91a2a1faafa5c0f6
Reviewed-on: https://gerrit.instructure.com/140776
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2018-02-13 19:58:50 +00:00
James Williams 89f6302482 add parent_account_id as a sticky sis field
test plan:
* mark "process as UI changes"
 when creating a subaccount through accounts.csv
 (this should add parent_account_id as a stuck field)
* the parent_account_id should not be able to be
 changed by subsequent sis imports,
 unless "process as UI changes" is marked

closes #CORE-660

Change-Id: I08f8198b9ef9a1abdac3f7c4e5165bdad62fdac0
Reviewed-on: https://gerrit.instructure.com/135512
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2018-01-19 13:20:20 +00:00
Jeremy Stanley 1d6f61d4d1 SIS import: ensure imported users have a name
also, don't remove an existing name if the import doesn't
specify one

test plan:
 - if a SIS import creates a new user and all of the
   following columns are missing or blank, the login_id
   should be used as the name.
   * full_name
   * first_name
   * last_name
   * sortable_name
   * short_name
 - if a SIS import updates an existing user and does not
   specify any of the above columns, the user's name
   should remain unchanged (not blanked out!)

fixes ADMIN-579

Change-Id: Id6297bdac3cf13c7561c713b3cd983af3d1ed3c3
Reviewed-on: https://gerrit.instructure.com/136307
Reviewed-by: Jon Willesen <jonw+gerrit@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Tested-by: Jenkins
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2017-12-28 23:51:26 +00:00
James Williams 391dbd4f79 don't try to set blank integration ids in user sis importer
closes #CNVS-40449

Change-Id: I16c172b6af70f0428e098b6b72bddbf83641c737
Reviewed-on: https://gerrit.instructure.com/133966
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-11-28 20:16:57 +00:00
Rob Orton d5c141ee0c don't delete enrollments if an active login remains
fixes CNVS-39623

test plan
 - have a user with two logins and enrollments
 - remove one through sis import
 - the enrollments should not be deleted

Change-Id: Idb95db90ba0eedfcb19b27208c0af639bf13f75f
Reviewed-on: https://gerrit.instructure.com/127946
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2017-10-03 23:35:04 +00:00
Rob Orton 112b05635d don’t reset integration_ids on import
fixes CNVS-39168

test plan
 - run import without integration_id
 - it should not reset it

Change-Id: I7d48a2111a461635eb71d142bdc39f03fa2bdd6b
Reviewed-on: https://gerrit.instructure.com/125460
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2017-09-12 00:05:39 +00:00
Rob Orton c53c65f55c don’t delete admin running a sis import
fixes CNVS-38863

test plan
 - run sis import that would delete an admin that
   is running the sis import
 - it should not delete the admin
 - attempt to delete the user
 - it should not delete the user

Change-Id: Ie5fb341b21017fea7cbf24b09a14a93ac781a1ab
Reviewed-on: https://gerrit.instructure.com/124103
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2017-08-26 14:38:35 +00:00