Commit Graph

1987 Commits

Author SHA1 Message Date
Cody Cutrer eaca556b81 RuboCop: Style/NumericLiterals
[skip-stages=Flakey]

auto-corrected

Change-Id: I88363d87d5a70be941aa81b4ffe5306ce7506b98
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279207
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
2021-11-24 23:31:34 +00:00
Cody Cutrer 9b71ed2054 RuboCop: Style/BlockDelimiters, Style/Lambda
[skip-stages=Flakey]

auto-corrected

Change-Id: I642f868d75c079e698f1fe4161bbbe419dbe1827
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279374
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
2021-11-23 21:30:47 +00:00
Cody Cutrer c302dd8bc1 RuboCop: Style/SymbolArray, Style/WordArray
[skip-stages=Flakey]

auto-corrected

Change-Id: Id187ed60c5590025e780d81b85b5212f51368f27
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279196
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
2021-11-23 14:30:08 +00:00
Cody Cutrer c776b6ef3a RuboCop: Style/CommentAnnotation
[skip-stages=Flakey]

auto-corrected

Change-Id: Ic82dbc22b8e63cc5f2ccb9b561cb3b9ed6628966
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279100
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
2021-11-21 00:50:46 +00:00
Cody Cutrer ff99d18138 RuboCop: Style/RedundantSelf
[skip-stages=Flakey]

auto-corrected

Change-Id: I5f26ad1f8210a74c2198b514235d5134dcd0dae1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279070
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-11-20 16:41:21 +00:00
Cody Cutrer ecd0798aeb RuboCop: Style grab bag
[skip-stages=Flakey]

see .rubocop.common.yml changes for enabled cops

auto-corrected

Change-Id: Ia63a1c597c58646394b251ce81b707f32828bd4c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279010
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
2021-11-20 03:04:04 +00:00
Cody Cutrer c056882fb9 RuboCop: Style/EmptyMethod
[skip-stages=Flakey]

auto-corrected, with post review to remove unnecessary empty down methods
in migrations, and change def x(*args); end to just def x(*); end

Change-Id: Ic006bcebb0b073e6c66ed957a561c93c3d368e24
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278893
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
2021-11-19 22:26:24 +00:00
Cody Cutrer c4bc112611 RuboCop: Style/MethodCallWithoutArgsParentheses
[skip-stages=Flakey]

auto-corrected

Change-Id: Idcbd419ab2196101398715e6b8cdd8d70ae5c587
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278698
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
2021-11-18 23:07:30 +00:00
Cody Cutrer 4d43809cae RuboCop: Style/PercentLiteralDelimiters
[skip-stages=Flakey]

auto-corrected, with a post-review looking for multiline strings
to convert to heredocs

Change-Id: I7f7afb11edd63415cde10866822dd2ac5ba0d8be
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278669
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
2021-11-18 23:05:50 +00:00
Cody Cutrer 157f0ae5d4 RuboCop: Style/RedundantPercentQ
[skip-stages=Flakey]

auto-corrected, with post review changing multiline strings into
heredocs

Change-Id: I1d4c543c936e5bf0ff5eb8bf10348652da7036c2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278652
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
2021-11-18 20:26:13 +00:00
Drake Harper bdf626bc84 Add anonymous_state to discussion topic model
closes VICE-2252
flag=discussion_anonymity

Test Plan:
 - migration works

Change-Id: Ia22f62189b3993c91423c61bf8d345a39ae54264
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278612
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
Migration-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2021-11-17 21:26:39 +00:00
Cody Cutrer 9c48318a45 RuboCop: Rails/WhereEquals
auto-corrected, with post-review looking for cases where an unqualified
column would now be (incorrectly) qualified (only one found)

Change-Id: I62ef6d40ce9e7bc062db261d9c6fb9383ecd102e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278432
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-16 21:19:56 +00:00
Cody Cutrer e50edd485f RuboCop: heredocs
[skip-stages=Flakey]

Naming/HeredocDelimiterNaming and Rails/SquishedSQLHeredocs

the former was manual, the latter was automatic. I also changed
some <<- to <<~ to allow for better formatting

I also had to change comments inside squished SQL heredocs to
be block comments (since newlines are removed); searching for those
I found some multi-line strings that are better as heredocs

Change-Id: I6b138f8e32544b97df1e4c56f09ee5316cbdef9d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278184
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-16 06:36:00 +00:00
Jeremy Stanley 26fc3d406a create read-only "secondary" db user for dev/test
and activate this user while on the "secondary" in tests

Canvas uses read-only secondary database replicas, but before now,
GuardRail.activate(:secondary) had no effect in specs. The result
is that specs wouldn't catch attempts to write to a secondary,
and the error would be discovered in production, often requiring
a hotfix.

This patchset sets up a migration that creates a `canvas_readonly_user`
in the database and sets up SELECT permissions for it in each
shard's schema. (The migration does nothing in production.)

It also stubs out GuardRail in specs to run
`SET ROLE canvas_readonly_user` when activating the secondary,
and `RESET ROLE` when returning to the primary.

test plan:
 - specs pass (this PS includes specs that attempt to write to
   the secondary and verify the correct error is raised)
 - use the read-only user in development by adding the following
   to the development section in config/database.yml:

     secondary:
       username: canvas_readonly_user

   then try to write to the secondary in the rails console and
   ensure you get a permission denied error. for example,

     GuardRail.activate(:secondary) { User.create! }

   should result in

     PG::InsufficientPrivilege: ERROR:  permission denied for
     table users (ActiveRecord::StatementInvalid)

flag = none
closes LS-2818

Change-Id: Ibfa75af821eb7f5d65f6b26aea03417378ab255a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/161086
QA-Review: Isaac Moore <isaac.moore@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-10 22:21:23 +00:00
Cody Cutrer 7fdf9d7588 RuboCop: Lint
[skip-stages=Flakey]

the balance. mostly. Lint/UriEscapeUnescape is put in the pending
block because it's so touchy, and I didn't want to deal with it
right now

all manual

Change-Id: Ibeb81e013f56f160d51f7d237a9bcfe98daa1e53
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277569
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-09 21:42:31 +00:00
Eduardo Escobar 16c9812ba8 create endpoint for saving gradebook filters
created some api endpoints to support all CRUD
operations for saving the gradebook filter settings
in the backend.

fixes EVAL-2006
flag=none

test plan:
- create and publish a course with at least 1 teacher
  and one student.
create
  - use a HTTP client to make a POST request to
    /api/v1/courses/:course_id/gradebook_filters
    with the body
    {"gradebook_filter":
      {"course_id": :course_id, "name": "test",
      "payload": {"foo":"bar"}}
    }
  - notice the requests response returns the
    object created with no errors.
update
  - use a HTTP client to make a PUT request to
    /api/v1/courses/:course_id/gradebook_filters/
    :gradebook_filter_id
    with the body
    {"gradebook_filter":
      {"id": :gradebook_filter_id,
      "course_id": :course_id,
      "name": "other",
      "payload": {"bar": "foo"} }
    }
  - notice the requests response returns the
    object with the attributes updated and
    no errors.
show
  - use a HTTP client to make a GET request to
    /api/v1/courses/:course_id/gradebook_filters/
    :gradebook_filter_id
  - notice the requests response returns the
    object with the correct data and
    no errors.
index
  - use a HTTP client to make a GET request to
    /api/v1/courses/:course_id/gradebook_filters
  - notice the requests response returns an
    array of gradebook filters created and with
    no errors.

Change-Id: Ib8819d9c62ae536a40719078e83ef4d2b7b5c083
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275774
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2021-11-09 21:28:19 +00:00
Cody Cutrer d633baf85c bump inst-jobs
Change-Id: If817e41dec9ca56d82e753bfd11a5d7f09b5db19
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277608
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-09 16:10:15 +00:00
Marcus Vinicius Pompeu d97ffa57a8 Make outcome_imports endpoint aware of the parent group
closes OUT-4768
flag=improved-outcomes-management

Test plan:

  - Jenkins verifies this (API change only)

Change-Id: Ib41277d66c1e81b9d7ff7c1b94fe5a521b2552d6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274606
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Brian Watson <bwatson@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
2021-10-27 15:57:14 +00:00
Eric Saupe 023f356e85 Remove pace plans start_date column
fixes LS-2723
flag=pace_plans

test plan:
- Creating and publishing pace plans for courses, sections, and users
should create all relevant assignment overrides with correct dates
- Pace plans frontend should continue to work as expected
- Pace plans should no longer have the start_date column but should
return a start_date for the relevant context's start_at date. For example,
if the pace plan is for the user then the start_date will be the start_at
date for the user's enrollment. Course section pace plans return the
course_section.start_at. The fallback for all start_at is the course's
start_at date.

Change-Id: Iffce86bd0eca65a4f51db5f88e2b35833b7bc1f1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276317
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: Eric Saupe <eric.saupe@instructure.com>
2021-10-20 21:57:54 +00:00
Omar Gerardo Soto-Fortuño 25ecbd523f Create notification preference for Reported Reply
fixes VICE-2010

flag=none

test plan:
  - Go to Account -> Notifications.
  - Make sure you see Reported Reply below
      New Mention ONLY if your user is a teacher.
  - By default it should be on notify immediately.

qa risk: low

Change-Id: I2c11085d68e0d35bdf7446c90975d0f5b207b15e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275514
Reviewed-by: Davis Hyer <dhyer@instructure.com>
QA-Review: Davis Hyer <dhyer@instructure.com>
Product-Review: Davis Hyer <dhyer@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-10-15 16:42:05 +00:00
Omar Gerardo Soto-Fortuño dbd6503886 Add report_type to DiscussionEntryParticipant
fixes VICE-2071

flag=none

test plan:
  - Specs pass

qa risk: low

Change-Id: I73564d485864a585111c6480bbaff4726cc2e343
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275406
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>
2021-10-14 19:12:30 +00:00
Ethan Vizitei ab0488d753 make plugin zeitwerk compatible
closes FOO-2463
flag=none

TEST PLAN:
  1) specs pass

Change-Id: I0f8a9adf6a4f37192b076be7f5f5182a1c7c7173
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275466
Reviewed-by: Cody Cutrer <cody@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>
2021-10-08 17:20:38 +00:00
Ethan Vizitei b72cd379c8 make datafixup classes zeitwerk compatible
closes FOO-2461
flag=none

TEST PLAN:
 1) specs pass

Change-Id: I5f997c721f7ce560af245397d0a76ec419cca76b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275460
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2021-10-08 12:57:11 +00:00
Cody Cutrer 533c3387a9 bump inst-jobs
Change-Id: I1b49f421a6f08b507c6152174cda004f6da76d57
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274869
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-10-07 20:20:27 +00:00
Adrian Packel a79d13a1f5 Add LTI fields to submission drafts
Add several fields to submission drafts to facilitate saving LTI launch
submissions, and allow drafts to be of the type basic_lti_launch. (To
avoid breaking the new workflow, we don't yet let drafts with this type
be saved as actual submissions.)

To avoid accumulating content from a potentially infinite number of
external tools, a draft may only contain data from a single external
tool at a time. This is fine since drafts of this type will be a link to
work done somewhere else, rather than local work that could be lost.

closes EVAL-1998
flag=assignments_2_student

Test plan:
- Test that the migration works
- Smoke test creating and submitting a draft with one of the existing
  types in the UI to make sure nothing has broken

Change-Id: I2f9d66af5f479812177d47aa1b925fbecbd95d97
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275253
QA-Review: Adrian Packel <apackel@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
2021-10-07 18:23:01 +00:00
Cody Cutrer 6e04277c3a add declared_user_type
closes FOO-2318, FOO-2319, FOO-2320

test plan:
 * verify that /api/v1/users/self/logins includes the declared_user_type
 * use PUT /api/v1/users/self/logins/:id to update the declared_user_type;
   verify it changes

Change-Id: I1e43ab6ead5515b113b1949bdda544b2b5c6834f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273647
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-30 21:51:07 +00:00
Cody Cutrer b973c7ca27 RuboCop: Style/ParenthesesAroundCondition
[skip-stages=Flakey]

(auto-corrected)

this complements Lint/AssignmentInCondition

Change-Id: I8e621631cb8565cc6062398cfab714f61b485cad
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274747
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-30 12:59:18 +00:00
Cody Cutrer 4e7832206d rubocop: ignore extant migration errors
Change-Id: I86dc7240489669f3bac4820898b674fc85146f29
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274525
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-29 03:18:30 +00:00
Cody Cutrer 6f6fead3ba bump inst-jobs
for updated trigger with condition to make the query lots faster

Change-Id: I6c56e1d5c5856f537fdb66b41ee82c7dfcf187ca
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274677
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-28 19:39:56 +00:00
Cody Cutrer fe29b5cb34 RuboCop: Lint/AssignmentInCondition config, db and doc
Change-Id: I95317f45626ccc6cd7efcd17abb93aeb7e3a50f3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274583
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-28 03:33:05 +00:00
Cody Cutrer d93722cffe RuboCop: Layout db
Change-Id: Ief74cf9f6aae31e77f7262d83e2541d7ee706e4c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274071
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-22 16:01:55 +00:00
Rob Orton 55cd9a830c create discussion_entry_drafts
this just creates a table and associations. You could create objects via
rails console, but there is no interaction yet. test will be covered in
the following commits that are creating and consuming the data.

test plan
 - migrations should run
 - canvas should boot

refs VICE-2079
flag=none

Change-Id: I935a6247b5a1f11c669585cf00cfaee36da684ab
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273940
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Matthew Lemon <mlemon@instructure.com>
QA-Review: Matthew Lemon <mlemon@instructure.com>
Product-Review: Matthew Lemon <mlemon@instructure.com>
2021-09-21 22:08:53 +00:00
Cody Cutrer e9d63396ff rubocop: split configuration
* remove spurious .rubocop.yml override files
 * split the configuration into an enforced and optional
 * run both configurations in jenkins (may result in some duplicate
   comments at different levels)
 * auto-correct the enforced configuration in the pre-commit hook
 * fix comments for Gemfile.d and the root dir; enforced configuration
   is only applied to that directory for now

Change-Id: I8da21073d74e19138b1b580d66c7aae6465348d4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273898
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-21 16:02:22 +00:00
Cody Cutrer a6188928a9 bump inst-jobs
Change-Id: I14a8b40edc799e19418e38f998986201124272f8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273868
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-18 15:55:49 +00:00
Cody Cutrer e41dc9167f remove debug logging from trigger
Change-Id: I331d25dccf1363c4d2449292e581253cf6c0aaa3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273732
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>
2021-09-16 22:24:55 +00:00
Aaron Ogata a7ee6c6876 don't fail if trigger doesn't exist
Change-Id: Icbf113c4d62a8ead8f0ad8631f7c2f05c5bdea8f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273721
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Dustin Cowles <dustin.cowles@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Aaron Ogata <aogata@instructure.com>
2021-09-16 19:20:28 +00:00
Cody Cutrer 13617c6285 bump inst-jobs
Change-Id: I89728310f77a38dbe39b9ea5b9643927e74b1f0e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272912
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-11 00:15:46 +00:00
Gary Mei 00d15ab97e allow user to change immersive reader feature flag
closes MAT-254
flag=user_immersive_reader_wiki_pages

This changes the feature flag for Microsoft Immersive Reader from an
Account level flag to a Root Account one. This also adds a User level
feature flag for the same feature. If the Root Account flag is on,
then Immersive Reader will be on for the User regardless of the User
flag. If not, then the User may turn it on themselves.

Test Plan
- Create a Page.

- On master, set the root account Microsoft Immersive Reader flag to be enabled
  and locked.
- Checkout this commit.
- Verify that the Microsoft Immersive Reader flag is still on.
- Verify that the Immersive Reader button is present on the Page as
  the student, regardless of their own feature flag state.

- Switch to master and set Microsoft Immersive Reader to disabled and
  locked.
- Checkout this commit.
- Verify that the Microsoft Immersive Reader flag is off.
- Verify that the Immersive Reader button is not present on the Page
  when the student's flag is off, and present when the student's flag
  is on.

- Switch to master.
- Set Microsoft Immersive Reader to Disabled+Unlocked at the SiteAdmin
  level.
- Set Microsoft Immersive Reader to Enabled+Unlocked at the root account
  level.
- Switch back to this commit.
- Run the migration.
- Verify that the Immersive Reader button is present on the Page as
  the student, regardless of their own feature flag state.

Change-Id: I895a79d84aafae7fab59c6fe0be3b5ed4f52062e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/267695
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>
2021-09-09 18:45:40 +00:00
Jeremy Stanley 0373c143f3 add replica identity for pace_plans tables
for the benefit of cdc_event_transformer

test plan:
 - migrations succeed
 - specs pass

refs LS-2594

Change-Id: I4a5a27bf1d544b2f1657b18761916121b1768b97
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272744
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Nate Armstrong <narmstrong@instructure.com>
QA-Review: Nate Armstrong <narmstrong@instructure.com>
2021-09-08 21:33:52 +00:00
Simon Williams f74c14684b use a separate manage_assignments_edit flag when ff is on
refs FOO-2226
flag = granular_permissions_manage_assignments

I originally intended to keep the original manage_assignments permission
and use it when the flag was on for edit/manage specific permissions,
but this made labeling and documentation difficult, especially since our
rollout strategy for this flag is gradual rather than all at once. So
this commit shifts gears to create a separete granular edit flag and
only use the old permission when the flag is off.

test plan:
- labeling and documentation on the account permissions page should be
  clearer and make more sense
- everything should continue to work as before

Change-Id: I93e4cbe0daa319217e17007e3391f905f1a9d77d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273020
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: August Thornton <august@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2021-09-08 20:58:12 +00:00
Jeremy Stanley e46a98e923 create blackout dates
test plan:
 - in console, create blackout_dates on Course and Account contexts
   and ensure associations work
 - ensure start and end dates and the event title are required
   by validation
 - ensure the end date cannot come before the start date

closes LS-2426
flag = none

Change-Id: I480642350c574aead0e66a6fe0fdd7bbb31fdcbf
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272437
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Eric Saupe <eric.saupe@instructure.com>
QA-Review: Eric Saupe <eric.saupe@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2021-09-08 15:52:35 +00:00
Aaron Ogata 67aaa97cdc allow backfilling updated_at from created_at value
Change-Id: Ib34bd44664d1831315cc6893823776e27fdb6ec7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272891
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
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>
2021-09-03 15:16:12 +00:00
Cody Cutrer 12d2a2953e auto backfill another case of null columns in not null migration
Change-Id: Iff816ca9750315fc1b24b837bfacf367ff5b8b60
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272807
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-02 20:13:14 +00:00
Davis Hyer ed0a8184ce remove the trophy case
fixes VICE-2002
flag=trophy_case

test plan:
  - search for any references to the trophy case
  - after running migrations, cursory test around users

qa risk: low

Change-Id: I1ef2c75f2af1cd74490928aa7949e4226aebd065
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272712
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Drake Harper <drake.harper@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Drake Harper <drake.harper@instructure.com>
QA-Review: Drake Harper <drake.harper@instructure.com>
2021-09-01 19:25:02 +00:00
Cody Cutrer 96f6b538f8 better handle interrupted migration for courses trgm
Change-Id: Ib41ce57556d6ddb5fad9a023f5726e108859e3b1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272377
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2021-09-01 18:30:03 +00:00
Davis Hyer 19328a5442 clear account sms overrides
refs VICE-1507
flag=deprecate_sms

test plan:
  **BEFORE running migration**
  - set a custom override on your root account
    > account.settings[:allowed_sms_notification_categories] = 'foobar'
    > account.save!
  **AFTER setup**
  - run migrations
  - confirm that your previous setting has been removed

qa risk: low

Change-Id: Idba401d78f474e441f379c7ad173a6a65a5e119b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272556
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>
2021-08-31 19:12:00 +00:00
Cody Cutrer e2e0ec16f4 drop old collation key index I forgot to drop
Change-Id: I2ee2922be840074dd2e23f61415a9c2a1c7330d4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272205
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-08-25 16:26:50 +00:00
Cody Cutrer 5946e8a1a9 change course gist indexes to gin
refs FOO-2311

Change-Id: I86bda86636d465c23b86a01f460b4edca1b8de28
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272211
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-08-25 16:24:24 +00:00
Cody Cutrer d867869ab4 make sure switchman_shards_pkey index is uniformly named
Change-Id: I8c71e58dbea07423d117f6e2c48d6e35e7f1e364
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272210
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-08-25 16:24:03 +00:00
Cody Cutrer 256159b699 re-add shared_brand_configs.brand_config_md5 index
refs FOO-2311

some really old databases may be missing this index, presumably because the migration
got modified after its initial run?

Change-Id: I5f4f9bec60e668e312238683fbad6b7a97251ef3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272214
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-08-25 16:23:48 +00:00