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>
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>
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>
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>
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>
[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>
[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>
[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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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
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>
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>
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>
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>
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>
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
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>
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>
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>
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>