[skip-stages=Flakey]
Change-Id: I6abefdfa9fed6dd4525c8786e93efa548b3710f2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/319603
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
Build-Review: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
closes AE-283
this eliminates script/sync_lockfiles.rb and integrates its
functionality directly into `bundle install`, `bundle check`, etc.
it also generalizes a few pieces so that the same approach is used
for all use cases:
* syncing versions between the main Gemfile and gems in gems/
* maintaining separate lockfiles for no plugins/including
private plugins
* maintaining separate lockfiles for multiple Rails versions
(crossed with the previous bullet)
The differences between them are just small variations on how strict
versions must match between lockfiles, and requiring pinning of
versions not in the default lockfile.
For full details, checks the docs on BundlerLockfileExtensions
This does change the strategy for filtering private plugin dependencies
out of the committed lockfile(s) - instead of filtering based on hash
of source, simply don't even include private plugin gems in the gemfile
when building the filtered lockfile (i.e. dynamic Gemfile, rather than
monkeypatching bundler to filter out -- semi-succesfully -- private
plugins from the Definition).
It also changes the "default" lockfile for Canvas that gets checked
in to be Gemfile.lock, so that other tools that are not
multi-lockfile aware can find it (such as rubocop, dependabot, and
others). This will be the lockfile corresponding to the current
default rails version for Canvas, and without private plugins.
Change-Id: I7ba398381974acbc4445f34fa3b788e8a07c5ce6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/317888
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>
Build-Review: Cody Cutrer <cody@instructure.com>
Actually use Bundler to write them out. this ensure that all
constraints are checked with the gem's Gemfile. Had to resolve
several issues with gems along the way.
also removed RedCloth from canvas_stringex, because it's never
used
Change-Id: I614be19e147bdfd3e351e7f032fd6f9b0c1926be
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/317781
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Build-Review: Aaron Ogata <aogata@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
this includes a fix for https://github.com/ruby-i18n/i18n/issues/639,
and thus we need to adjust a spec
Change-Id: I5b1425245f942dcdfdcfa34863ec43c1afe6ff0f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/317518
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Build-Review: Cody Cutrer <cody@instructure.com>
still need to ensure gem dependencies are consistent, but this should
prevent unexpected breakage during tests
Change-Id: I39420479fd3fe4f7e49a12a418eca033fcdc7564
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/314979
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>
Build-Review: Cody Cutrer <cody@instructure.com>
fixes VICE-3314
flag=none
test plan:
- set up google drive plugin locally
- as a student create a google doc collab
- as an admin, create a google doc collab
- this way, the student, and the admin have both
authenticated google
- now log in as the admin again, this time,
masquerade as the student
- visit the course collaborations page
- create a google doc collaboration
- do not invite anyone
- save
- verify that in the auto-opened
google doc tab, that it is logged
in as your own (masquerador's)
google account
- verify that back in the collaborations
tab in canvas, the collaboration you
created while masquerading shows that
you (the masquerador, is the author)
- now click to view a collaboration while
still masquerading
- verify that you are not able to view the document
and that you are sent back to the collaborations page with
a flash error stating that you need to stop masquerading
- stop masquerading
- verify you can visit a collaboration as yourself (admin)
Change-Id: I85704c3a1cdad89cca57b8aee2133ff11af1cd67
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/310803
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jason Gillett <jason.gillett@instructure.com>
Product-Review: Jason Gillett <jason.gillett@instructure.com>
QA-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
We were previously using an extremely permisive,
restricted scope when getting a token for the
Google Drive plugin (not LTI apps)
This change moves to using the recommended scopes
and should be enough to continue doing collaborations
Test Plan:
This is super hard to test locally, so I recommend
testing in beta or production like this:
- Navigatge to https://tudy.beta.instructure.com/
profile/settings
- If you already have Google Drive listed under
"Registered Services" delete it from that list
- Click on Google Drive in the "Other Services"
list
- Click on "Authorize Google Drive Access"
- Copy the URL of the page you are redirected to
- In an editor, change the "scope" query param
to match the scopes in this commit (URL encoded):
&scope=https%3A%2F%2Fwww.googleapis.com
%2Fauth%2Fdrive.appdata%20https%3A%2F%2
Fwww.googleapis.com%2Fauth%2Fdrive.file
- Paste the modified URL into your browser and
log in to Google
- Grant consent to connect with Canvas
- Verify you are redirected back to Canvas
- Verify Google Drive is now listed under
"registered services"
Now we need to test that the new scopes are
permissive enough. Do this by creating a collaboration
- As a teacher, create a collaboration using the Google
drive plugin
- Add a student to the collaboration
- Log in as that student in an other browser. Verify
you can access the collaboration and linked google
doc
- As the teacher, remove the student from the collab
- As the student, attempt to access the Google doc
- Verify you are asked to request permission
- As a teacher delete the collaboration and associated
document
- As the student, attempt again to access the doc
- Verify you are shown a "not found" message
Change-Id: I6f3c514534fc9e1d161f6b760365685b300887d1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278807
Reviewed-by: Ben Rinaca <brinaca@instructure.com>
Reviewed-by: Tucker Mcknight <tmcknight@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
[skip-stages=Flakey]
auto-corrected, and also introduced empty? method on several
file-like classes so that the autocorrect is safe on them
Change-Id: I7c84a39fc3f11cad50bf4ccb3cd97883881c2129
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278756
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>
auto-corrected, but so many tweaks after to gemspecs it may as well
have been manual
Change-Id: I69aeb6e216894462d6d893ed4c123aa9898fc72f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278516
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>
Change-Id: Ib49bc8939cf1706e758429e531a87c57d0231a37
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251156
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
also fix some myself
Change-Id: I95e354d4da570deaf8aaa613e05ff361f49f0393
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/248030
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Fixes: DIG-1761
Note:
- According to google drive docs, a 307 temporary redirect is a
known response that should trigger following the redirect:
https://cloud.google.com/storage/docs/json_api/v1/status-codes#307_Temporary_Redirect
Test plan:
- Enable Google Drive plugin
- Confirm google plugin submissions work as expected
Change-Id: Ifb5d2716c36461fad66e400625e01655af06186d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/232432
Reviewed-by: Jeremy Slade <jslade@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: James Butters <jbutters@instructure.com>
QA-Review: Kwok Lam <klam@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Change-Id: I80c39d6a496347801eb329afee281bcb2b06f44e
Reviewed-on: https://gerrit.instructure.com/211350
Tested-by: Jenkins
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
The Google API keeps getting hit with throttle responses, which are not
covered by the built in retries in the GoogleDrive::Client. Have to
manually check to retry on 4xx and 5xx status codes.
fixes GOOF-680
Test Plan:
* Access non-lti Google Drive
* Mock response to Google API to send a 429
* Verify retry attempts with backoff to access the API
* Mock response to Google API to send a 503
* Verify retry attempts with backoff to access the API
Change-Id: I0ab095ffe1717439d06444dc37bebb9a403729c1
Reviewed-on: https://gerrit.instructure.com/173756
Tested-by: Jenkins
Reviewed-by: Nick Houle <nhoule@instructure.com>
QA-Review: Nick Houle <nhoule@instructure.com>
Product-Review: Nick Houle <nhoule@instructure.com>
Refs GOOF-658
Test Plan: Test that an assignment upload works from
google doc plugin(not lti)
Change-Id: Id9a75d964c60c42336ef827e2472720f33d855a5
Reviewed-on: https://gerrit.instructure.com/173424
Reviewed-by: Nick Houle <nhoule@instructure.com>
Reviewed-by: Jeremy Slade <jslade@instructure.com>
Product-Review: Nick Houle <nhoule@instructure.com>
Tested-by: Jenkins
QA-Review: Pedro Fajardo <pfajardo@instructure.com>
Fixes: GOOF-594
Notes:
(tl;dr There were base retries already in place but they were failing
because there was no backoff. The aws gem gives us exponential backoff
for free)
- We are using the `google-api-client` v0.8.2 (which is quite out of
date) to execute requests to google to obtain documents. The
`execute!` method that is used has a default of `0` retries. The
method then uses `Retriable.retriable` to retry IFF google returns an
error. The `Retriable.retriable` by default has no exponential
backoff (the :interval parameter) because there are no set retries
passed into the `execute!` method. By passing a resonable number of
retries the built in exponential backoff for this gem will allow us to
bypass the `Rate Limit Exceeded` error.
Test Plan:
- Install the Google Doc plugin
- Verify submitting a document via the plugin for an assignment
works
- Verfiy submitting a document via the plugin for a collaboration
works
Change-Id: Icb2a18c4fa290bead72146e92e1e1d2869ee1915
Reviewed-on: https://gerrit.instructure.com/169471
Tested-by: Jenkins
QA-Review: Pedro Fajardo <pfajardo@instructure.com>
Reviewed-by: Joshua Orr <jgorr@instructure.com>
Reviewed-by: Jeremy Slade <jslade@instructure.com>
Reviewed-by: Bradley Horrocks <bhorrocks@instructure.com>
Product-Review: Jeremy Slade <jslade@instructure.com>
Change-Id: Ifa057b0e21c77331f8c77d26a832a6cfa87ae264
Reviewed-on: https://gerrit.instructure.com/136731
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
as of this commit, all canvas gems should be on rspec 3.5, and pass
without deprecation warnings.
closes CNVS-34040
test plan: specs should pass without deprecation warnings
Change-Id: I556b1a4a5aeb791c6ddd50ee35b51c513e025019
Reviewed-on: https://gerrit.instructure.com/98414
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
Tested-by: Jenkins
refs #CNVS-26056
Change-Id: I5fd18402b639d87c94ee9bafb52871ab31e52974
Reviewed-on: https://gerrit.instructure.com/71368
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Google drive relevant code has been moved to the gems/google_drive
Actually test google drive with mocked api responses
cleaned up lots of code
Fixes PLAT-1301
Test Plan:
*** You'll need to use 2 separate google accounts to fully test ***
** Its helpful to have multiple chrome profiles so you dont have to log in and
** out a bunch https://support.google.com/chrome/answer/2364824?hl=en
BEFORE SWITCHING TO THIS PATCH SET
- Make sure you have some google doc collaborations
- Directions for creating one are below
- Disable your google docs plugin
Switch to the patch set
Enable google drive. (if not already)
- You should be able to paste in a client_secrets.json
- Update Redirect URI to point to your local instance (The URI should exist in the JSON)
As an admin/teacher
- Goto `profile/settings` and add the google drive user service
- Your email should be displayed with the service
- Goto Collaborations
- Make sure existing collaborations still work
- Click "Start new collaboration"
- give it a nice name (Created by admin)
- select your student
- click start collaborating
- You should be redirected to the new doc in google
- create another collaboration without the student (Created by admin, no users)
- Create an assignment with
Submission Type: Online
Online Entry Options: File Uploads
- Make sure your student has access to the course/assignment
- Goto Account settings -> Users
- Click View User Groups in the top right
- create a new group set with a group in it
- add yourself and your student to the group
- Goto the Group's Collaborations (Courses & Groups -> [group name] -> Collaborations)
- Click "Start new collaboration"
- give it a nice name (Created by admin for group)
- select your student
- click start collaborating
- You should be redirected to the new doc in google
As a student
- Goto `profile/settings` and add the google drive user service
- Your email should be displayed with the service
- Goto the assignment
- Submit the assignment
- You should have a "Google Doc" tab
- Choose a document and submit it
- After it submitted, click download on the right side
just to make sure its correct
- Goto Collaborations
- Make sure existing collaborations still work
- make sure the "created by admin" collaboration works
- make sure you can't see "Created by admin, no users"
- Click "Start new collaboration"
- give it a nice name (created by a student)
- click start collaborating
- You should be redirected to the new doc in google
- Switch to your admin/teacher and make sure they can't access it
- Edit the collaboration add the teacher, click Save
- Switch to your admin/teacher and make sure they can access it
- Goto `profile/settings` and REMOVE the google drive user service
- Go back to collaborations
- You should be forced to add the google service in order to use a collaboration
- Goto the Group's Collaborations (Courses & Groups -> [group name] -> Collaborations)
- Make sure you can access "Created by admin for group"
- Click "Start new collaboration"
- select your admin/teacher
- click start collaborating
- You should be redirected to the new doc in google
- make sure your admin can access it to
As a site admin
- Disable Google Drive
- Then with your student
- Make sure you can still do file upload submissions on the assignment
- Collaborations should no longer show up (unless you have etherpad enabled)
- Google drive should no longer show up in your profile settings as a registered service
Change-Id: I4dfaff6f5262743c044aadd12266fd0bd85a60e1
Reviewed-on: https://gerrit.instructure.com/69078
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brad Horrocks <bhorrocks@instructure.com>
rely on test_all_gems.sh to output header and trailer,
and use `set -e` in each test.sh to simplify passing
through errors
Change-Id: I3ba724ad2539ddfe31195394c43f646acfc73920
Reviewed-on: https://gerrit.instructure.com/70469
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
When ititializing we attempt to pull a users email adress from an
existing google doc user service
Fixes PLAT-989
Test plan
Make sure that you see your google docs email when authing google drive.
Change-Id: Ia52af22bff17eda723cd5a29e014ea09d08c95af
Reviewed-on: https://gerrit.instructure.com/52210
Tested-by: Jenkins
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>
force users to auth google drive when the plugin is enabled
Add support for google drive in collaborations and homework submissions
Everything still looks like google docs to the user.
fixes PLAT-892
fixes PLAT-893
fixes PLAT-894
Test plan:
create a google docs integration
and enable the google drive plugin
when you visit the colaborations page it should ask you to authorize canvas to use google drive
Regression test homework submissions with google doc and drive
Regression test collaborations with google doc and drive
Change-Id: I79bdbdcae915b08a19cc9a078a64b49ef5f34796
Reviewed-on: https://gerrit.instructure.com/48583
Tested-by: Jenkins
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brad Horrocks <bhorrocks@instructure.com>
Google Drive OAuth 2 works
Test Plan
- Setup a google dev account with drive api access
- Enable Google drive plugin
- In user setting add google drive
fixes PLAT-887
Change-Id: Ib174d4233c284e4bb61eea5c9b4cbc09e2a9fab9
Reviewed-on: https://gerrit.instructure.com/48220
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Brad Humphrey <brad@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>
Reviewed-by: Brayden Lopez <blopez@instructure.com>