Commit Graph

18 Commits

Author SHA1 Message Date
James Williams 45147e0911 bypass the wiki model as much as possible for wiki_pages
Change-Id: I60ec3b519219fcb5256a132c05f63538600df73f
Reviewed-on: https://gerrit.instructure.com/121760
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-08-09 16:09:06 +00:00
Landon Wilkins f1359d33e2 da licença part 27
add consistent license headers to all source files
(ruby, coffeescript, javascript)

except for vendor files

Change-Id: I331826e3e3be8b7d73bbf4f6afe3a79ec1340f54
Reviewed-on: https://gerrit.instructure.com/110051
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-04-27 21:53:31 +00:00
James Williams a4f7dc86a1 conditional release content migration service
test plan:
* make sure canvas is configured with a
 conditional release service with g/85046 merged or checked out
* create assignments in a course with conditional content
* after copying the course, or exporting/importing the course,
 the new assignments should have conditional content

closes #CNVS-30371 #CYOE-235

Change-Id: I42693f2d12185f5c7f665d303baf938ad4af08ad
Reviewed-on: https://gerrit.instructure.com/85108
Tested-by: Jenkins
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
Reviewed-by: Dan Minkevitch <dan@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Christian Prescott <cprescott@instructure.com>
QA-Review: Alex Morris <amorris@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2016-08-02 15:11:13 +00:00
James Williams 28bcf0aafd improve course link validator handling with head requests
sometimes servers don't respond to HEAD requests, so
use GET as a fallback

also improve wording for link validator

test plan:
* add links to the first two urls referenced in the ticket
 into course content
* the course link validator should not flag them
* (note: the last link referenced will still fail because it
redirects too many times)

closes #CNVS-28962

Change-Id: I80f2b8d3e3a0ad1d82e818af04d4c3b9a2a6c8c6
Reviewed-on: https://gerrit.instructure.com/78244
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Felix Milea-Ciobanu <fmileaciobanu@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2016-04-29 17:26:20 +00:00
Felix Milea-Ciobanu c22f77ae9a fix course link validator
use HEAD instead of GET and accept only gzip compression

test plan:
- create a page and use these links:
  - http://www.osa.org/en-us/home/
  - http://www.aaes.org/
- start Course Link Validator
- the links above should not be listed under broken links

fixes CNVS-27460

Change-Id: I8b75b48249b1c8b0e87ee8fa417373357b69462d
Reviewed-on: https://gerrit.instructure.com/74461
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2016-03-18 15:24:08 +00:00
James Williams b33b538d82 don't flag url encoded wiki pages in course link validator
test plan:
* use the wiki sidebar to "Link to a new page", using a page
 title with a special character (e.g. ";" or "?")
* click the link and create the page
* run the link validator
* it should not flag the page link

closes #CNVS-27203

Change-Id: Ib0d33771bbaa5d83b60adaaf59eca46f49e59322
Reviewed-on: https://gerrit.instructure.com/72675
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2016-02-22 17:41:49 +00:00
James Williams 9de10e44ba don't run course link validator on questions in deleted banks
test plan:
* create a question bank
* create a question in the bank with an invalid link
* the course link validator should find it
* delete the question bank
* the course link validator should not flag the link
 in the question anymore

closes #CNVS-27389

Change-Id: Icab0298a071dc4c668ebbd0bfaab1e616e0c71af
Reviewed-on: https://gerrit.instructure.com/72677
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2016-02-22 17:32:06 +00:00
James Williams b166aa96ff don't flag links to public paths in course link validator
test plan:
* create a page or other html content with a link to a
 file in the /public directory (e.g. "/images/avatar.png")
* the course link validator should not mark it as a broken link

closes #CNVS-26982

Change-Id: Ibba746679810ba93256e39635ebf8e5826bacd56
Reviewed-on: https://gerrit.instructure.com/72370
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2016-02-18 19:46:36 +00:00
James Williams 5fbb400bf1 increase the redirect limit for the link validator
closes #CNVS-26144

Change-Id: Iccf3c707cd3d1e09ef90d878d74b472f08ec9576
Reviewed-on: https://gerrit.instructure.com/70988
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-01-28 13:52:24 +00:00
James Williams 2194a1e6d0 even more course link validator improvements
test plan:
* the course link validator should now do the following:

  * not incorrectly flag wiki page urls for pages
  with spaces in their name (and hence dashes in the urls)

  * not incorrectly flag files as missing when
  overwritten by one with the same name
  (the link still works by finding the replacement file)

  * should identify links that point to completely invalid
  canvas routes (e.g. take a working url and add a typo)

closes #CNVS-26247 #CNVS-25877

Change-Id: Ia2fdff15504a3044eeb8b09e1f1d8c0b60459054
Reviewed-on: https://gerrit.instructure.com/69851
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2016-01-11 17:14:47 +00:00
James Williams d0f8f78239 more course link validator improvements
test plan:
* the course link validator should now detect
 links that point to different courses

* also the special invalid types (linking to an
 unpublished/deleted item or to a different course)
 should have an explanatory label

* also there should be a checkbox to hide the
 unpublished links in case they don't matter yet

closes #CNVS-25715

Change-Id: I71f1f38588c6c6392d508f848cf5287182633bb8
Reviewed-on: https://gerrit.instructure.com/68657
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Ryan Allen <rallen@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
2015-12-11 14:20:25 +00:00
James Williams 4f8443c3ce find links to deleted and unpublished content in link validator
test plan:
* create an assignment/quiz/wikipage
* create a link to it in course content
* delete or unpublish the assignment/quiz/wikipage
* the link validator should point out the invalid link

closes #CNVS-25559

Change-Id: I2326dbdc81beaa8efb7726447688357e492a8398
Reviewed-on: https://gerrit.instructure.com/68266
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins
QA-Review: Ryan Allen <rallen@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2015-12-09 15:13:51 +00:00
James Williams 2da91413b9 improve redirection and status criteria for course link validator
test plan:
* create course content with various valid and invalid links,
 including the example links described in the ticket comments
* running the course link validator should not give false
 positives for these example addresses
* should work otherwise as normal

closes #CNVS-25484

Change-Id: I5d3a98b37e5c7696a2c60248df2376cd95dc9b0d
Reviewed-on: https://gerrit.instructure.com/68164
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Ryan Allen <rallen@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
2015-12-07 21:38:58 +00:00
Brock Cooper f44166e3bf Add UI to Link Validator API
Fixes CNVS-16333

Test Plan:
1. Post a few broken links in various places throughout the course,
   such as in discussions or announcements
2. from the course settings, on the right-hand side, click
 on the "Validate Links in Content" button to reach the
 link navigator
3. Click Link Validator button
4. You should expect the button to change to a Loading message
   then see a list of results
5. Click the link of one of the results
   (it should take you to the location of the broken link)
6. Remove link and re-run Link Validator
   to ensure that link no longer appears

Change-Id: I5cba118a1781eff427ef7d9690ed5bfa752dd785
Refs: CNVS-16333
Reviewed-on: https://gerrit.instructure.com/58125
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
QA-Review: Ryan Allen <rallen@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
2015-11-18 18:25:04 +00:00
James Williams 2818ecdb1a catch URI::Error instead of URI::InvalidURIError
test plan:
* using "mailto:example@example.com," in a link should
 not break course copies (or anything else) because it
 doesn't know how to rescue a URI::InvalidComponentError

closes #CNVS-22120

Change-Id: Iaac362a5bf33cd5fde05b01a578a1325f4126c6e
Reviewed-on: https://gerrit.instructure.com/59213
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2015-07-28 02:17:49 +00:00
Ethan Vizitei 1004e66540 get sentry into canvas
closes CNVS-6016

No more error reports!  (soon)

this commit builds up sentry integration through the new
Canvas::Errors module, along with other things that need
to happen on every exception.  ErrorReports
should now get pushed towards just being used for representing
a complaint a user filed via the get help form.

I fixed about half the things that got linted as well
while I was in here, but because this touches to much
I fear divergence from tackling too many (I think we
can safely say it's "better than we found it")

I left a lot of the infrastructure for error reports in place
until other commits for plugins can be merged

TEST PLAN:
 1) setup your raven.yml config file with the dsn for our
  sentry install
 2) force an error to happen in a request response cycle.
 3) see the error in sentry
 4) force an error to happen in a job
 5) see the error in sentry
 6) statsd increments shoudl still fire
 7) for the moment, an error report should still get created.

Change-Id: I5a9dc7214598f8d5083451fd15f0423f8f939034
Reviewed-on: https://gerrit.instructure.com/51621
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2015-04-13 22:26:15 +00:00
Cody Cutrer 9834937c8c don't autorequire a bunch of gems that are rarely used
Change-Id: I09ed3686629b62849d392684d587f30cb2047013
Reviewed-on: https://gerrit.instructure.com/51853
Tested-by: Jenkins
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-04-09 18:47:50 +00:00
James Williams 2580db6a52 course link validator + API
test plan:
* the course link validator should look at all user supplied
 HTML content in a course and return a list of bad links:

 - links to external content that does not return
 a valid response (i.e. dead links).
 - misconfigured urls
 - links created by missing file references in imports

* use the (currently) undocumented link validator API

POST /courses/:course_id/link_validation
 - Starts a link validation process

GET /courses/:course_id/link_validation
 - Gets the current process status
 and results (if processed)

* should return a list of items in a course, the
 bad urls, as well as a direct link to the item (for the
 future UI to follow)

refs #CNVS-15162

Change-Id: I613fff7d603e133cc155e5fb33c7f257affe0f48
Reviewed-on: https://gerrit.instructure.com/42821
Reviewed-by: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
2014-10-30 15:06:32 +00:00