Commit Graph

145 Commits

Author SHA1 Message Date
Cody Cutrer 502aa068da rubocop: Layout/Multiline*LineBreaks
[skip-stages=Flakey]

Change-Id: I24912809267088bc19a4082c49bc5f78ca7b76bb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/317302
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Build-Review: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-05-01 19:31:42 +00:00
Cody Cutrer b2b0bff902 rubocop: Style/TernaryParentheses, Style/RedundantParentheses
[skip-stages=Flakey]

Change-Id: I8d860eedd8b199ed3adf0e2bf9162b43096c5347
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/315130
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Build-Review: Cody Cutrer <cody@instructure.com>
2023-04-12 14:56:48 +00:00
Jacob Burroughs b8940e7594 Fix some more bulk updates
refs AE-158

Change-Id: I3d1e4c35d85ccf978de0b09d5700575e255e979a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/315450
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
2023-04-11 15:07:24 +00:00
Jeremy Stanley dad3f86eef update sis_batch_id on unchanged students' linked observers
test plan:
 1. have a student linked to an observer via UserObservationLink
 2. enroll the student in a course via a batch mode SIS import
    that imports the student alone
    - ensure the observer is enrolled as expected
 3. run another sis import that explicitly creates the
    observer enrollment and the student enrollment
 4. re-run the import CSV from step 2
    - ensure the observer's enrollment is still active

flag=none
fixes FOO-3424
fixes gh-2172

Change-Id: I47db58382a94805d48c6beb9ea5ab2ba4b6c3fcc
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/314467
Reviewed-by: Mysti Lilla <mysti@instructure.com>
Reviewed-by: Jason Perry <jason.perry@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2023-03-29 15:54:47 +00:00
AJ Esa be376216db Enrollment completed time set to when enrollment is completed
When an enrollment is made active, then completed, made active again
and at least one minute later completed one more time (all via SIS
imports), the completed at time will show the original completed
time instead of the second completed at time. This commit makes it
so that the completed at time is always set to the time when the SIS
import is done.

fixes FOO-3316
flag=none

test plan:
 - Make sure delayed jobs are running
 - Import an enrollment via SIS import and make account status active
 - Update CSV to change student status to
   deleted_last_completed
 - Take note of completed date and time on student membership page
 - Wait at least a minute
 - Run SIS import CSV, setting the student status to active
 - Run SIS import CSV, setting student status back to
   deleted_last_completed
 - Time noted from earlier should differ from new completed time on
   student membership page

Change-Id: I46d26dad7ff479798710866b9cc8d682ede8217e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/309778
QA-Review: Ajmal Esa <ajmal.esa@instructure.com>
Product-Review: Ajmal Esa <ajmal.esa@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: August Thornton <august@instructure.com>
2023-02-06 16:49:21 +00:00
Isaac Moore d6584b490a Remove unnecessary require statements
closes AE-30

flag=none

test plan:
- verify Canvas boots in CD
- verify no influx of new errors in CD

[fsc-timeout=30]

Change-Id: Ifa04bebe1b09f01c6d3b8b2d8f3bb424759730f5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/308067
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Isaac Moore <isaac.moore@instructure.com>
Product-Review: Isaac Moore <isaac.moore@instructure.com>
Build-Review: James Butters <jbutters@instructure.com>
2023-01-04 21:38:21 +00:00
Spencer Olson deb4370dca limit simultaneous sis import due date recache job runs
closes EVAL-2376
flag=none

As part of this change, the number of simultaneously running enrollment
importer due date recache jobs per shard is capped at 10. In
order to change this, run:

```
Setting.set(
  "DueDateCacher#recompute_for_sis_import_num_strands",
  "20"
)
```

Test Plan:
1. create an assignment
2. Verify in a rails console that submissions were created by
   DueDateCacher for the assignment:

   Submission.where(assignment_id: <id>).count
   => should be greater than 0

3. Run a SIS import that adds a new enrollment to a course (for a user
   that has not yet been added to the course), and verify submissions
   are created for any assignment that is assigned to the newly-added
   enrollment:

   Submission.where(
    course_id: <id>,
    user_id: <enrollment's user_id>
   ).count
   => should be greater than 0

Change-Id: I5f28b5bfdc7f419bc2fc450aa4cc23fe2c28a51f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/288944
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Shafovaloff <ashafovaloff@instructure.com>
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
2022-05-03 13:45:51 +00:00
Jackson Howe fe9c4d7eb1 Don't (sis) import observers into blueprint courses
fixes LS-3073
flag = none

Test plan:
 - Create users.csv, courses.csv, and enrollments.csv files to create
   a user, course, and enroll the user into the course as an observer
   (or get them from me)
 - Zip the files and upload them at accounts/id/sis_import
 - Expect to get this warning - "Observer enrollment for abc not
   allowed in blueprint course def"
 - Visit the new course's users page and expect the user to not have
   been enrolled

Change-Id: I51bfefcac73219df21ff0c12a23e3e0a717d451f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/288739
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Jackson Howe <jackson.howe@instructure.com>
2022-04-04 15:48:33 +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 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 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 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 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 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 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 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 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
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
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 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
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
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
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
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
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
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
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
Rob Orton e04ac1408a ensure batch is updated on enrollment delete
fixes CORE-2924

test plan
 - delete enrollments via sis import
 - it should update sis_batch_id

Change-Id: I42c1c881072123317b47c2f1411930f828e38653
Reviewed-on: https://gerrit.instructure.com/193028
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
Tested-by: Jenkins
2019-05-10 20:16:09 +00:00
James Williams e39f71fc95 increase redis read reliability for user-based cache keys
use the redis-based cache keys inside several calls that
rely only on a user's enrollments, group memberships, or
account_users

test plan:
* have redis configured as the cache store
* updating a user's enrollments, group memberhips,
 or account admin associations should not result in
 stale data being shown

refs #CORE-2851

Change-Id: I773a20eba40ff02a6aa37e35ffe345ba3554c4fd
Reviewed-on: https://gerrit.instructure.com/192271
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2019-05-10 15:14:58 +00:00
Rob Orton 499e4f808f add deleted_last_completed to enrollment importer
test plan
 - it should complete the last enrollment
 - it should delete other enrollments

Change-Id: I7f09c2a2a52798ff9118a8765aa3ae76dc041e80
Reviewed-on: https://gerrit.instructure.com/181692
Tested-by: Jenkins
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2019-02-15 23:05:15 +00:00
Rob Orton 3805e3bc78 leave enrollments when a pseudonym is deleted
closes gh-1402

test plan
 - Create a user with two logins
 - have an enrollment tied to the sis id of one
 - delete that pseudonym
 - run a sis import enrollments referencing the
   deleted sis id
 - the enrollment should still be active

Change-Id: I350a998f53aae00662f2a133c17dd9596793ed6a
Reviewed-on: https://gerrit.instructure.com/178116
Tested-by: Jenkins
Reviewed-by: James Williams <jamesw@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
2019-01-17 15:27:57 +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
James Williams d29ee7e600 include re-deleted enrollments in sis import counts
closes #CORE-1954

Change-Id: I1546a446230a8e4ab4b4502a4a6ab7d5b778aef6
Reviewed-on: https://gerrit.instructure.com/166568
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2018-10-05 12:21:54 +00:00
James Williams 5db25be704 include enrollments deleted by sis in batch counts
test plan:
* delete an enrollment via sis csv
* the batch should include the deleted enrollment
 in the enrollments count

closes #CORE-1761

Change-Id: If98cdee6920b782878f4f4e3777036f0e93d5719
Reviewed-on: https://gerrit.instructure.com/161834
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
2018-08-23 18:57:07 +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
Rob Orton 528399f09c only recache_grade_distribution if defined
fixes gh-1325

test plan
 - checkout canvas-lms and this commit with
   no plugins
 - run an enrollment sis import
 - it should pass

Change-Id: I9b93da6dec381ba19d103c468a712ec18db6b43e
Reviewed-on: https://gerrit.instructure.com/158443
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-07-24 13:44:47 +00:00
Rob Orton 7c9f41312c restore states for sis_imports
fixes CORE-1397
fixes CORE-1398

test plan
 - run sis import that changes workflow_states of objects
 - restore the sis import
 - the states should be restored
 - rake doc:api should work

Change-Id: I4fb401699d53d4d8309c986ae27eefea99e93d53
Reviewed-on: https://gerrit.instructure.com/150113
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:38:09 +00:00
Rob Orton 4b1b66359a don’t use long transaction to add enrollments
Change-Id: I2b794751b3a20ef54ff2f9aa991c8050b8f61ff5
Reviewed-on: https://gerrit.instructure.com/150550
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
QA-Review: Rohan Cheeniyil <rcheeniyil@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2018-05-29 21:28:57 +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 3aa5acc6ca create roll back data for enrollment importer
closes CORE-1392

test plan
 - import enrollments
 - workflow_state changes should be logged

Change-Id: I26e2711713307f98da4a5cf0230bdac3e1cf0b90
Reviewed-on: https://gerrit.instructure.com/150099
Reviewed-by: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins
QA-Review: Rohan Cheeniyil <rcheeniyil@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2018-05-29 21:28:03 +00:00