we changed the structure of this cache, so prevent pollution when running
concurrently with older processes
Change-Id: Idcc7578b1a102e2d850af0069f6543915de5ee68
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270610
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
background information:
----------------------
if you make an API PUT to
https://example.instructure.com/courses/123/pages/foo
and include links to e.g.
https://example.instructure.com/courses/456
canvas will rewrite the link in process_incoming_html_content
to look like
/courses/456
which helps in being able to serve the content from multiple
domains (including, for example, cross-listed courses or
vanity URLs).
when exporting this content, canvas plugs in the primary
account domain to make the link absolute. this is necessary
because the package may be imported into a different domain.
the problem:
-----------
on import, these absolute links are left alone. if the content
is viewed on a secondary domain, the links will appear to be
to external content and navigation will be impeded (the user
may need to log in again, etc.)
test plan:
---------
1. have a canvas + multiple_root_accounts installation, with
multiple AccountDomains for a single root account. we will
call these A and B.
2. create two courses under this account, C1 and C2.
3. from domain B, create a page in C1 that links to C2
(e.g. http://domain-b.local/courses/2)
4. notice in the HTML for the page (as viewed in the Rails console)
that the link is actually to /courses/2 (at least, it should be;
this PS hasn't changed this part)
5. export the course
6. import into a new course
7. ensure in the Rails console that the imported content
also looks like /courses/2, with no domain attached
8. when the content is viewed through the web in domain B,
the link appears to be in domain B and navigation is unimpeded
flag = none
fixes LS-2390
Change-Id: I767a7722baa06a00a9da46612bc2e1457485b98d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270541
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>
closes FOO-2229
TEST PLAN:
1) decomission a shard (deactivate all accounts)
2) run with pulsar reads/writes for aua
3) flip back to db reads/writes
4) compaction does not fail with invalid sql error
Change-Id: I788c7e00861b155266a9229c2c9fdffae8a46ae7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270526
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>
it's a class method, not instance method
Change-Id: I31891fd3990f01bdb69f609df21d8902972f62f9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270308
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>
fixes QUIZ-8550
flag=none
test plan:
- create a classic quiz
- embed an image in the quiz description
- export the quiz as a QTI file
- import the quiz from the QTI file as NQ
- the import should generate a NQ
- open the NQ and see that it has instructions
with an image
- import the same QTI file with "import as new quiz" disabled
- the import should generate a classic quiz identical to
the original
Change-Id: I399698f367e016816475d51423b5d42ed5135da1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269449
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Susan Sorensen <susan.sorensen@instructure.com>
Reviewed-by: Jared Crystal <jcrystal@instructure.com>
QA-Review: Mark McDermott <mmcdermott@instructure.com>
this was now causing problems trying to modify a temple table record
test plan
- specs should pass
fixes FOO-2222
flag=none
Change-Id: Ibed8c5dd7c56958c3fd970fa7bdfaa97d517a664
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270435
Reviewed-by: Chawn Neal <chawn.neal@instructure.com>
QA-Review: Chawn Neal <chawn.neal@instructure.com>
Product-Review: Chawn Neal <chawn.neal@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
so that we can return the same one every time if called multiple times
for the same context
Change-Id: I2c5825ab115c50d1332d05d1e3cecbe45cbe7ea1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270297
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>
When submitting comments via bulk update, check the posted status of the
submission instead of the muted status of the assignment when
determining whether the comment should be hidden. This fixes an issue
that could cause comments not to appear when the submission had already
been posted (or had just been posted, in the case of submitting both a
grade and a comment).
fixes EVAL-1815
flag=none
Test plan:
- Have a course with at least two students (you need at least two so
that posting a submission for one student doesn't flip the
assignment's "muted" status)
- Take note of the ID of one of the students
- Create an assignment
- Take note of the ID of the assignment
- Using a REST client or similar, send a POST request to the bulk update
endpoint for the assignment (see below)
- As the student, open the submission details page
- You should see both the grade and the comment
Sending the bulk update request:
- Send a POST request to the endpoint
/api/v1/courses/<courseID>/assignments/<assignmentID>/submissions/update_grades
The content of the request should be multipart form data. The following
two lines will send both a grade and a comment to the endpoint for the
student whose ID is given by <student_id>:
grade_data[<student_id>][posted_grade]=5
grade_data[<student_id>][text_comment]=HELLO
Change-Id: Id3b97bf18ca888da2a2a04c372ff596335665f17
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269833
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
* teacherless? method always returned false, and has since initial
commit in 2011
* removed any code that depends on that being true, including a
permissions grant (given/can) which was always false. (side note:
'manage' and 'update' course permissions appear to be
now identical.)
* RoleOverride.teacherless_permissions was only being used by that
permissions grant
* After that, TeacherlessStudentEnrollment also then unused in code.
* I have also verified there are no Enrollment records with
TeacherlessStudentEnrollment anywhere in all shards on prod
* div.teacherless_invite_message was removed in 70bcc947cb, so I removed
some Javascript that references it
* teacherless in JS_ENV apparently also unused
* side note: commits containing a certain commit can be found using e.g.
git log -S 'TeacherlessStudentEnrollment' --oneline
Test plan:
- hard to test, so review very carefully
- grep through code for 'teacherless'
- try a couple things in the UI like having a teacher create a student
just to make sure nothing is completely broken
flag=none
closes INTEROP-6954
Change-Id: Ibbbcacf64a87c29adc719b1d61f7b3e2241fc83e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270287
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
Product-Review: Evan Battaglia <ebattaglia@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
the latter has to allocate a new hash of all the attributes
everytime it's called
Change-Id: If21ffaf494b290f8cf6d52c35d5c7dddd9a7ad31
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270288
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>
fixes INTEROP-6859
flag=none
Test plan
- Run /api/lti/courses/:course_id/membership_service
for a course with at least a few users set up
and ensure that you don't get one SQL call each
for pseudonym, enrollment and past_lti_ids
for each user
Change-Id: I6819b68ada52d42e4fc14268059c5d8b83a42d3d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269599
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
Allows users with admin rights over K5 subject courses to set a
separate image on the settings page to be used on the home page of the
course. If no banner image is set, then the home page will use the
card image. If no card image is set, then the home page will use the
course color. If no course color is set, then a defauly blue-gray
color will be used.
closes LS-2351
flag = none
Test plan:
- Create a new subject in a C4E account
- Expect the home page to show the course name on a gray background
- Go to the settings page and select a course color
- Expect the home page to show the course name of background of the
color you just selected
- Go to the settings page and upload an image for the Card Image
- Expect that image to show on the home page
- Go to the settings page and upload an image for the Wide Banner
Image
- Expect that new image to show on the home page
- Go back to the settings page, click the upper-right menu on the
Wide Banner Image, and choose "choose image"
- Expect the replaced banner image to show on the home page
- Go back to the settings page, click the upper-right menu on the
Wide Banner Image, and choose "remove image"
- Expect the banner image to no longer show on the home page
- Go to the settings page of a course in a non-C4E account and
expect the Wide Banner Image setting to not appear
BONUS POINTS:
- Set up Unsplash at /plugins/unsplash
- Set a Wide Banner Image on a C4E subject via Unsplash
- Make sure replacing / removing images works with Unsplash urls as
well as uploaded ones
Change-Id: I24c162fb142c8d57760a52abd67e17dd0c30dd18
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269902
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
Reviewed-by: Jonathan Guardado <jonathan.guardado@instructure.com>
QA-Review: Jonathan Guardado <jonathan.guardado@instructure.com>
test plan
- specs should pass
flag=react_discusssions_post
fixes VICE-1789
Change-Id: I7bbfd520007e941d2114c75fad88f73c377376d8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270234
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>
didn't realize that helper method would return the raw relation as
an optimization, which if the relation doesn't have an order by on
it would be bad.
also fix the enrollments_api_spec to actually test bookmarks
and non-bookmarks, and simplify some of the logic in
EnrollmentsApiController#index both to clean up the code, and to
allow the specs to easily test both cases
Change-Id: Ifbaf588f787de7b54f3a26c6412cca81e2f34c4a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270186
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
test plan
- reply to a discussion entry
- it should properly set parent_entry_id
- reply to the new entry
- it should still set parent_entry_id
refs VICE-1779
flag=isolated_view
Change-Id: Ia633696165d8eb84960ebd446ff6dbeff4797983
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270224
Reviewed-by: Matthew Lemon <mlemon@instructure.com>
QA-Review: Matthew Lemon <mlemon@instructure.com>
Product-Review: Matthew Lemon <mlemon@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Added support to the accounts update_api action for two new settings
related to Microsoft Sync.
The first setting, microsoft_sync_login_attribute_suffix is the
suffix that will be appended to the result of
microsoft_sync_login_attribute for the purposes of syncing.
The second setting, microsoft_sync_remote_attribute, is the Active
Directory attribute that will be used to associate Canvas users to
Microsoft users.
For example, if you had a login attribute of sis_user_id, a suffix of
@example.com and a remote attribute of mailNickname, then a query to
Microsoft would combine a user's SIS ID with the suffix, for a result of
12345@example.com and would then query Microsoft to look for any user's
who had a mailNickname that matched this new ULUV (User LookUp Value).
Note that the Selenium tests for the UI had to be taken out, as the
current UI doesn't work with this new backend. They will be readded and
adjusted in the next commit.
In addition, added support for a new login_attribute named
integration_id. This gives schools even more flexibility when
configuring MSFT Sync.
Lastly, moved all of the settings validation code out of a concern and
into a class, which explicitly defines what dependencies the validation
code has, and also just makes more sense in general.
closes INTEROP-6921
flag = microsoft_group_enrollments_syncing
test-plan:
* You'll be sending PUT requests to /api/v1/accounts/#{account.id} where
the account.id is the id of the account you're using to test this. Use
any tool you'd like for this, like cURL or Postman.
* The body of your requests will look like this in JSON:
{
"account": {
"settings": {
<the name of each of the parameters
we're testing, such as
microsoft_sync_remote_attribute>
}
}
}
* Enable the microsoft_group_enrollments_syncing feature flag, either
through the UI or a rails console with
<account.root_account.enable_feature!(:microsoft_group_enrollments_syncing)>
* Send a request to the endpoint and set all of the fields to valid
values. The name of each field is:
microsoft_sync_enabled
microsoft_sync_tenant
microsoft_sync_login_attribute
microsoft_sync_login_attribute_suffix
microsoft_sync_remote_attribute
Enabled has to be a boolean, tenant has to be a valid domain name, the
login attribute has to be one of (email preferred_username
sis_user_id), the suffix can be anything under 255 characters without
whitespace, and the remote attribute must be one of
(userPrincipalName mail mailNickname)
This request should succeed with a 200. Send a GET request to the same
endpoint as above and ensure the settings have been saved.
* For each of the following requests, you should get a 400 with an error
message and the account settings shouldn't change.
* Send a request with a suffix over 255 characters.
* Send a request with a suffix with whitepspace in it.
* Send a request with an invalid remote attribute.
* Send a request trying to enable sync, but without specifying
any settings. You can also mix it up and specify only a few
settings. Note that the suffix is optional, so if you only
omit that setting, you won't get an error.
* Send a request to the same endpoint, this time without authorization.
It should fail with an auth required message.
* Turn the feature flag off and try and change some settings. You should
get a message saying the feature flag is off.
Change-Id: If80f278e2294515be3e0b8dbf38dd22303e016b1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269542
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
Product-Review: Ryan Hawkins <ryan.hawkins@instructure.com>
test plan
- reply to a discussion entry
- it should have the reply preview as an uneditable item in RCE
refs MAT-91
flag=isolated_view
Change-Id: Ib926bf794ccda2bcbb196dd520c33d01c9687e51
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270190
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Drake Harper <drake.harper@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Drake Harper <drake.harper@instructure.com>
Product-Review: Drake Harper <drake.harper@instructure.com>
closes INTEROP-6676
flag=none
why:
* the API docs for external tools currently say that for the
course_navigation placement, setting visibility to null will allow
everyone to see the tool
* this is true, but once the visibility is set it can't currently be set
back to null
* for some reason (perhaps the public visibility option came after this
was first implemented), the tool will only save visibility if it's
admins or members, so allow setting it to public and kill two birds
with one stone
* also allow setting it to null/nil to remove the visibility constraint
entirely
test plan:
* in a Rails console, update a ContextExternalTool's visibility settings
for a placement like this:
```
tool.file_menu = {enabled: true, visibility: 'admins'}
```
* pick a placement that doesn't already exist so it's not overridden
* the reason we are using this method of updating (setting a placement
hash) is because the visibility validation only happens in this code
path
* save the tool and then examine `tool.file_menu`. it should have
visibility: admins
* set the visibility to public the same way
* save the tool and examine `tool.file_menu`. it should have
visibility: public
* set the visibility to `nil` the same way
* save the tool and examine `tool.file_menu`. it should not have any
config for visibility
Change-Id: Iaf0c4d51e3b90eea94a2d6b45df0c6d29f9ec939
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270175
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
Product-Review: Karl Lloyd <karl@instructure.com>
why:
* the AGS did not previously respect the assignment's allowed attempts
* recent changes now respect attempt limits for the online_url,
online_text_entry, and basic_lti_launch types, since these types all
funnel through assignment.submit_homework
* desired behavior is to respect attempt limits but still allow
existing submissions to be updated
* only the default submission type, external_tool, needs to be accounted
for
* note that since content_items get uploaded in a job, that the attempt
limit check won't fail this request. so manually check it and fail if
needed
closes INTEROP-6730
flag=none
todo:
* replace all instances of new_submission with submitted_at presence
test plan:
* follow the instructions in doc/lti_manual/11_testing.md to send AGS
requests
* create an assignment that has an attempt limit
* send repeated AGS requests with no submission_type override
or submitted_at override
* they should succeed while under the attempt limit, and fail once the
limit has been reached
* repeat with other submission_types
* including a submitted_at time should not fail, even if the submission
is already over the limit
Change-Id: I73e3768bcab645b5040b9f042ec40c6e9a200c54
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269309
Reviewed-by: Mysti Lilla <mysti@instructure.com>
QA-Review: Ryan Hawkins <ryan.hawkins@instructure.com>
Product-Review: Xander Moffatt <xmoffatt@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Note that even previous to this if the job were enqueued the fake user's
username is a random hash and the SIS ID (?) and email are not present so
the user would never really get added. But it's a waste of time to kick
off a job.
Test plan:
- Have a course set up with sync
- Click "Student View" on the upper right corner of the page on the
page for the course
- Check that there is now a StudentViewEnrollment
- Check that the PartialSyncChanges and Delayed::Job tables are
unchanged and there is no job
closes INTEROP-6922
flag=microsoft_group_enrollments_syncing
Change-Id: I2e6ba915355a45875e3a24064ab01084eed650a7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269926
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ryan Hawkins <ryan.hawkins@instructure.com>
QA-Review: Ryan Hawkins <ryan.hawkins@instructure.com>
Product-Review: Evan Battaglia <ebattaglia@instructure.com>
closes VICE-1561
closes VICE-1565
closes VICE-1566
flag=none
test plan:
- With isolated view flag enabled:
navigate to a discussion;
click reply to an entry
RCE should open with the reply preview html inside
type your reply, save it
the message should be saved without any reply preview html
the message should be rendered with the reply preview on top
qa risk: low
Change-Id: Ied0d857808d4615edc5798022385af8f8b3be31f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270104
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>
For trust links sometimes we see users logging into another
institution that trusts their current for a particular
course enrollment. They may have an active pseudonym on their
home shard, but not on the trust shard. Instead of querying
on non-existent pseudonyms look at all relevant pseudonyms
regardless of shard
fixes FOO-2066
flag = none
test plan:
• Have at least a trust with two accounts
• Create a user in account A
• Attempt to use the last_login API for the user in account B
• /api/v1/users/<global_id>/?include[]=last_login
• Verify no error occurs and you get a value for the
"last_login" attribute in the JSON response
Change-Id: I8b19721abd18ba05a76c85502b8c88ec86b692d9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269439
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: August Thornton <august@instructure.com>
* changes GracefulCancelErrorMixin mixin to class GracefulCancelError.
All graceful cancel errors should be public, because they are expected
errors so should have a public, internationalized, message.
* a few things that had GracefulCancelErrorMixin were not PublicErrors.
Since they now are, I added public_message to them.
* Not strictly related but I made BatchRequestFailed and
BatchRequestThrottled PublicErrors.
refs INTEROP-6739
flag=microsoft_group_enrollments_syncing
Test plan:
- Try changing your tenant to something we don't have access to,
like microsoft.onmicrosoft.com
- Sync and look at the course integration settings. You should see the
nice error saying 'Application not authorized for tenant. Please make
sure your admin has granted access for us to access your Microsoft
tenant.'
- Check the MicrosoftSync::Group object, there should be a last_error
but not a last_error_report_id (Graceful Cancel Errors don't create
error reports).
Change-Id: I583e24d1c9b0f50177c32010cf39c2d853c84a2a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269418
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
Reviewed-by: Sean Scally <sean.scally@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Evan Battaglia <ebattaglia@instructure.com>
fixes MAT-285
flag=none
This changes folder downloads to match files such that if a user had
permission to download a file, then downloading the folder would
include those files. The exception is with hidden folders, as hidden
files require a direct link to the content, and a hidden folder does
not expose an option to download from the UI anyway. Users will still
need to download files directly with the link rather than being able
to download an entire hidden folder directly.
Test Plan
- Create an unpublished folder with an unpublished file within.
- Create a folder with availability dates that have since passed,
with a file within that contains the same restrictions.
- Create a folder that's hidden, with a file within that's also
hidden.
- As a concluded teacher, attempt to download the files alone. Verify
that they all download successfully.
- As a concluded teacher, attempt to download the folders. Verify
that all the folders include their respective files.
- As a student, attempt to download the files alone. Verify that they
cannot, with the exception of the hidden file (they need a direct
link).
- As a student, attempt to download the folders. Verify that they
cannot.
Change-Id: Ia98e65be8672fa4a6b574cf6131ae20ecb3383d6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269270
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: David Lyons <lyons@instructure.com>
refs FOO-2198
flag=none
update AUA log compaction specs
to allow threaded queue to drain
TEST PLAN:
1) be sending messages over pulsar in AUA
2) cause some timeouts somehow
3) pulsar messages back up in memory
but canvas requests don't slow down.
Change-Id: I311f9d30699d6d07a58a80065a0d939472a2178e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269906
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
closes VICE-1563
flag=none
test plan:
- For now, run the spec
spec/models/discussion_entry_spec.rb:119
- Or create a DiscussuinEntry on console,
containing this node opn message:
"<div data-discussion-reply-preview='1'></div>Left me"
- After save only "Left me" shouyld be persisted
- the flag include_reply_preview should be
setted as true
qa risk: low
Change-Id: I2ec2304c8a7b9c1ff9eea2a572e899f10a7f2e77
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269907
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>
When a student submits an assignment via the web interface, make sure
that the assignment actually accepts the submitted type. In most cases
this isn't an issue because you're only allowed to select from the types
the assignment accept, but it could become one if the assignment changed
types while a student was midway through submitting, or if someone was
trying to do something sneaky.
Note that this specifically applies to the current student view--not the
enhanced view--and does not affect submissions made via API (for which
we already checked the type).
fixes EVAL-1749
flag=none
Test plan:
- Have a course that is *not* using the enhanced student view
- As a teacher, create an assignment that only accepts a certain
submission type (e.g., text entries)
- As a student in a different browser, open the assignment and begin a
submission, but do not actually submit
- As a teacher, update the assignment and change the allowed submission
type to someting else (e.g., URLs)
- As a student, try submitting the assignment with the original type
- You should get an error
- Smoke test submitting to assignments with the *correct* type and
ensure there are no errors for the following types:
- Text entries
- File uploads
- An LTI submission (e.g., Studio)
Change-Id: I50ba59afd94996d60cc8275e2ff7f73ddeb03c3c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/267717
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
QA-Review: Syed Hussain <shussain@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
Reviewed-by: Syed Hussain <shussain@instructure.com>
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
fixes VICE-1453
flag=react_discussions_post
test plan:
- with feature flag OFF
- add a reply to a discussion
- visit discussion index page
- verify that Last post at reflects the date when you
saved your newest reply
- repeat the test with feature flag on
todo: specs
Change-Id: Ieb1a191cf6cc21012dbb726ea1cb17ebf5e18403
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269662
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>
It takes too long to do this serially when the setting is updated,
so do it from a job after the setting is toggled.
refs LS-2405
flag = none
Test plan:
- As an admin, open account settings and turn on or off k5 mode
- Go to the dashboard and expect to see the correct dashboard
- Flip the setting again and expect the dashboard to update (within
a few moments)
Change-Id: I564164c4d680e23c415175b79154f1fab1ccba12
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269578
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeff Largent <jeff.largent@instructure.com>
QA-Review: Jeff Largent <jeff.largent@instructure.com>
Product-Review: Jackson Howe <jackson.howe@instructure.com>
Closes VICE-961
flag=none
TEST PLAN:
Turn on BBB and Adobe Plugins individually and together.
Go to a course and course nav should match design
Go to a group and group nav should match design
Change-Id: I494337b40d9dc60199f6a2b1453e1fd0adada37b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269521
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
closes FOO-2190
flag=none
TEST PLAN
0) be running messages through pulsar
1) restart all the pulsar brokers
2) timeout errors don't keep happening
until the next fleet restart
Change-Id: Ia61406de49bf9ad62aa57dffa62a8c4a7e5d8278
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269552
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
* use api_find in developer key account bindings controller
* use workflow module instead of writing a bunch of stuff manually for the same
concept
* set some columns NOT NULL
* collapse a hand-written query that actually takes two queries into
using Rails relations and only one
* take out a condition in that query entirely, instead of making a non-sensical
comparison
Change-Id: Ifdf88a6c398c1d6353ec273712383bbd3c9c7907
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269133
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>
Some of our customers don't have their Microsoft accounts set up such
that the UPN (UserPrincipalName) of Microsoft users is exactly equal to
the username, SIS id, or email of the corresponding Canvas user. So,
they need another way to link Canvas users and Microsoft users. This
to the (Canvas username | SIS id | email) and then using that to match
commit makes the linking more flexible by allowing a suffix to be added
to different fields (mail or mailNickname) instead of always matching to
the UPN.
closes INTEROP-6739
flag=microsoft_group_enrollments_syncing
Test plan:
- NOTE: this is the test plan I followed, but it is quite complicated.
You can use the users I already created on our Microsoft test tenant, or you
might want to test a few simpler scenarios.
- in our Microsoft tenant set up new users with emails, mailNicknames,
and UPNs that are all new and completely different from each other.
The easiest way is to create users in the admin console (add a license
which allows them to have an email address) then use
https://developer.microsoft.com/en-us/graph/graph-explorer and the
PATCH /v1.0/users/...aadid... endpoint to set the properties using
JSON blobs for each, e.g.:
{
"displayName": "INTEROP User 1",
"userPrincipalName": "INTEROPabc@OURTESTTENANT.onmicrosoft.com",
"mail": "ebattaglia.def@OURTESTTENANT.onmicrosoft.com",
"mailNickname":"INTEROPghi"
}
{
"displayName": "INTEROP User 2",
"userPrincipalName": "ebattaglia@OURTESTTENANT.onmicrosoft.com",
"mail": "ebattaglia.mno@OURTESTTENANT.onmicrosoft.com",
"mailNickname":"INTEROPpqr"
}
{
"displayName": "INTEROP User 3",
"userPrincipalName": "INTEROPstu@OURTESTTENANT.onmicrosoft.com",
"mail": "ebattaglia1@OURTESTTENANT.onmicrosoft.com",
"mailNickname":"ebattaglia1"
}
- Make two courses, "course I" and "course II", and enable sync on them.
- Set up new Canvas users with SIS ids, emails, and usernames that are
all completely differnt but that can be related to the UPNs, mails, and
mailNicknames above in various ways, some with suffixes. e.g.:
User A: username=INTEROPabc@OURTESTTENANT.onmicrosoft.comemail=ebattaglia.mno@OURTESTTENANT.onmicrosoft.com
SISid=INTEROPgh
User B: username=ebattaglia.mno
email=ebattaglia1@OURTESTTENANT.onmicrosoft.comSISid=INTEROPstu@OURTESTTENANT.onmicrosoft.com
User C: username=ebattaglia1
email=ebattaglia.def@OURTESTTENANT.onmicrosoft.com
SISid=ebattaglia
AlwaysATeacher1: username=interop_teacher
SISid=interop_teacher
email=interop_teacher@OURTESTTENANT.onmicrosoft.com
AlwaysATeacher2: username=interop_student
SISid=interop_student
email=interop_student@OURTESTTENANT.onmicrosoft.com
The last two are just to make sure there are always some teacher
in each course (otherwise the sync will fail).
This may be easiest to do by adding new users to a course and then
editing their properties. I used
User.update_all workflow_state: 'active'
CommunicationChannel.update_all workflow_state: 'registered'
To fix up pending states (NOTE that updates all your local users, so
make sure you don't care about pending states for other users)
- Enroll:
in Course I: User A as a teacher and user B as student
in Course II: User B as a teacher and User C as student.
in both: AlwaysATeacher1 and AlwaysATeacher2 as
(For some reason looking up by username instead of email when adding
user to a course worked better for me.)
- Change the root account settings to map the users in varying ways,
e.g.
c_i = Course.find(...)
c_ii = Course.find(...)
acct = c_i.root_account
acct.settings[:microsoft_sync_login_attribute] = 'preferred_username'
acct.settings[:microsoft_sync_login_attribute_suffix] = \
'@OURTESTTENANT.onmicrosoft.com'`
acct.settings[:microsoft_sync_remote_attribute] = 'mail'
acct.save
- Clear user mappings:
MicrosoftSync::UserMapping.delete_all
- Run syncs on both courses. Check in the Micrososft admin console that
the expected users are left in the course in the proper roles.
c_i.microsoft_sync_group.syncer_job.run_synchronously
c_ii.microsoft_sync_group.syncer_job.run_synchronously
- Run for varying configuration of login_attribute, suffix,
remote_attribute.
- Examples for above setups (ignoring 'always teachers' users)
SIS id, username, and email on Canvas side as above)
1) LA=preferred_username suffix="@OURTESTTENANT.onmicrosoft.com" RA=mail
(User B maps to INTEROP User 2, User C maps to INTEROP User 3)
=> Course I: members=[INTEROP User 2]
Course II: owners=[INTEROP User 2] members=[INTEROP User 2, INTEROP User 3]
2) LA=email suffix= RA=mail
=> User A maps to INTEROP User 2, User B maps to INTEROP User 3, User C maps to INTEROP User 1
=> Course I: owners=[INTEROP User 2] members=[INTEROP User 2, INTEROP User 3]
Course II: owners=[INTEROP User 3] members=[INTEROP User 1, INTEROP User 3]
3) LA=sis_user_id suffix=i RA=mailNickname
=> User A maps to INTEROP User 1
=> Course I: owners=[INTEROP User 1] members=[INTEROP User 1] (no
'always teachers' users)
=> Course II sync will fail because group doesn't have any owners.
(it doesn't have any users at all that match on the Microsoft
side actually)
3) LA=sis_user_id suffix= RA=UPN
(User B maps to INTEROP User 3)
=> Course I: members=[INTEROP User 3]
Course II: owners=[INTEROP User 3] members=[INTEROP User 3]
4) LA=sis_user_id suffix= RA=nil (default = UPN)
Same as above
- Choose one of the above setups and run partial syncs by
adding/removing users from one of the courses and checking that the
users are added/removed correcly. Clear UserMappings before each
partial sync run.
Change-Id: If10020393fe45ea44ac260da7d39fc8a1a87bf86
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269162
Reviewed-by: Ryan Hawkins <ryan.hawkins@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Evan Battaglia <ebattaglia@instructure.com>
Currently, to find users on the Microsoft side, we take their email,
username, or SIS id and look up the Microsoft user with the UPN
(UserPrincipalName) equal to that value. Thus, we call that
email/username/SIS id a "UPN" in the code.
Now however we are moving to a model with the user can choose what
target attribute on the Microsoft side they wish to match that value
(email/username/SIS id) to. (Additionally, they will be able to add an
arbitrary suffix to the value on the Canvas side before using it to look
up the user on the Microsoft side). Thus, we need a new term for this
value that we are calling a "UPN". I propose the term ULUV, or User
LookUp Value.
The only thing this commit does is rename constants/classes/variables.
refs INTEROP-6739
flag=microsoft_group_enrollments_syncing
Test plan:
- specs. as I add functionality in the next commits we will test that
the old functionality (looking up by UPN) still works.
Change-Id: I5898e9c0fd53c67c4f24dbf6166e67d68af8d9f3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269157
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ryan Hawkins <ryan.hawkins@instructure.com>
QA-Review: Ryan Hawkins <ryan.hawkins@instructure.com>
Product-Review: Evan Battaglia <ebattaglia@instructure.com>
closes OUT-4548
flag=improved_outcomes_management
Test plan:
Step 1: Setup a course group with source_outcome_group_id present:
You can do this in 2 differents way:
* 1: In any course, grab a learning outcome group and set the
"source_outcome_group_id" attribute.
This id must be the group id of an account group.
* 2: Or use the graphql import API to import a group from the account
Follow instructions on g/259131, section "Import a whole
group from account to course"
* After you setup the group, let's say you setup the group called
"group 1", grab the id of "group 1" and hold for now as GROUP_1_ID.
* You can grab the id by using the web inspector and inspect the
graphql request after selecting the group in the LHS
Step 2: Export course content:
* Go to course -> settings -> export course content
Export type: course
* Click "Create export"
* Wait the export to finish and click in "New Export"
Step 3: Verify exported content.
* Go to finder and find the exported file, it should has the
.imscc extension. Replace the extension to .zip and unzip it
* Open the file course_settings -> learning_outcomes.xml
* Assert it's populated some source_outcome_group_id nodes of
learningOutcomeGroup node
* rename it back to .imscc
Step 4: Import the course content in a blank course at the same account.
* Go to account -> "+ course"
* Go to the new course -> settings
* Import course content
Content type: Canvas Course Export Package
Source: the imscc file
Content: All content
Click "Import"
Wait until its done
Step 5: Assert import works properly
* Go to course -> outcomes
You should see same outcomes as the exported course
* Grab the id of the "group 1" that was just imported, lets
hold in IMPORTED_GROUP_1_ID.
* Go to console:
Assert the source_outcome_group_id of GROUP_1 is the same
of IMPORTED_GROUP_1_ID
Assert the source_outcome_group_id are present (not nil)
LearningOutcomeGroup.find(GROUP_1_ID)
LearningOutcomeGroup.find(IMPORTED_GROUP_1_ID)
Step 6: Import the course content in a blank course IN A DIFFERENT
account.
* Same as step 4
Step 7: Assert import works properly
* Same as step 5, but now the source_outcome_group_id should
not be populated, since its belongs to a different account.
Check this behavior in console
Step 8: Assert course copy also copy the source_outcome_group_id
* go to settings in course you want to copy > copy this course
* check in console like step 4
Change-Id: Iada96de5b614441d86cdab96644d6110d7e3fe58
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/268694
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
Reviewed-by: Pat Renner <prenner@instructure.com>
QA-Review: Martin Yosifov <martin.yosifov@instructure.com>
Product-Review: Augusto Callejas <acallejas@instructure.com>
closes EVAL-1813
flag=none
Test Plan:
1. Create and publish a course with a student and a teacher
2. Create an assignment with Anonymous Grading enabled
3. Submit to the assignment as the student.
4. As the teacher grade the submission.
5. Disable anonymous grading on the assignment.
6. Export the gradebook and notice the unposted assignment group total
and unposted course total columns include the grade given.
Change-Id: I4dc6dec393d4120d71c69f85dce136448dc3e327
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269400
Reviewed-by: Jake Oeding <jake.oeding@instructure.com>
Reviewed-by: Syed Hussain <shussain@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Jody Sailor
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
also only build the overrides cache for the current permission we're
inspecting when in no-cache mode. and other reduce-allocations-optimizations
prevents massive dependence on the query cache and re-instantiating
hundreds-to-thousands of AR objects, and thousands-to-millions of
ruby objects
for a particularly bad case, this should take it from several minutes
to a second or two at most
fixes FOO-1019
Change-Id: I8837a8b5b179491d4f7b3805788b2e3c1db83a6d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/268495
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>
refs INTEROP-6862
flag=none
why:
- for the cookie relaunch gem mostly, so that it can have the
user's locale during the login request
- locale is already passed during the launch request
test plan:
- launch an LTI tool and intercept the login request using the Network
tab of the Developer Tools
- copy the lti_message_hint parameter, and paste it into jwt.io
- it should contain a canvas_locale claim that contains your locale
Change-Id: Ic60d2d434d69a5bf86b86ec8a00c1e3d9f2dbf80
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/268836
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Xander Moffatt <xmoffatt@instructure.com>
Reviewed-by: Ryan Hawkins <ryan.hawkins@instructure.com>
refs FOO-2079
the queries that these caches protect are pretty critical, and often
run against the secondary, so make sure the secondary is up to date
Change-Id: Ia2e6ce9c45911eebf04630d1e4464d128980c1b8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269229
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: August Thornton <august@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>