[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>
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>
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>
[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>
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>
[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>
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>
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>
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>
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>
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>
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>
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>
* 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>
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>
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>
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>
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>
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>
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>
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>