Commit Graph

29 Commits

Author SHA1 Message Date
James Williams 60c6abb547 use more reliable requirements_met when firing live events
test plan:
* module completion live events should still work

Change-Id: I9bc30f31ad1f4351d708fff36d10e7afe2bb4f36
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/226578
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Carl Kibler <ckibler@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2020-02-19 21:04:17 +00:00
Ethan Knapp 9312726174 add live events for assignment overrides
refs PFS-12035, PFS-12662

Change-Id: Ic6dd9d58ecf456256b62212d4f8d7ec37312b449
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/199749
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Tanner <ctanner@instructure.com>
Reviewed-by: Clint Furse <cfurse@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Ethan Knapp <eknapp@instructure.com>
2020-01-10 21:38:13 +00:00
Michael Brewer-Davis 4b9fbc79ec add live events for outcomes editing
refs OUT-3177

Test plan:
- set env var for jobs container/BASE in
  docker-compose.override.yml
    STUB_LIVE_EVENTS_KINESIS: "true"
    (see live_events.md)
- at canvas.docker/plugins/live_events
  - uncheck "Disable this plugin"
  - add anything to fields
  - Apply
- tail Canvas containers for stubbed events
  > docker-compose logs -f | grep stubbed_kinesis_stream
- verify that the following live events are seen and have
  reasonable data:
  learning_outcome_created
    - when outcome created manually or via csv
  learning_outcome_updated
    - when outcome edited or deleted (in original context)
       manually or via csv
  learning_outcome_group_created
    - when created manually, via import from account,
      or via import from csv
  learning_outcome_group_updated
    - when group edited or deleted manually or via csv
  learning_outcome_link_created
    - when outcome created manually or via csv
    - when outcome imported from account
  learning_outcome_link_updated
    - when outcome moved or deleted manually or via
      csv

Change-Id: I70a62617f745b884951d22f2cb29c0178f283c12
Reviewed-on: https://gerrit.instructure.com/211460
Tested-by: Jenkins
Reviewed-by: Frank Murphy III <fmurphy@instructure.com>
Reviewed-by: Clint Furse <cfurse@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Oxana Jurosevic
2019-10-02 19:46:47 +00:00
Nick Pitrak 8817e8ad94 add course completion live event
closes CAT-2293

test plan:
- add `:docker-compose/kinesis.override.yml` to your .env file
- do docker-compose up
- in another terminal window, type `AWS_ACCESS_KEY_ID=key
		AWS_SECRET_ACCESS_KEY=secret aws --endpoint-url
		http://kinesis.canvaslms.docker/ kinesis create-stream
		--stream-name=live-events --shard-count=1 --region=us-east-1`
- go to canvas.docker/plugins
- find the Live Events plugin
- select All Accounts and click Create Config
- deselect the Disable this Plugin checkbox
- enter the following information and save:
		Kinesis Stream Name	live-events
		AWS Region	us-east-1
		AWS Endpoint	http://kinesis:4567
		AWS Access Key ID	key
		AWS Secret Access Key	secret
- close and reopen docker-compose up
- create a course with a single student enrolled
- create an assignment with web text entry worth 10 points in a module
- create a requirement for the module to earn 10/10 on the assignment
- masquerade as the student
- submit the assignment
- stop masquerading
- type `docker-compose run --rm web script/tail_kinesis
		http://kinesis:4567 live-events` in another terminal window
- grade the assignment as a 10/10 for the student
- ensure an event appears with its event_name as "course_completed"

Change-Id: Iffd5d6148fadcb66da3f8eca3a4caa9355485a90
Reviewed-on: https://gerrit.instructure.com/161106
Tested-by: Jenkins
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Dariusz Dzien <ddzien@instructure.com>
Product-Review: Neil Gupta <ngupta@instructure.com>
2018-08-28 22:09:46 +00:00
Han Yan f9676125bb Qti import from Canvas to Quizzes.Next
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>
2018-05-31 16:57:32 +00:00
Nate Collings 83a24b8a08 add Module and ModuleItem live events
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>
2018-04-23 15:12:55 +00:00
Jonathan Featherstone 89e7d3eda7 Add `sis_batch_id` to NOP fields for update
`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>
2018-01-15 22:08:29 +00:00
Han Yan f1bb548d7c Quizzes Next Feature Flag support
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>
2018-01-11 22:39:42 +00:00
Jonathan Featherstone 6966bdbebd Add check for change before publishing live-event
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>
2017-11-30 18:14:26 +00:00
Cody Cutrer 69b7bf7876 spec: mocha => rspec-mocks for observers
Change-Id: Icade3fa6ea8945578392b12b14baaea11f20324c
Reviewed-on: https://gerrit.instructure.com/120511
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-07-26 00:22:26 +00:00
Landon Wilkins 242581edd3 da licença part 48
add consistent license headers to all source files

Change-Id: Ib581cddb21430cf4971aeb14980727c2935e31e4
Reviewed-on: https://gerrit.instructure.com/110154
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-04-28 18:59:33 +00:00
Jacob Fugal 54da1d33f6 additional live events instrumentation
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>
2017-03-28 21:12:54 +00:00
Hannah Bottalla 850f136839 Extend content_export_complete live event with a qti export
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>
2017-03-15 15:10:22 +00:00
Hannah Bottalla ea8a3c8409 Push quiz_export_complete live event from Canvas
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>
2017-03-08 17:00:27 +00:00
Simon Williams 57497719a7 spec: rename the `course` helper to `course_factory`
closes CNVS-34046

test plan: specs should pass

Change-Id: I8684d30e5af7be04566b2d3903db2b7f4b14b24b
Reviewed-on: https://gerrit.instructure.com/98439
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2016-12-27 20:25:29 +00:00
Michael Brewer-Davis 82a6c7c1c2 clear cyoe cache on any assignment save
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>
2016-12-02 15:53:03 +00:00
Jonathan Featherstone 2cb8db1983 Add course_created and course_updated live events
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>
2016-11-28 20:56:02 +00:00
Jonathan Featherstone 818ae22138 Add user_created and user_updated live events
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>
2016-11-28 20:55:53 +00:00
Cameron Sutter b46d6e3bb3 fire global announcement live events
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>
2016-10-28 22:15:57 +00:00
Michael Brewer-Davis 02964503b9 add functionality to get rules affecting an assignment
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>
2016-10-06 18:51:07 +00:00
Christian Prescott fbbb07f388 Formalize WikiPage soft delete
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>
2016-09-21 15:58:27 +00:00
Kacey Roberts 9f2419ec19 New Observer for when a Enrollment is modified for live envents
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>
2016-08-30 15:53:29 +00:00
Dan Minkevitch bdfa3a3906 Include CYOE data in Modules API
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>
2016-08-25 22:17:01 +00:00
Andrew Huff 3983e8da1c add Enrollment + UserAccountAssociation kinesis live events
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>
2016-08-07 17:39:06 +00:00
Matt Smith 6ba9c9242d added live events for assignments and submissions
* 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>
2015-12-18 21:41:50 +00:00
Zach Wily 5d232f03af initial live events implementation
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>
2015-04-03 15:22:33 +00:00
Cody Cutrer 3cf156f051 rspec 3-ify spec/observers
refs CNVS-16239

Change-Id: I302fc5190effeec8bfff59689a96d4862227a78f
Reviewed-on: https://gerrit.instructure.com/42669
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Paul Hinze <paulh@instructure.com>
Product-Review: Braden Anderson <braden@instructure.com>
QA-Review: Braden Anderson <braden@instructure.com>
2014-10-13 23:13:05 +00:00
Cody Cutrer bdbeeb992d cross shard dashboards
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>
2012-11-29 17:36:24 -07:00
Joe Tanner 5e4d2787dd dashboard caching of recent_stream_items, closes #11396
Change-Id: Ib84785c76addc15734162560e6a9de352aa7618f
Reviewed-on: https://gerrit.instructure.com/14998
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-11-11 21:56:28 -07:00