Commit Graph

37 Commits

Author SHA1 Message Date
Ethan Vizitei 96c6d38b1a auditors read path
refs CNVS-48876
flag = none

make all auditors pass
backend strategy from dynamic
settings

configure indexes in
event_streams with columns
on db tables to search by

use a bookmarked collection
to return results with a simple
paginator

TEST PLAN:
  1) use a dual-writing system for a while
  2) examine API or UI results from auditor
     endpoints
  3) enable reading from postgres
  4) API and UI results from auditor endpoints
     should be equivalent
     (and loaded via SQL queries)

Change-Id: If5b10736077b7721348ede323a34dd843d08c75f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236498
Reviewed-by: Simon Williams <simon@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-09 16:10:33 +00:00
James Williams 14d9657901 use locale specific order_by in simple bookmarker
don't cache a collation key for a different locale if
it switches across requests

test plan:
* specs run

refs #USERS-448

Change-Id: I411710bea4eb8755ac6fc6ad7de8e60956f081ab
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/231195
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Keith Garner <kgarner@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clint Furse <cfurse@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2020-04-01 17:29:24 +00:00
James Williams c59a7ec906 spec: fixes for ruby 2.6
Change-Id: I5e35efeeb5258939e9e404cd90d35764659c1a87
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/223384
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2020-03-09 15:57:06 +00:00
Cody Cutrer a81944a73a rails 6: s/update_attributes/update/g
Change-Id: Ie137c1040260b363979160e1f0558883577ebebd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/222510
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-01-09 20:56:35 +00:00
James Williams f4d3a56e89 use bookmarks in enrollments api
test plan:
* enrollments API index should sort like before

closes #CORE-3405

Change-Id: I5673d6fe73896334a285049b0df8009ccc0cd2ae
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/213750
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2019-11-12 20:38:45 +00:00
James Williams d10c9f797a prevent possible infinite loop with BookmarkedCollection.filter
if it filters out at least 2 items from the first subpage
so we don't fill up the main page, we'll try to grab the next
but if that one happens to be the last subpage it will leave
next_bookmark alone (since has_more! is not called)
so it will grab the same subpage again and again until
the filtered items fill up the main page or,
in the unfortunate case that the last subpage is
completely filtered out, it will call it forever

refs #ADMIN-2964

Change-Id: Icce81a69574fffccad219cbff2871759994792d7
Reviewed-on: https://gerrit.instructure.com/211918
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2019-10-04 12:45:09 +00:00
Simon Williams 63e708f09f spec: a bit of cleanup in gems/ tests
sqlite3 released a new version yesterday, but active record is pinned to
a previous version in a way that just errors. the version pins here can
be reverted once rails releases a compatibility update. see
https://github.com/rails/rails/pull/35154

Change-Id: If9edc76058d96a75b8731422407ecea2afb4ce29
Reviewed-on: https://gerrit.instructure.com/180583
Reviewed-by: James Butters <jbutters@instructure.com>
Tested-by: Jenkins
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2019-02-06 15:19:17 +00:00
James Williams 7423e4fb94 rails 5.2
closes #CORE-1301 #CORE-1302

Change-Id: I687132b066d12cf35e3c7a593dff9b2a91337f33
Reviewed-on: https://gerrit.instructure.com/147220
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2018-04-25 19:15:20 +00:00
Matt Sessions 9623516a0f Refs MBL-9054 - Make todo items api paginate
Todo items uses 3 different scopes, so using
BookmarkedCollections we can paginate it.

Test Plan:
 - As a teacher, with at least 10 assignments
   that need grading
 - Hit the todo items api with a per_page less than 10
 - It should return pagination headers and using the
   next link should give you the rest of your todo items
 - As a student have more than 10 assignments that you need
   to submit in the next week
 - Hit the todo items api with a per_page less than 10
 - It should return pagination headers and using the next
   link should give you the rest of your todo items
 - Have ungraded quizzes that you need to take as a student
 - Hit the todo items api with a per_page less than 10 and
   include[]=ungraded_quizzes
 - It should return pagination headers and using the next
   link should give you the rest of your todo items

Change-Id: I725c2489d42e46f6b4165a3ac93ddc8fbb8b5faa
Reviewed-on: https://gerrit.instructure.com/134699
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: Matthew Sessions <msessions@instructure.com>
2017-12-11 18:03:12 +00:00
Cody Cutrer 2aad4ec681 fix simple bookmarks with tiemstamp columns
Rails 4+ returns timestamps as actual values, not just
strings. They end up serializing to json as strings, so we
need to support both strings and objects

Change-Id: I131c780b8efe18db5bae3c1d7902c1f1f58c2655
Reviewed-on: https://gerrit.instructure.com/133922
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-11-28 20:31:37 +00:00
Cody Cutrer ea1e234f22 filter page views by accessible accounts
fixes CNVS-39916

test plan:
 * enable page views (repeat once each for db, cassandra, pv4)
 * have a user associated with multiple root accounts
 * as that user, browse around both accounts
 * as a site admin, view the user; you should see all page views
 * as an admin in only one of the accounts, you should see only
   the page views from the same account

Change-Id: I79c5788c30ef87c7ff6a2ad31a909f9947e7b35c
Reviewed-on: https://gerrit.instructure.com/129850
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2017-11-08 18:22:38 +00:00
Cody Cutrer 75c7538888 drop rails 4.2
also, allow rails 5.1

Change-Id: If480c2a2c01a7578552dc70f4bdcf3a46df40e7b
Reviewed-on: https://gerrit.instructure.com/115654
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Tyler Pickett <tpickett@instructure.com>
2017-06-27 15:29:51 +00:00
Dan Minkevitch 728f1f37c3 Add datetime support for SimpleBookmarker
Refs FALCOR-391

Change-Id: Ie4cb9c167458aad956511c6d3782a96c3a52da84
Reviewed-on: https://gerrit.instructure.com/116467
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins
Product-Review: Dan Minkevitch <dan@instructure.com>
2017-06-23 21:55:20 +00:00
Cody Cutrer 68f5e6065c prep for Rails 5.1
several gem bumps for versions compatible with rails 5.1, and loosening
requirements on in-repo gems.

Change-Id: I4849b053690527e812bb1042fde8142520452123
Reviewed-on: https://gerrit.instructure.com/115650
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-06-16 02:54:20 +00:00
Landon Wilkins c5b5cc786d da licença part 53
add consistent license headers to all source files

Change-Id: I405d2def01ad68c76533b9254983497485cd7073
Reviewed-on: https://gerrit.instructure.com/110160
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
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-05-01 21:06:11 +00:00
Cody Cutrer 0d63decaee bump folio
Change-Id: I0cfcde2cc4ecfd73d6ce4000936e309d6b73abdf
Reviewed-on: https://gerrit.instructure.com/104085
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-03-07 04:00:45 +00:00
Cody Cutrer 6beba043bc fix some ruby 2.4 deprecations
the thread_safe gem has deprecations too, but they'll require Rails 5.1
until they're fixed (when both activesupport and tzinfo no longer
depend on it)

Change-Id: Ic53839d911ba8ed4d463d17f9dd7207673510f3a
Reviewed-on: https://gerrit.instructure.com/100499
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-01-25 21:53:37 +00:00
Simon Williams 359c6dea13 upgrade many canvas gems to rspec 3 syntax
as of this commit, all canvas gems should be on rspec 3.5, and pass
without deprecation warnings.

closes CNVS-34040

test plan: specs should pass without deprecation warnings

Change-Id: I556b1a4a5aeb791c6ddd50ee35b51c513e025019
Reviewed-on: https://gerrit.instructure.com/98414
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
Tested-by: Jenkins
2016-12-27 18:44:23 +00:00
Cody Cutrer 57e1a24c27 bump will_paginate for Rails 5 compat
Change-Id: If172ff73d1828253c026e993e623a2418cdc88e9
Reviewed-on: https://gerrit.instructure.com/95542
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-11-17 23:19:49 +00:00
Cody Cutrer d6f9064c3a allow Rails 5 for in-repo gems
Change-Id: Iebb04b73dfdd9c19ca51273b3bfa2b8f7bc1bb3a
Reviewed-on: https://gerrit.instructure.com/95407
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-11-17 15:07:58 +00:00
Cody Cutrer 768741c5e3 fix concated bookmark collections for non-greedy subcollections
fixes CNVS-32161

Change-Id: I348a46d02d6b6810e1d3eec9ce9f72043a0ae658
Reviewed-on: https://gerrit.instructure.com/91700
Tested-by: Jenkins
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-10-27 15:50:31 +00:00
James Williams f23f3b0ff2 remove rails 4.0 support
Change-Id: Id1900160375644ea33badaa9d9f9185fab6b81ac
Reviewed-on: https://gerrit.instructure.com/92726
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-10-25 17:17:22 +00:00
James Williams ca36398dbf rails 4.2: bump folio-pagination
refs #CNVS-26056

Change-Id: I1ad89e2d9922e9994937963b0ad783eccebc5bc5
Reviewed-on: https://gerrit.instructure.com/70759
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-01-22 16:16:29 +00:00
Cody Cutrer f552f4fc00 simplify gem test harnesses
rely on test_all_gems.sh to output header and trailer,
and use `set -e` in each test.sh to simplify passing
through errors

Change-Id: I3ba724ad2539ddfe31195394c43f646acfc73920
Reviewed-on: https://gerrit.instructure.com/70469
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-01-19 17:52:58 +00:00
James Williams b1f3daf044 rails 4.2: misc spec fixes
refs #CNVS-26056

Change-Id: Ia94ee2fcfded1ec66cb77a19085b005c81304800
Reviewed-on: https://gerrit.instructure.com/70251
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-01-18 21:45:39 +00:00
James Williams d2833299d7 remove rails 3 support
also add initial rails 4.2 scaffold

refs #CNVS-25988

Change-Id: Ifd7aecaffb6cfc8a3e41bc3fb011fb6ce0664ea6
Reviewed-on: https://gerrit.instructure.com/69129
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-12-23 21:36:43 +00:00
James Williams 288e8f9777 allow rails 4.2 on all the gems
closes #CNVS-26001

Change-Id: I4604992b32bdbf7bfbe34332010bac8ba5101889
Reviewed-on: https://gerrit.instructure.com/69183
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-12-18 19:00:18 +00:00
Brian Palmer 6ca22ee481 update will_paginate gem
Fixes https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2013-6459&cid=1

Changelog is @ https://github.com/mislav/will_paginate/commits/3-0-stable

will_paginate usage in canvas is wrapped in our folio gem, so this
actually involves updating folio. I've removed the direct dependency on
will_paginate in canvas, since folio defines that depenency and versioning.

test plan: regression test on api pagination links, including bookmarked apis
such as page views.

Change-Id: I8b7a07870d5280c307f368707a5e60aa900ba9f5
Reviewed-on: https://gerrit.instructure.com/55348
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2015-07-27 21:41:20 +00:00
James Williams 600165e7b2 rails4: deprecate Relation#all in favor of Relation#to_a
refs #CNVS-21596

Change-Id: I5dedaab90a2abe6bf288ff30401c9b31629b45b2
Reviewed-on: https://gerrit.instructure.com/59220
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-07-24 21:28:14 +00:00
Simon Williams 72415e8460 do some cleanup on gem test runs
* add test runner for broadcast_policy and fix a couple of tests that
  had been broken by accident
* add test runner for canvas_quiz_statistics and add a reference to
  iconv to it's Gemfile to allow tests to run in ruby 2
* add a test runner for canvas_sanitize
* remove leftover cruft from running gem builds in both rails 2 and 3

Change-Id: Iab2a0986f277a82c096e1fff2dab1d3a55b91733
Reviewed-on: https://gerrit.instructure.com/54518
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2015-05-18 22:39:17 +00:00
Cody Cutrer 48864de3f6 begin rails 4
enough for bundle install to work with 4.1.5

Change-Id: I277df9e4315fa250b6028139113c74721148e2f0
Reviewed-on: https://gerrit.instructure.com/39656
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-08-27 23:09:17 +00:00
Paul Hinze 071d6d8a96 align rspec version in gems with parent
update spec_helpers to fix deprecation warning after upgrade

Change-Id: I31b370d1d60f73d5256c69a8d5e69418657f880d
Reviewed-on: https://gerrit.instructure.com/39144
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Paul Hinze <paulh@instructure.com>
QA-Review: Paul Hinze <paulh@instructure.com>
2014-08-12 22:27:39 +00:00
James Williams 81558f728c remove rails 2 support
closes #CNVS-14261

Change-Id: I1b0e8a4438ab659ecd1ac8462bc3559d810989b3
Reviewed-on: https://gerrit.instructure.com/38744
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-08-06 18:16:19 +00:00
Cody Cutrer 92ea7c5be5 bundle check before bundle install for gem tests
they're likely already installed, and it will save a ton of trips
to rubygems.org

Change-Id: I9ccf2194619a6e8f97d7f21b4e232dac7ff20d3c
Reviewed-on: https://gerrit.instructure.com/35694
Reviewed-by: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-06-03 20:09:10 +00:00
Shawn Meredith e6de56a029 spec: vendored_gems pin rspec versions
Change-Id: Ibad1c172e58a69eb3a5a9ff2c874e861086ae227
Reviewed-on: https://gerrit.instructure.com/35756
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-06-03 14:54:02 +00:00
Simon Williams dc3b16f9bf add gem names to gem script runners
Change-Id: I0dad5345aae75e552af97f5b54ded10bbfebbe37
Reviewed-on: https://gerrit.instructure.com/33925
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2014-04-28 15:51:28 +00:00
Joseph Rodriguez c6fce9e781 extract bookmarked_collection gem
fixes: CNVS-11645

Test Plan:

Test the groups api endpoint at

api/v1/users/self/groups?context_type=Account

Make sure its not broken.

Change-Id: I2a17672f0e81530aa8623c5ed16b9cb0bb6b3ce5
Reviewed-on: https://gerrit.instructure.com/31417
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2014-04-17 18:16:13 +00:00