Commit Graph

6347 Commits

Author SHA1 Message Date
Ethan Vizitei d8aa101fab auditors migration handle missing courses
refs CNVS-48876
flag = none

TEST PLAN:
  1) run auditors repairing
  2) no course job errors out with failed FK check

Change-Id: I7bf569c810e48939fca4a54d7a93860d4129b183
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/240939
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2020-06-23 17:43:59 +00:00
Mysti Lilla b8dc8380d3 Create submission subscriptions on plagiarism tools
closes PLAT-5765
flag=none

Test plan
- When you create a plagiarism tool
  (tool that has the similarity detection
  placement) it should create and save
  a live events subscription id on the
  tool
- The subscription should have an associated
  integration id created with it

Change-Id: Ia6d29c61f25fddaea46478469bdd668e7aa39509
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/239210
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2020-06-22 23:03:30 +00:00
Ethan Vizitei f93a737510 don't schedule off-shard accounts
Change-Id: Icf6a4301c6bcda7accf30c60696e93af77eb2a24
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/240828
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-06-22 17:48:43 +00:00
Cody Cutrer 2ffd2cecca better region selection logic for migrations
allow a list of regions, as well as negating the option

Change-Id: Ic306c1999854f94bdfd8a9257735eb16525ed6f3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/240535
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2020-06-22 16:11:25 +00:00
Ethan Vizitei b54209319b auditors migration handle missing users
refs CNVS-48876
flag = none

TEST PLAN:
  1) run auditors repairing
  2) no job errors out with failed FK check

Change-Id: I6ca783a0966325bee82d91e0b5bf1190f017fa40
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/240805
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2020-06-21 14:57:27 +00:00
Matthew Lemon ec8040c720 update root_account_ids on conversations tables
fixes VICE-341
flag=none

/ ---- ---- \
| Test Plan |
\ ---- ---- /

- Create a conversation
- Grab that conversation and add another root account id to it
  - c = Conversation.last
  - c.root_account_ids = [1,2] # assumes normal account and site admin
  - c.save!
- Check that the conversation participants root_account_ids now includes
  the added root_account_id
  - c.conversation_participants.first.root_account_ids
- Check that the conversation messages root_account_ids now includes the
  added root_account_id
  - c.conversation_messages.first.root_account_ids
- Check that the conversation message participants root_account_ids now
  includes the added root_account_id
  - c.conversation_message_participants.first.root_account_ids

Change-Id: I949bd25001d18303d6e79bd07dc7d3494166b84c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/240730
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-06-19 23:39:34 +00:00
Mysti Lilla d5ddea29b1 Add associated_integration_id to plagiarism live events
closes PLAT-5766
flag=none

Test plan
- Planning to test this on beta once it's there
  as that will be easier than trying to test it
  locally
- We'll want to install a fresh Plagiarism tool
  at an account
- Verify that the plagiarism subscription IS receiving
  events for assignments that are linked to the tool
- Verify that the plagiarism subscription IS NOT receiving
  events for assignments that are not linked to the
  tool
- Verify that regular subscriptions are still receiving
  events for both linked and non-linked assignments

Change-Id: I59a1f5f6d1c061dfcd50c1efa2788173875d2231
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/240369
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Michael Guymon <mguymon@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2020-06-19 20:27:27 +00:00
James Williams 56effa3991 implement conditional release assignment releasing on grading
test plan:
* enable the native conditional editor (see plan for g/239985)
* set up a course some assignments assigned to "Mastery Paths"
 so they're only visible to students with overrides
* use the editor to create a trigger assignment that can
 release the hidden assignments
* as a student, submit to the trigger assignment
* as a teacher, grade the trigger assignment with a
score that will release a hidden assignment
* as the student, confirm that the newly released assignment
 is visible

closes #LS-1062

Change-Id: Id17a06807c8c668ec95c86acc6f95846c5394efc
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/240338
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2020-06-19 16:46:52 +00:00
Rob Orton e4042959c3 stop creating policies for secondary emails
test plan
 - send a message
 - message should send
 - specs should pass
 - should not send duplicate messages

flag=none
fixes VICE-506
fixes VICE-538

Change-Id: Ief7f09db4fdfc78864be9a537902e6863b1e0858
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/240227
Reviewed-by: Matthew Lemon <mlemon@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Matthew Lemon <mlemon@instructure.com>
Product-Review: Matthew Lemon <mlemon@instructure.com>
2020-06-18 21:25:20 +00:00
Spencer Olson 5a455d414a set root_account_id on scores
closes TALLY-704
flag=none

Test Plan:

1. Create a brand-new course and add some students.
2. Verify that all scores associated with the course have a
   root_account_id set:

   c = Course.find(<id>)
   scores = Score.where(enrollment: c.all_enrollments)
   scores.pluck(:root_account_id) # should all be set (not null)

Change-Id: I549d82c40a2057cc1fdcff604b5e5e7a9285f0ac
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/239417
Reviewed-by: Gary Mei <gmei@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Syed Hussain <shussain@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
2020-06-18 16:38:40 +00:00
Clint Furse ed4127c72e basic launch and response from MasteryConnect
closes LA-728
flag = submission_type_tool_placement

Test Plan:
- find a LTI 1 tool that can be configured to do
  submission_type_selection placements.  The
  tool will also need to be able to send a
  ContentItemResponse back to Canvas.  I used
  a tool called lti_tool_provider_example (github)
  and modified it.  The response should include
  the following data for MasteryConnect:
  "https://canvas.instructure.com/lti/mastery_connect_assessment": {
          "points": 10,
          "objectives": "6.R.P.A.1, 6.R.P.A.2",
          "trackerName": "My Tracker Name",
          "trackerAlignment": "6th grade Math",
          "studentCount": 15
        }
- Install the tool under an account or course
- Create an assignment using the submission type
  that matches the tool (not 'External Tool')
- interact with the tool to send a response item
  back to Canvas
- The new data should be displayed below the button
- Save the assignment and verify that the data is
  persisited to the DB as JSON (content_external_tag.external_data)
- also verify data is still correclty displayed when
  editing an assignment

Change-Id: I5b1457e5dcfb8988ec75fbe3dfa1a3ca88bf0a77
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/240130
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Clint Furse <cfurse@instructure.com>
2020-06-17 15:21:23 +00:00
Simon Williams 3a045c6e3b squash old migrations, p34 (through 2016)
Change-Id: I1786323eb8aee2996f2762719dfe7d6204cb92fa
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/238238
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2020-06-17 15:16:34 +00:00
Ahmad Amireh e590f4e04f identify asmt students who need to be alerted
fixes KNO-444
flag  = smart_alerts

this patch implements a simplified version of what was discussed in the
RFC[1] where we use the 2 following conditions to decide whether a
student should be alerted:

1. they didn't make a submission AND
2. they didn't interact with the assignment in the last 3 days

.
. TEST PLAN
. .... ....

you'll need the console for this since there's no UI yet:

- edit assignment_util.rb:77 and insert a log statement there like:

    puts "alerting student #{student.id} for assignment #{assignment.id}"

- create an assignment and assign it to some students
- run AssignmentUtil.process_due_date_reminder('Assignment', id) and
  verify it logs for the students you expect
- (optional) enable page views[2] and visit the assignment page as a
  student, now upon running the function again verify it excludes that
  student (since they've "seen the assignment recently")

for overrides:

- create a group and add 1-2 students to it
- create an assignment exclusively for that group
- run #process_due_date_reminder with the AssignmentOverride object this
  time and verify it logs only the students for that group

[1]: https://docs.google.com/document/u/1/d/1fEO54slgHENTFS-vPfPqhGgr7ysS976u1koDjr9jdX4
[2]: run "Setting.set('enable_page_views', 'db')" in console

Change-Id: Ie2cd6b5ff47baf03faf2da9576c5f9204311a5d5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/239465
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ben Nelson <bnelson@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Caleb Guanzon <cguanzon@instructure.com>
2020-06-17 06:36:51 +00:00
Ethan Vizitei 1f92d007ea auditors migration handling clean miss
refs CNVS-48876
flag = none

checking user keys
interpolates S-Q-L
which needs a guard clause

TEST PLAN:
  1) run auditors repairing
  2) no job errors out with invalid SQL

Change-Id: Ide30c4078d88162507c6a6c8a9aa8df00007ecb7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/240355
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2020-06-16 20:45:06 +00:00
Derek Bender 2e09795910 Spec: Throw icu config errors in test
The issue with not throwing in our test env is that we
fall back to a naive collater and thus effectively ignore
any system configuration errors. Instead, we should
always throw in test if icu is misconfigured.

Change-Id: I5818a4d7fa9c1891d770e664fa3032d03e63d54b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/240186
Reviewed-by: Ryan Norton <rnorton@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Derek Bender <djbender@instructure.com>
Product-Review: Derek Bender <djbender@instructure.com>
2020-06-16 16:01:34 +00:00
James Williams 7b44b5f4ce port conditional release rules editor UI
test plan:
* enable native conditional release on the
 root account via the console by running:

Account.default.tap do |a|
  a.settings[:use_native_conditional_release] = true
  a.save!
end

* enable the "Mastery Paths" feature on the account
 or course if not already
* the "Mastery Paths" editor tab should be shown
 when editing an assignment
* the editor should load independent of the
 conditional release service
* it should allow selecting assignments and
 modifying scoring ranges
* it should save via the native rules API when
 the assignment is saved
* when the assignment is opened again for editing,
 it should pull the rules back from the native API
 and should appear as previously saved

closes #LA-1063

Change-Id: Iea3b2f8346b8989542010f9d571bf1eee5e03622
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/239985
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2020-06-16 14:57:51 +00:00
Adrian Packel aa88124a0b Set root_account_id for assignment score stats
closes TALLY-705
flag=none

Test plan:
- Create a course with some students and some assignments
- Assign some grades
- Check that the ScoreStatistic models for the affected assignments have
  their root account ID set to the course's root account ID

Change-Id: I12787d38f5016856f616084daef3086fe4ad8b26
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/239968
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
QA-Review: Syed Hussain <shussain@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
2020-06-12 17:04:05 +00:00
Evan Battaglia ae518dc85f Delete assignments when deleting line items in API
1. Adds "coupled" column which is set only when the line item is the
   default line item created when the user creates an external tool
   Assignment in the UI
2. Allows the API to delete all line items it created
3. Allows the API to delete assignments it created via the line items
   API (that is, deletes the associated assignment if a line item is the
   main line item and was created in the UI)

closes PLAT-5772
flag=none

Test plan:
- before checking out this commit:
- install the LTI 1.3 test tool
- create an Assignment in the UI, choosing external tool as the
  submission type and the test tool as the tool
- create an adition external tool Assignment in the UI
- Go to http://web.lti-13-test-tool.docker/ags/new and create a new line
  item with external_tool as the submission type
- Create a new line item with no submission type
- Create a new line item that is attached to one of the manually-created
  assignments. To do this you must give the `assignment.lti_context_id`
  as resource link ID when creating the second line item
- check out the commit and run migrations
- open a rails console and check that the default line item for the
  manually-created assignments have coupled=true. The other three line
  items should have coupled=false
- create all the line items created above again. Again, only the
  manually-created ones should have coupled=true.
- delete the last line item created (the extra one attached to the
  manually-created assignment) with the test tool. the line item should
  be deleted but the assignment/resource link/first line item should not
  be.
- try deleting (with the test tool) the rest (four) of the last batch
  line items. The ones with coupled=true should get a 401 response.
  The other two should be deleted and their assignments and resource
  links should be deleted.

Change-Id: I992c10f0c36aa5ed84f0e58e1e6c549b14a9d0ee
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/238693
Product-Review: Karl Lloyd <karl@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
2020-06-11 19:23:23 +00:00
Jacob Burroughs d3c962a550 Support recaptcha by default for new user registration
flag=default_recaptcha_registration_enable

fixes USERS-587

test plan:
- Configure recaptcha in dynamic_settings.yml
   development: private: canvas: recaptcha_{client|server}_key
   DM me for a key pair or create your own v2 recaptcha config
- Enable open registration for the canvas authentication provider
- Attempt to create a teacher account, you should not be prompted for a captcha and it should work
- Enable the default_recaptcha_registration_enable siteadmin feature flag
- Attempt to create a teacher account without completing the captcha-it should fail
- Attempt to create a teacher account with the captcha-it should work
- Attempt to create student, observer accounts with the captcha-it should work
- As a siteadmin, deselect the "Require Captcha for Self Registration" option on the canvas authentication provider
- Attempt to create a teacher account-there should be no captcha, and it should work
- As an account (but not site) admin, verify you cannot see "Require Captcha for Self Registration"

Change-Id: I3db1f15006473c5c84ed3a8de4a688100744f281
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/239022
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Ahmad Amireh <ahmad@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2020-06-11 15:01:01 +00:00
August Thornton 3f6686e042 include admin_context on calls to address book user counts
fixes USERS-539
flag = none

test plan:
 - As an admin not enrolled in the course
   - Navigate to the People page
   - Have two different course sections with enrollments
   - Click the hamburger menu for a user and select
     the 'edit sections' option
   - Search for the section for which the user is not enrolled
   - Verify it returns the proper Section enrollment count
     that is non zero

Change-Id: Ib4e910878651fb80a450258237e43c56138dd528
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/239597
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: August Thornton <august@instructure.com>
2020-06-10 16:49:07 +00:00
Adrian Packel bf1be2fe0d Add root_account_id to submissions
closes PLAT-5552
closes TALLY-706
flag=none

Test plan:

Migration:
- Verify migrations run
- Verify a root_account_id can be set on a
  Submission record
- Verify Submissions always live on the same shard
  as their root account

DueDateCacher:
- Do something that triggers a DueDateCacher run (e.g., add some
  students to a course)
- The root_account_id of the resulting submission objects should match
  the owning course's root account ID

Change-Id: Ib4cd4396b736c4e5329c67caeb92cb9b74ddb1ca
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/239395
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Adrian Packel <apackel@instructure.com>
Product-Review: Oxana Jurosevic
2020-06-09 18:15:54 +00:00
Ethan Vizitei 4722a75a17 check user FK on same shard
refs CNVS-48876
flag = none

TEST PLAN:
 1) run backfill
 2) FK failures should not happen for
    user records anymore.

Change-Id: I7b2562cec854537111f7e30ebf7535fc5818e556
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/239548
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-06-09 15:56:16 +00:00
Cody Cutrer d85aa95894 make it easy for add_column_and_fk helper to be idempotent
Change-Id: I4d5c8d85a7cd0a7aa2c84f3278bfcecef0425398
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/239559
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-06-09 15:35:51 +00:00
Evan Battaglia 433889ceda Add fields to course_completed/progress live event
flag=none
refs PLAT-5791

Test plan:
- make sure you have a course with a sis_source_id
- tail live events kinesis stream (See doc/live_events.md)
- trigger a course_completed or course_progress event
- check it has the account ID and sis_source_id

Change-Id: Ic4e529ee7b3eeddce68e028fcb81c5bdbbafb96a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/239269
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Oxana Jurosevic
2020-06-08 22:21:51 +00:00
Clint Furse f432c1743d submission type button now launches LTI tool
closes LA-726
flag = submission_type_tool_placement

Test Plan:
- Install a tool that has a placement: submission_type_selection
   (this may be a manual process until the external tool's config
   is actually modified). This can be done in
   ContextExternalTool.settings
- make sure Submission Type Placement Feature flag is enabled
- On an assignment, for submission type, select the tool you
  configured
- click the "Link Assessments" button and make sure tool launches

Change-Id: I2b353e8747085024b5770c473607995f426c3954
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/239271
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: Clint Furse <cfurse@instructure.com>
2020-06-08 20:18:18 +00:00
Caleb Guanzon 4560b41a9b move course notification overrides feature flag to SiteAdmin
fixes KNO-526

test plan:
- feature only works when flag is turned on
  in the site admin level

Change-Id: I8e4f7669606498d61c327d3a352c4533c0c08179
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/239378
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-06-08 16:19:04 +00:00
Simon Williams ffd987116a squash old migrations, p31
Change-Id: I55fcceb76bae8f3d13d5b34c1cfc77b8e57a192e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236783
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2020-06-07 00:45:02 +00:00
Simon Williams 9535bee361 squash old migrations, p30
Change-Id: Ic70fd33a97c388cf4e1a1dfd6ad26c023f5f3040
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236782
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2020-06-06 03:44:59 +00:00
Simon Williams a72e6cd4fd squash old migrations, p29
Change-Id: I14eb45f796dfdf102f37b1aeb9ad664ab593465b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236781
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2020-06-06 02:55:12 +00:00
Mysti Lilla 57ed77011a Migration for root account id backfill
closes PLAT-5837,PLAT-5838,PLAT-5839
flags=none

- On running this, it should fill root_account_id
  for any tables currently in the migration_tables
  method in the referenced data fixup

Test plan
- Running this migration should cause any
  developer keys and developer key account bindings
  to have their root account ids populated as well
  as Context Modules

Change-Id: I1020f67475465b63f88a83353f5cb93ffe8d6b51
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236779
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2020-06-06 02:17:03 +00:00
Mysti Lilla 8ac2920f50 Root account id backfill datafix code
This datafix will have to be called
with a pending migration (or manually)
to populate the root account id for
models in the migration_tables method
We may need to create a few datafixes
as we progress to run this in batches

refs PLAT-5745
flag=none

Test plan
- If you call DataFixup::PopulateRootAccountIdOnModels.run
  it should fill ContextModule's root account ids currently

Change-Id: Ia476f189d353c54f13f7672707f61219760d3a2a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236778
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2020-06-05 21:43:03 +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
Cody Cutrer c48747a927 add Sign in with Apple
no icon yet, but /login/apple directly works

test plan:
 * add a Sign in with Apple auth provider
 * configure it correctly at Apple
 * set it up for JIT login, and federate all three attributes
 * login at /login/apple
 * it should work, and your name and e-mail address should be populated

Change-Id: If8da58558897f3d98dbe01cbc5a935e73ffbe380
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/238698
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-06-03 16:07:58 +00:00
Ethan Vizitei c2d98c82c0 repair should continue when missing data
refs CNVS-48876
flag = none

TEST PLAN:
 1) rerun backfill on failed cells
 2) don't error out when records are missing completely

Change-Id: I7af125b109664110e873086ea90f0113021c7d78
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/238920
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: Ethan Vizitei <evizitei@instructure.com>
2020-06-02 14:47:54 +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
Ahmad Amireh f0284c9f1c tell GA what kind of account it is
fixes KNO-392
flag  = none

the org type that was introduced in g/236404 and g/236535 is now
submitted to GA pageviews as a new dimension (4). These are the current
org types and their account counts, which you can get from Salesforce:

- Corporate                   (1206)
- Further Education           (359)
- Government                  (29)
- Higher Ed                   (2468)
- K12                         (3807)
- Other                       (15)
- RTO/Training                (86)
- RTO                         (1)
- Internal Use Only           (1)
- Regional Training Provider  (1)
- Training Org                (1)

|
| TEST PLAN
|

- make sure you have GA enabled if you don't already:

    Setting.set('google_analytics_key', 'foo')

- visit any page, then look for the GA snippet[1] and verify that
  "dimension4" is set to null

- now mark your account as "K12":

    Account.default.external_integration_keys.create!(
      key_type: 'salesforce_org_type',
      key_value: 'K12'
    )

- reload the page and verify that "dimension4" is set to "K12" in the GA
  snippet

- unmark the account and verify the dimension is back to null:

    Account.default.external_integration_keys.where(
      key_type: 'salesforce_org_type'
    ).destroy_all

[1]: do "view source" in browser then jump to the term "window.ga", or
     you can use this query in the console and inspect the element:

         Array.prototype.find.call(
           document.head.querySelectorAll('script'),
           x => x.innerHTML.match(/window.ga/)
         )

Change-Id: I505bf1ee2a8347a21d691e2fa4ef04cb07c9a48e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/238656
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Davis Hyer <dhyer@instructure.com>
QA-Review: Davis Hyer <dhyer@instructure.com>
Product-Review: Davis Hyer <dhyer@instructure.com>
2020-05-29 20:48:16 +00:00
Ethan Vizitei 8e11c17578 re-query on missing records
refs CNVS-48876
flag = none

TEST PLAN:
 1) run backfill
 2) re-queries should happen
 3) evidence should appear in logs

Change-Id: Ieb423f527151de08483ac1c330e046e4c886f8d4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/238837
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: Ethan Vizitei <evizitei@instructure.com>
2020-05-29 20:23:18 +00:00
Ethan Vizitei 4aba057b26 log auditor bulk inserts
refs CNVS-48876
flag = none

TEST PLAN:
 1) run backfill
 2) find cells missing records
 3) uuid lists should be logged at bulk insert time

Change-Id: Iadcb625146d8aa2b38e31051cef848cc587eca94
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/238829
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2020-05-29 20:00:41 +00:00
Ethan Vizitei 8f328d531f annotate job-ids on auditor records
refs CNVS-48876
flag = none

TEST PLAN:
 1) run backfill
 2) migration cells should have job ids for logs

Change-Id: If716a1f673bd45ecc44a4c9cee2e1c7577d27d45
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/238687
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: Ethan Vizitei <evizitei@instructure.com>
2020-05-29 01:26:43 +00:00
James Williams 3f4a5d1084 drop submission.context_code in favor of submission.course_id
test plan:
* smoke test todo list
 (needs grading and peer review lists in particular)

closes #LA-952

Change-Id: I613ffa2499986700744482c56976bba207cfb971
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/234903
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2020-05-28 23:31:13 +00:00
Jeremy Stanley a0d93f12a3 make feature flag validation a bit more helpful
instead of saying a feature "is not valid in context",
say "does not exist" or "does not apply to context"

test plan: you should get distinct validation errors
when trying to set a flag for a nonexistent feature
vs. trying to set a flag in an non-applicable context
(i.e., setting an account feature flag in a course)

flag = none

Change-Id: Idf88c4050d0e8bce760f36c7262b0986e97739fc
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/238466
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2020-05-28 17:13:28 +00:00
Jacob Fugal 82cf300ae8 switch to master for attachment migration
refs SAS-1497

Change-Id: Iccfbad9e18d53e90beb12a9846c70f7cfcae5524
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/238508
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jonathan Featherstone <jfeatherstone@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2020-05-28 16:42:24 +00:00
Jeremy Stanley d3000e3c01 cache register: don't raise invalid argument in production
refs LA-1075

Change-Id: I44634beae7382f5f4e1825f8945c5dc0c25c99b3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/238498
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2020-05-27 18:48:11 +00:00
Ethan Vizitei b180834e08 enrich auditing of auditors
refs CNVS-48876
flag = none

TEST PLAN:
 1) audit a completed migration cell in auditors
 2) results should include success count
    and failure count

Change-Id: I20afb394ddc40b6d87f47a575816a36198c92fcd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/238497
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-05-27 03:16:39 +00:00
Ethan Vizitei 3e5c3e4b25 repair state management for auditors
refs CNVS-48876
flag = none

TEST PLAN:
 1) schedule repair jobs
 2) they do not schedule more
    than one job per WEEK of cells.
 3) they don't waste a ton of time
    scanning full queries to cassandra
    for data already in postgres

Change-Id: Ibf9a58c9896a4fed8389d1ee507bf920799a6100
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/238277
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-05-22 20:02:47 +00:00
Steve Shepherd 07434113ca Add setting to hide students from other sections
Adds a new course setting to make it so students
can't see students from other sections when it is
enabled. Behavior only triggers when there is more than
one section.

test plan:
1. As a teacher, create a course and go to the course settings page
2. Under more options, check the "Hide sections on the People page
   from students" checkbox and then Click Update Course Details.
3. Leave the course as a single section for now and publish it.
4. Add a student to the course, and then log in as the student.
5. Go to the people page and verify you can see the Section column
   on the roster table.
6. Log in as a teacher and add a second section to the course.
7. Add another student and assign them the new section.
8. Log in as either student, and verify on the people page that
   the Section column no longer appears.
9. As a teacher turn off the setting and verify the students can
   see the Section column again.
10. As a teacher, delete the second section.
11. Turn on the setting again and verify the student can still see
    the Section column.

closes: USERS-352
Change-Id: I9a674674424e4d37d23e9df4dea690b1114feb7a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/234974
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-21 20:01:41 +00:00
Rob Orton 56f97d0f12 make access token for real_user
access tokens cannot be created when masquerading a user on purpose,
because this would allow a user to get the real token and use it when
permissions for the user could change in the future. A commit was made
ee50eec4bd to create the access tokens
used when doing an lti launch on the real_user instead of the user, but
this breaks some tools that are not handling all the masquerade data.
c94b34348a reverted that change to create
them on the user again.

This commit is adding a column to access_token so we can audit usage of
the tokens created from an LTI launch. When a token is created while
masquerading we add the real_user_id to the token and make the token
expire in one hour.

test plan
 - masquerade as a user
 - launch an lti_tool that creates an access token
 - the tool should see the end users token
 - in a console verify the token is set to expire in an hour
 - verify that real_user_id is used on the token
 - the token should expire within an hour

fixes KNO-464
flag=none

Change-Id: I1f8913fc536f4e2c8539551efed69b27fbdb6b1a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236443
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Davis Hyer <dhyer@instructure.com>
QA-Review: Davis Hyer <dhyer@instructure.com>
Product-Review: Davis Hyer <dhyer@instructure.com>
2020-05-20 22:00:00 +00:00
Ethan Vizitei 639da32847 build operation for repairing backfill
refs CNVS-48876
flag = none

TEST PLAN:
 1) re-schedule a shard for backfill with repair
 2) failed cells should be 0 afterwards.

Change-Id: I081da9067eaccc61396b733e73fb68c2c06b307b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/238039
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2020-05-20 18:50:11 +00:00
James Williams 0b742ad0b8 add external tool placement for submisson type selection
test plan:
* enable the "Submission Type LTI Placement" feature
* add an external tool to a course or account with a
 "submission_type_selection" placement configured
* should be able to create or edit an assignment and
 select the tool directly from the submission type
 drop down
* when selected, it should show a button
 (that currently does nothing but will be used to
 launch the tool for additional configuration)
* should be able to save the assignment with
 the tool selected, and it should stay selected
 when the saved assignment is edited again

flag=submission_type_tool_placement
closes #LA-725

Change-Id: Ic0dd44f91b61f3300c55db7e7b30d9180c7a14e2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/237534
Reviewed-by: Clint Furse <cfurse@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Clint Furse <cfurse@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2020-05-20 18:12:57 +00:00
Alex Slaughter aea6099d40 cleanup(basic_lti): Normalize Quizzes Next LTI Usage
flag = none

Fixes: QUIZ-7378

NOTE: g/226189 must be deployed to prod first

TEST PLAN:
  - Create Quizzes Next Assignment
  - Create 1 true / false question
  - Take quiz as student
  - Verify grade and submitted_at date are sent back correctly

Change-Id: I52110794bbd3ab316f2dce490869ab447e782ae3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/226551
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: David Tan <dtan@instructure.com>
Reviewed-by: Jared Crystal <jcrystal@instructure.com>
Product-Review: Kevin Dougherty <jdougherty@instructure.com>
2020-05-19 23:51:15 +00:00