refs QUIZ-4415
test plan:
- cr
- Quiz.Next CC import is not ready for test with only this patch
- regression on `Import Content`, to make sure:
1) `Qti .zip file` import works
2) `Common Catridge 1.x Package` import works
Change-Id: Iba2818a2b864020b6c59ef55e02f122b996e4c40
Reviewed-on: https://gerrit.instructure.com/149978
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: David Tan <dtan@instructure.com>
Product-Review: Han Yan <hyan@instructure.com>
Test plan:
- Merge and warmfix onto beta
- Configure our EventManager Kinesis stream
to listen to the Module and ModuleItem
live events
- Create a Module and a ModuleItem and
validate that the events were sent
- Update a Module and a ModuleItem and
validate that the events were sent
refs SKUNK-17, SKUNK-18
Change-Id: Ia047024b0f5d38e5c14a19194f75b131f9fc68cc
Reviewed-on: https://gerrit.instructure.com/146858
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
Tested-by: Jenkins
Product-Review: Nate Collings <ncollings@instructure.com>
QA-Review: Nate Collings <ncollings@instructure.com>
`sis_batch_id` is updated even when no other field is changed on a sis
batch import. Add `sis_batch_id` to the list of fields that will not
trigger a live-events stream update.
Test Plan:
* Specs
closes RECNVS-239
Change-Id: I15f0b82dbbe1dc47885d3f2ce05932ba66f96c97
Reviewed-on: https://gerrit.instructure.com/137963
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Jonathan Featherstone <jfeatherstone@instructure.com>
QA-Review: Jonathan Featherstone <jfeatherstone@instructure.com>
closes QUIZ-203, closes QUIZ-3434
test plan:
case 1: when a root account is not provisioned by uuid provisioiner
- 'Quiz Next' feature flag is not visible in root account, sub
accounts and courses
case 2: when a root account is provisioned by uuid provisioiner
- should see 'Quiz Next' feature flag in root account
- when the FF in root account is turned to On, all courses have access
to Quizzes.Next (Quiz Migration and Easy button)
- when the FF is off, all courses don't have access to Quizzes.Next
- when the FF is allowed, subaccounts and courses should have options
to turn Quizzes.Next On or Off
Change-Id: Ib41ce2db9943151f47ad42a676d29b744c381799
Reviewed-on: https://gerrit.instructure.com/135805
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Dariusz Dzien <ddzien@instructure.com>
Product-Review: Jason Sparks <jsparks@instructure.com>
This change adds a check to the `after_update` callback to make sure
that actual update has happened. This change is in response to a flood
of `user_updated` events being written to the live-events stream from a
SIS integration that was posting updated user records to the API even
though no actual change of user data had occurred.
Test Plan:
* Follow instructions in `doc/live_events.md` to get live events setup
* Create a user record in local canvas UI
* Generate an API token for local canvas UI
* Use simple script below to PUT user same user record data
* Confirm that live event record was not written using `tail_kinesis`
script:
`docker-compose run --rm web script/tail_kinesis http://kinesis:4567 live-events`
Sample
```
const axios = require("axios");
const canvasBaseUrl = "http://canvas.docker";
const canvasAccessToken = "<TOKEN>"
axios.defaults.baseURL = canvasBaseUrl;
axios.defaults.headers.common.Authorization = `Bearer ${canvasAccessToken}`;
// Change ID and data below to match test record
axios
.put(`/api/v1/users/<ID>`, {
user: {
name: "Test User",
short_name: "Test User",
email: "test@example.com",
time_zone: "Mountain Time (US & Canada)"
}
})
.catch(err => console.log(err))
.then(res => console.log(res.statusText));
```
refs RECNVS-75
closes CORE-73
Change-Id: I89326df5ef77e28fcdebf5b3085cc8bacddf0104
Reviewed-on: https://gerrit.instructure.com/133560
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Collin Parrish <cparrish@instructure.com>
Product-Review: Jonathan Featherstone <jfeatherstone@instructure.com>
refs CNVS-32764
for address book
- add group_updated and group_membership_updated events
- add associated_user_id to enrollment_created and enrollment_updated
events for observer enrollments
- add workflow_state to group_memberhsip_created events
- add context_type, context_id, account_id, and workflow_state to
group_created events
test-plan:
- configure local canvas to write live events to a local kinesis stream
[group fields, group_updated events]
- create a course group; the group_created event in the stream should
have a context_type of 'Course', a context_id of the group's course,
an account_id of the group's account, and a workflow_state of created
- create an account group; the group_created event in the stream should
have a context_type of 'Account', a context_id of the group's account,
an account_id of the same, and a workflow_state of 'created'
- delete a group; a group_updated event should be emitted in the stream,
with all the same fields and a workflow_state of 'deleted'
[group_membership fields, group_membership_updated events]
- add a user to a group; the group_membership_created event in the
stream should have a workflow_state of 'accepted'
- remove the user from the same group; a group_membership_updated event
should be emitted in the stream, with all the same fields and a
workflow_state of 'deleted'
[enrollment associated_user_id field]
- create a non-observer enrollment (e.g. teacher); the
enrollment_created event should not include an associated_user_id
- create an observer enrollment without an assigned observee; the
enrollment_created event should include a null associated_user_id
- attach the observer enrollment to an observee; the enrollment_updated
event should include the updated associated_user_id
Change-Id: I15066b7c6cc85f914be433530d542c6f13643e6a
Reviewed-on: https://gerrit.instructure.com/106335
Tested-by: Jenkins
Reviewed-by: Jonathan Featherstone <jfeatherstone@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
closes: QUIZ-1389
test plan:
pre-reqs: quizzes2 feature enabled, course and quiz made,
kinesis stream setup (doc/live_events.md)
1. on the quiz index page, select "migrate" for the quiz
2. verify you see output in the kinesis stream
3. verify you see the authenticated s3 url in the payload
Change-Id: Iae1d3cd9675b9445ee0036093b2891f2d921a5ba
Reviewed-on: https://gerrit.instructure.com/104554
Tested-by: Jenkins
Reviewed-by: John Corrigan <jcorrigan@instructure.com>
QA-Review: Omar Khan <okhan@instructure.com>
Product-Review: Jayce Higgins <jhiggins@instructure.com>
closes: QUIZ-1235
test plan:
pre-reqs: quizzes2 feature enabled, course and quiz made,
kinesis stream setup (doc/live_events.md)
1. hit the content export endpoint with your quiz id
2. verify the content export has a completed status
3. verify you see output in the kinesis stream
4. verify you see the assignment payload in the settings hash
5. verify the payload includes:
a. resource link id
b. title
c. context title
d. context_type
e. context_id
Change-Id: I967a5c9260830ff99afc36e4a098435b81431f83
Reviewed-on: https://gerrit.instructure.com/103755
Reviewed-by: John Corrigan <jcorrigan@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Tested-by: Jenkins
Product-Review: Hannah Bottalla <hannah@instructure.com>
closes: CYOE-389
Test plan:
1. Create a rule with student choice
2. Score a student in a range with choice
3. As student, view choice page
4. As teacher, update the choice to add or remove
options
5. As student, review choice page
The options should have been updated
Change-Id: Ibb48085a8e3fa7cb2eed2f659e50ab3adb238b92
Reviewed-on: https://gerrit.instructure.com/95298
Reviewed-by: Christian Prescott <cprescott@instructure.com>
Tested-by: Jenkins
QA-Review: Alex Ortiz-Rosado <aortiz@instructure.com>
Product-Review: Michael Brewer-Davis <mbd@instructure.com>
Test Plan:
* Set up Kinesis locally (see doc/live_events.md for details)
* Create a new course, verify that 'course_created' event is sent to
kinesis stream
* Modify existing course, verify that 'course_modified' is sent to
kinesis stream
refs CNVS-30242
Change-Id: I8b0b27110cc3fd03ee21d27a56aad14b52071a3c
Reviewed-on: https://gerrit.instructure.com/95709
Tested-by: Jenkins
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Jonathan Featherstone <jfeatherstone@instructure.com>
Test Plan:
* Set up Kinesis locally (see doc/live_events.md for details)
* Create a new user, verify that 'user_created' event is sent to kinesis
stream
* Modify existing user, verify that 'user_modified' is sent to kinesis
stream
refs CNVS-30242
Change-Id: I827f63b5106abec17810f4dc9a700277d7550254
Reviewed-on: https://gerrit.instructure.com/95204
Tested-by: Jenkins
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Jonathan Featherstone <jfeatherstone@instructure.com>
closes MBL-6063
test plan:
- I'm not sure how these things are tested, but
- create an account notification
- check that a live event was fired off
Change-Id: I2d041183fc4da859a9c7f2ab9a28f1572a02ccfb
Reviewed-on: https://gerrit.instructure.com/93222
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
QA-Review: Benjamin Christian Nelson <bcnelson@instructure.com>
Product-Review: Cameron Sutter <csutter@instructure.com>
refs: CYOE-324
Test plan:
Solely an internal API, though can be tested from the
rails console:
1. Ensure cyoe config
2. For an assignment, call
ConditionalRelease::Service.rule_triggered_by( a, user )
and you should receive back the rule if it exists (nil otherwise)
Call
ConditionalRelease::Service.rules_assigning( a, user )
and you should get back the rules that assign `a`
Call
ConditionalRelease::Service.is_trigger/(a, user)
and you should get back a boolean if rule_triggered_by would return a
rule
Change-Id: I877775c2a7b53a0cd786734bed41ab7398fcdb67
Reviewed-on: https://gerrit.instructure.com/91091
Reviewed-by: Christian Prescott <cprescott@instructure.com>
Tested-by: Jenkins
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Michael Brewer-Davis <mbd@instructure.com>
refs CYOE-123
WikiPagesApiController already soft deletes pages, by updating
workflow_state manually. Overrides WikiPage#destroy to soft delete page
and associated objects.
Test Plan
1. Create a wiki page. Delete it.
2. In a Rails console, find the WikiPage and restore it.
`WikiPage.last.restore`
3. Ensure the page is available in the app again.
4. With MP flag enabled, do the same for a "mastery paths content" page.
Ensure the restored page appears in pages and assignments lists.
5. With an MP page, find the page's Assignment in the console and
restore it. Should restore like 3.
6. Restoring a page that was in a module should not reappear in the
module, but otherwise the page+assignment should restore like 3.
Change-Id: I4148f7ca0127ed2625a27059f918e64724cf2705
Reviewed-on: https://gerrit.instructure.com/90332
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Dan Minkevitch <dan@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Christian Prescott <cprescott@instructure.com>
fixes: PFS-5114
test case:
- Update a enrollment and verify that it fires the event message
- Create a enrollment and verify the create event is still fired.
Change-Id: I2f5b45a2b766c6fc8dcc7dac27924b476c07cf32
Reviewed-on: https://gerrit.instructure.com/87560
Reviewed-by: Cody Tanner <ctanner@instructure.com>
Reviewed-by: Andrew Huff <ahuff@instructure.com>
Tested-by: Jenkins
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Brandon Broschinsky <brandonbr@instructure.com>
closes CYOE-239
closes CYOE-270
Test Plan:
* Prerequisites: CYOE-240 deployed on CYOE testing
environment (if not already merged).
* Create a module with various module items that have
conditional content/mastery paths data associated
with them (e.g. assignment sets in scoring ranges
with associated assignments)
* Make a Canvas API request to the List Module Items
endpoint, adding `mastery_paths` to the `includes`
parameter as part of the call
* The response should include the mastery paths data
for the requested module items
Change-Id: I7f5f37ea10b1b37d8dc81bd54b1a9413f8bbbc05
Reviewed-on: https://gerrit.instructure.com/86868
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
Tested-by: Jenkins
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Dan Minkevitch <dan@instructure.com>
Adds kinesis events for enrollment create and
user_account_association create.
Adds missing specs for kinesis events
Test Plan:
* Set up Kinesis locally (see doc/live_events.md for instructions)
* Create an enrollment; verify that a `enrollment_created` event is sent
to kinesis (use the `script/tail_kinesis` tool to view kinesis events)
* Reigster a new user; verify that a `user_account_association_created`
event is sent to kinesis with `is_admin: false`
* Reigster a new admin; verify that a `user_account_association_created`
event is sent to kinesis with `is_admin: true`
refs CNVS-30241
refs CNVS-30242
Change-Id: If1a4a2f415b95cc78a177a7cef75fbb03808dce1
Reviewed-on: https://gerrit.instructure.com/84339
Reviewed-by: Jonathan Featherstone <jfeatherstone@instructure.com>
Tested-by: Jenkins
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Andrew Huff <ahuff@instructure.com>
* issueid: DS-595
* test plan:
* create assignment and submission
* update assignment and submission
* ensure appropriate messages are in the kinesis queue
Change-Id: I0d7730c8a4ec01f780ae3b77581efb7b48c2733e
Reviewed-on: https://gerrit.instructure.com/68362
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Linda Feng <lfeng@instructure.com>
This commit adds a new module called LiveEvents that knows how to send a
certain set of events to Kinesis. The module is configured via
normal plugin settings per account. Once the plugin is configured with
a Kinesis stream, events will start getting sent to that stream.
Events are sent asynchronously, in a background thread.
test plan:
* See `doc/live_events.md` for instructions on how to setup a local
kinesis stream and configure the LiveEvents plugin.
* Start tailing the stream with the command specified in
`doc/live_events.md` in a terminal.
* Perform the actions described in `doc/api/live_events.md` and verify
that events show up in your Kinesis terminal with the correct data.
Change-Id: Id799688c972205a1eee84a673912f84b0c7abb57
Reviewed-on: https://gerrit.instructure.com/50324
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
Product-Review: Zach Wily <zach@instructure.com>
two major pieces:
* use context_type/context_id instead of context_code for
three relations so that sharding extensions will
automatically work
* deserialize stream item data as actual AR objects instead
of OpenObject (for similar reasons)
test plan:
* run the predeploy migration, but not the postdeploy one
* view your dashboard on a shard other than your home shard;
it should be identical to your home shard
* view courses that you are enrolled in with the same id but on
different shards. the activity stream should have the correct
data for the course in that shard, for both courses (i.e.
no mixing of data from the two shards)
* do actions that generate new stream items, and verify the new
items appear correctly for the above two steps
* run the postdeploy migration, wait for the job to finish, then
repeat the test plan
Change-Id: I8d5fcadb8d971acf7388a12e9151a3e927751f44
Reviewed-on: https://gerrit.instructure.com/15462
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>