Commit Graph

68 Commits

Author SHA1 Message Date
Cody Cutrer a623afaa38 gergich tweaks
* pass additional arguments to script/rlint --heavy -- --additional-args
 * disable a rails cop
 * lower style cop to info severity

Change-Id: I5cbc94bfc503ae48c635ccb77f66b60f564e1b08
Reviewed-on: https://gerrit.instructure.com/52867
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-27 18:18:34 +00:00
Ethan Vizitei 7a07985ba1 Don't let rlint bail on files that don't exist anymore
also start moving the more complicated logic
from the rlint script into tested helper
classes

Change-Id: I5c3916b0c7e695389b552dc1a6b4353aaaeba290
Reviewed-on: https://gerrit.instructure.com/52743
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
2015-04-23 19:08:19 +00:00
Ethan Vizitei 937244a8e9 skip comment building on diff if no ruby changes
Change-Id: Idcf6a213ea05f016d646829561aed3dd8baef95e
Reviewed-on: https://gerrit.instructure.com/52309
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Tested-by: Ethan Vizitei <evizitei@instructure.com>
2015-04-15 21:20:51 +00:00
Ethan Vizitei 6c77127375 don't rubocop everything if there are no ruby changes
Change-Id: I5807e19353cce8374796f4ff97814821bf95b248
Reviewed-on: https://gerrit.instructure.com/52271
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Tested-by: Ethan Vizitei <evizitei@instructure.com>
2015-04-15 20:39:21 +00:00
Ethan Vizitei e9e659d990 add boyscout mode for rlint
also back off the hash syntax rule

Change-Id: Ib5daec82b013cb5ca3abeec7705f3838cc438d06
Reviewed-on: https://gerrit.instructure.com/52023
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Tested-by: Ethan Vizitei <evizitei@instructure.com>
2015-04-11 15:13:26 +00:00
Ethan Vizitei 1329e71c53 colorize rlint output
Change-Id: I357a15e38c454991efd556491cd8f047a07f701a
Reviewed-on: https://gerrit.instructure.com/52008
Reviewed-by: Braden Anderson <braden@instructure.com>
Product-Review: Braden Anderson <braden@instructure.com>
QA-Review: Braden Anderson <braden@instructure.com>
Tested-by: Jenkins
2015-04-10 20:13:36 +00:00
Ethan Vizitei 13f8256e92 add heavy mode and INFO on only touched lines
lets rlint only run with local changeset unless you specify "--heavy"

Also checks for whether you actually touched a line
or not before deciding an INFO comment is relevant

Change-Id: I4a960c72644dfc46aca7a51d04321711cef0850c
Reviewed-on: https://gerrit.instructure.com/51992
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Tested-by: Ethan Vizitei <evizitei@instructure.com>
2015-04-10 16:59:07 +00:00
Ethan Vizitei f8e4b93f37 make script/rlint faster
on jenkins this was taking up to 9 minutes.

By removing the file I/O and batching
the georgich commits, this ran locally on my
sentry patch set in 15 seconds.

Change-Id: I23b0df9b9396829de4b8ff084f4f92df6e698da2
Reviewed-on: https://gerrit.instructure.com/51987
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
2015-04-10 16:53:19 +00:00
Ethan Vizitei 4a42cbbeda Update script/rlint to work on jenkins
Needed some better use of environment variables
to get the right SHA.  also shouldn't care about
dirty working directory on jenkins.

Change-Id: I85d4b9468f629217adcdd25039e44f26fd20b1d5
Reviewed-on: https://gerrit.instructure.com/51907
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
2015-04-09 17:40:41 +00:00
Ethan Vizitei 19a71c6b64 add some ruby linting for jenkins to take advantage of
add migration lint as rubocop cops

create frozen constant linter

find_ids datafixup lint

send_later lint

lint send_later in predeploys

add freeze_constant cop to default config

don't forget to include rubocop when running

get the rubocop runner into the script

lint for wrong algorithm name

lint primary key

lint remove_column in predeploys

get rubocop output as parsed json

diff munging for gergich

disable a few style cops

tweak rubocop setup to allow IDE plugins to work

get gergich comment format right

shell out to gergich if we're in jenkins-land

Change-Id: I6eecc8d8ede17a755c9d9a86121c3658776de9cd
Reviewed-on: https://gerrit.instructure.com/51755
Tested-by: Jenkins
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
2015-04-09 14:37:37 +00:00
Zach Wily 5d232f03af initial live events implementation
This commit adds a new module called LiveEvents that knows how to send a
certain set of events to Kinesis. The module is configured via
normal plugin settings per account. Once the plugin is configured with
a Kinesis stream, events will start getting sent to that stream.

Events are sent asynchronously, in a background thread.

test plan:
 * See `doc/live_events.md` for instructions on how to setup a local
   kinesis stream and configure the LiveEvents plugin.
 * Start tailing the stream with the command specified in
   `doc/live_events.md` in a terminal.
 * Perform the actions described in `doc/api/live_events.md` and verify
   that events show up in your Kinesis terminal with the correct data.

Change-Id: Id799688c972205a1eee84a673912f84b0c7abb57
Reviewed-on: https://gerrit.instructure.com/50324
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
Product-Review: Zach Wily <zach@instructure.com>
2015-04-03 15:22:33 +00:00
Benjamin Porter b8b8b65097 canvas_update script: fix bug with missing gems/plugins and/or
vendor/plugins

When either gems/plugins or vendor/plugins doesn't exist in the repo,
the script would print an error as it tried to list the directory
contents through globbing.  This fixes that error.

Fixes CNVS-19519

Test Plan:
    - Create a new checkout with no vendor/plugins directory, or delete
      the existing one (not recommended)
    - Run the script and ensure it does not report an error with
      a missing vendor/plugins/*
    - Ensure the script completes without error

Change-Id: I4d49fc090d4abc21ac8e8005f4ed83c47b4e89c5
Reviewed-on: https://gerrit.instructure.com/50961
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Product-Review: Cameron Sutter <csutter@instructure.com>
Tested-by: Jenkins
QA-Review: Benjamin Porter <bporter@instructure.com>
2015-03-25 19:26:50 +00:00
Cody Cutrer 6aa62cfce6 update bigeasy/timezone to 0.0.40
updated with a new script - `script/update_timezone_js.sh v0.0.40`

Change-Id: Iac76910d97ed639798804a3024f7c10fe0821d9d
Reviewed-on: https://gerrit.instructure.com/50062
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2015-03-23 19:30:48 +00:00
Addison Higham 099bafa228 Make changes for node 12/iojs.
This makes a number of changes to get the compilation compatible with
node 12 and iojs.

- removes loom (no longer used)
- updates karma dependencies to more recent versions
- minor css change to make sass compilation work with node-sass
  (lib-sass)

test plan:
- should be able to compile assets with node 12 and iojs
- JS specs still pass

Change-Id: Id4a0628ff0c6dd09e622d02329a4400d60459ec2
Reviewed-on: https://gerrit.instructure.com/49493
Tested-by: Jenkins
Reviewed-by: Nick Houle <nhoule@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
QA-Review: Cameron Matheson <cameron@instructure.com>
2015-03-05 22:43:38 +00:00
Dave Donahue 4468b0c085 add gems/plugins to canvas_update script
Change-Id: I8b356ff481993a88a6ec02116a8f1adcc0fb203d
Reviewed-on: https://gerrit.instructure.com/48111
Reviewed-by: Benjamin Porter <bporter@instructure.com>
Tested-by: Jenkins
Product-Review: Dave Donahue <ddonahue@instructure.com>
QA-Review: Dave Donahue <ddonahue@instructure.com>
2015-02-03 05:44:35 +00:00
Benjamin Porter da3296e385 canvas_update script: add double quotes and $() where apropo
bash best practice is to use double quotes to prevent globbing and word
splitting.  This probably doesn't matter in the context we are using,
but it pollutes the output of the linter so might as well just fix it.

Also switch `` to $().  Backticks are deprecated

Fixes CNVS-18183

Change-Id: I03cef6a7b3e1740bfb46c422e89788cd5d1eb7e0
Reviewed-on: https://gerrit.instructure.com/47726
Reviewed-by: Mark Severson <markse@instructure.com>
Tested-by: Jenkins
QA-Review: Adam Stone <astone@instructure.com>
Product-Review: Benjamin Porter <bporter@instructure.com>
2015-01-29 16:24:41 +00:00
Ryan Shaw 15063dd11b A way for devs to set their own brand style vars
closes: CNVS-17331 CNVS-14993
refs: CNVS-17332

This is the first step to having a full theme editor where
accounts can pick their own color scheme in a UI and all of 
canvas will be branded to their school colors.

test plan:

* copy config/brand_variables.scss.example to config/brand_variables.scss
* recompile sass
* users in accounts that have "new styles" or "k12" turned on that have
  not turned on "high contrast". should see a new purple-orange canvas.
* but users that have turned on the "high_contrast" feature or accounts
  that have not turned  on either "k12" or "new styles" should not.

Change-Id: I16342d43b56e49d52fbee8fa5c6a0fd57ae6e602
Reviewed-on: https://gerrit.instructure.com/46085
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Colleen Palmer <colleen@instructure.com>
2015-01-06 21:48:35 +00:00
Jon Jensen 7420e67f71 return non-zero exit code on xss linting failure, refs CNVS-17663
this will allow us to enforce linting in the build

also ignore plugins' vendored javascript

Change-Id: Ibf6e9b73e0051a0b581ee52b641f9ff00dd6b2f2
Reviewed-on: https://gerrit.instructure.com/46351
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2014-12-29 20:48:00 +00:00
Jon Jensen 70cdc92bdb XSS linting, fixes CNVS-17663
no significant issues/vulnerabilities fixed in this commit, rather this is
a catch-all so we can enforce linting in the build.

to better understand what's going on here, see the following:

* public/javascripts/.xssignore
* script/xsslint.js
* https://github.com/jenseng/xsslint

high level summary of what's going on in this commit:

1. .html/.append/etc. now know what to do with a SafeString ... in many
   cases we now put a $.raw around an .html argument to tell the linter
   it's ok
2. although translation is an unlikely attack vector, we now htmlEscape
   I18n.t calls used in html snippets, etc. this is a good thing, as it
   ensures we don't create a vulnerability later (e.g. by interpolating
   user content into a translation)
3. many vars were renamed (Html suffix, $ prefix) to let the linter know
   it's something that was manually vetted
4. in some cases, rather than renaming or creating a superfluous var,
   we add special xsslint comment overrides

test plan:
specs should all pass

Change-Id: Ide1df825b798d1b0c468a5308802543bf716c0d7
Reviewed-on: https://gerrit.instructure.com/46097
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Derek Hansen <dhansen@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2014-12-29 17:45:43 +00:00
Jon Jensen 8192132c3e i18nliner-js (part I)
this swaps out our "parsing" with i18nliner-js

also remove localization abilities of I18n.beforeLabel, since it's not
worth the trouble to support. it can still be called to format a string.

notable changes/fixes in generated yml:
1. client_apps are picked up by i18n:rake so they'll get translated...
   due to the old short-circuiting logic (`rc = rc && ...`), it would
   stop processing scripts within a particular file after the first one
   it found without an I18n.t
2. we no longer incorrectly double-escape special chars in our js strings
   (e.g. newlines are actually newlines, not a literal "\n")

test plan:
1. verify string extraction:
   1. `rake js:generate i18n:generate` before and after this commit
   2. confirm `config/locales/generated/en.yml` is identical, except the
      notable changes/fixes listed above
2. verify js translation file generation:
   1. `rake i18n:generate_js` before and after this commit
   2. confirm the files in public/javascripts/translations are identical
3. verify client_app checker still works:
   1. `cd client_apps/canvas_quiz_statistics/`
   2. `grunt check_i18n`

Change-Id: Ic8ad058bee1c9476f42916f10b612c1c08863fe3
Reviewed-on: https://gerrit.instructure.com/42809
Reviewed-by: Michael Ziwisky <mziwisky@instructure.com>
Product-Review: Michael Ziwisky <mziwisky@instructure.com>
QA-Review: Michael Ziwisky <mziwisky@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-10-30 06:25:36 +00:00
Brian Palmer f6900880bf extract delayed_job plugin into separate gem
closes CNVS-15881

This mostly involved adding hooks to the gem for things that we were
directly modifying in Canvas, then hooking into those points in the
canvas config/initializers/delayed_job.rb file.

Periodic jobs scheduling changed a bit as well -- there's no longer
support in the extracted gem for reading a special file under config/,
so I moved our periodic_jobs.rb file to a normal initializer.

test plan: delayed jobs should still work as before, including queuing
jobs, running the worker pool, and in tests.

Change-Id: I9ce57091d18f21f4355011fcb75230193d53facb
Reviewed-on: https://gerrit.instructure.com/42027
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2014-10-24 20:46:00 +00:00
Rob Orton f8950fc472 remove rails 2 scripts that no longer work
Change-Id: I6d93611421613d09aee01195d84625db67cb914d
Reviewed-on: https://gerrit.instructure.com/41776
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2014-09-26 16:09:30 +00:00
Cody Cutrer 65a620ed8e script/console is a rails 2 vestigial
and my fingers still want to type it. at least this will remove
it from my tab-complete

Change-Id: Id826cff0612c27bb54dc2c74925193b8f33a66cf
Reviewed-on: https://gerrit.instructure.com/41607
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-09-23 16:37:40 +00:00
Brian Palmer 5a9cae7d0f rails4: gemify delayed_job
closes CNVS-14275

While we're at it, fix all the rspec deprecation warnings.

test plan: delayed jobs should still work as before, including queuing,
viewing in the UI, and running.

Change-Id: I36c6b74aa2b59a99e4f1f36e25e6d0e9e153f92a
Reviewed-on: https://gerrit.instructure.com/41211
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2014-09-17 18:14:54 +00:00
Brian Palmer 7b2523fca1 fix double requiring of application.rb
This happens when script/rails is executed via a symlinked canvas
directory

Change-Id: I64fc408244ead13c3c78580c3b3e72102445df34
Reviewed-on: https://gerrit.instructure.com/40740
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-09-09 00:42:50 +00:00
Dave Donahue 25923e4ef9 fix canvas_update script sass compilation
We compile sass using npm run compile-sass now, but the
script was still referencing the old (now deprecated) rake
task, which was causing updates to fail.

Change-Id: Idbedcf61ccccbdb0f1deb5907afb25d5d6650000
Reviewed-on: https://gerrit.instructure.com/40392
Reviewed-by: Nick Houle <nhoule@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Dave Donahue <ddonahue@instructure.com>
QA-Review: Dave Donahue <ddonahue@instructure.com>
2014-09-02 19:54:03 +00:00
Ryan Shaw 1f292bf5db make sure compile-sass exists with non-zero exit code on fail
...and print a message of what went wrong

test plan:

write some bad syntax in a sass file,
run `npm run compile-sass`
it should exit with non-zero status code
it should tell you what line of css caused the error

Change-Id: I0febb3286f6100993d5d2d53083d6a53719cbedf
Reviewed-on: https://gerrit.instructure.com/39385
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Colleen Palmer <colleen@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2014-08-15 18:27:40 +00:00
James Williams 81558f728c remove rails 2 support
closes #CNVS-14261

Change-Id: I1b0e8a4438ab659ecd1ac8462bc3559d810989b3
Reviewed-on: https://gerrit.instructure.com/38744
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-08-06 18:16:19 +00:00
Ryan Shaw 485b90a6f7 replace compass with node-sass
after many steps towards this moment, we're finally here

This yanks sass and compass out of canvas-lms
completely and instead uses the libsass based
node-sass to compile our SASS files.

wins:

It is WAYYY faster!
as in, < 10 seconds to recompile all css in canvas
(compared to the 5+ minutes it used to take)

It is all in JS, helping use move to a completely
nodeJS based fronted tooling workflow.

next steps:

remove jammit: we don't need an assets.yml file
since node-sass can output compressed css for us
and we use sass to do all of our @import'ing of other
files (@colleen calls those "compiler" sheets), this
would simplify and speed up fronted asset building
even more

use gulp/broccoli/whatev to do cached, incremental builds

test plan:

all outputted css should look exactly the
same as it used to.

run `npm run compile-sass`, make sure it works
and is way faster than `rake css:generate` used to be

Change-Id: I7d865ea6b3e374cdc27a883d2019a4c15746c0e2
Reviewed-on: https://gerrit.instructure.com/38416
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2014-08-04 15:28:29 +00:00
Cody Cutrer 1a11457385 loosen up migration_lint for rails 3
allow rails 3 migrations

Change-Id: Id0bd7a0c5dcd7e2f228dbd8fda8a0bb17541c270
Reviewed-on: https://gerrit.instructure.com/38493
Reviewed-by: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-07-31 15:40:53 +00:00
Landon Wilkins cf0b220497 canvas update script
test plan:
* run `script/canvas_update`
* verify that the log output goes in /log
* verify that canvas was updated
* run `script/canvas_update -q` for QUICK_MODE
* verify QUICK_MODE's output is:

Quick mode enabled (assumes you have guard running and don't want to
generate docs)
Bringing Canvas up to date ...
  Log file is /Users/lwilkins/sandbox/canvas-lms/log/canvas_update.log
Updating plugin vendor/plugins/canvasnet_registration ...
Updating plugin vendor/plugins/instructure_misc_plugin ...
Updating plugin vendor/plugins/multiple_root_accounts ...
Pulling Canvas code ...
Checking your gems (bundle check) ...
Gems are up to date, no need to bundle install ...
Migrating DB ...
Installing npm packages ...
Tips:
  - 'bundle exec guard': auto-compiles JS files while developing
  - 'script/delayed_job run': run delayed jobs in the foreground

NOTE 1) if you see
  Gems are up to date, no need to bundle install ...
  then `bundle install` will not be run

NOTE 2) after running this command, you'll be on master branch,
  if you want to continue testing this script, checkout the
  branch you pulled down again.

Change-Id: I99c3097d452128d6fffa31d25e3b7e57a438555e
Reviewed-on: https://gerrit.instructure.com/37423
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Braden Anderson <braden@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2014-07-11 14:21:03 +00:00
Brian Palmer ce945a721b migration lint for instance vs class migration methods
self.up works in rails2 and rails3, but up only works in rails3+

also tag the switchman migrations as RAILS3 only, now that they actually
run in rails2

Change-Id: I768c8e657e86de6504a40444d127e2d875ce6934
Reviewed-on: https://gerrit.instructure.com/35390
Tested-by: Brian Palmer <brianp@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2014-06-05 15:55:55 +00:00
Raphael Weiner 5553f62357 extract incoming mail into gem
fixes CNVS-12182

test plan
- regression test on incoming mail
- use script/process_incoming_emails to manually trigger the processing
  of incoming mail

Change-Id: Iccd74d8fe2b5af3d5eefe25a2736273e3bf559b0
Reviewed-on: https://gerrit.instructure.com/32794
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2014-04-25 23:06:02 +00:00
Joseph Rodriguez 8554d5c894 moving mail processor to module
fixes CNVS-12174

Test Plan:
Regression test on incoming mail.

Change-Id: I3f5d131ce4a1f4408bf95a5455ffc4baa6bdc85c
Reviewed-on: https://gerrit.instructure.com/32716
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2014-04-25 23:05:39 +00:00
Joseph Rodriguez 45bb1107c2 inject instance of ErrorReport::Reporter into IncomingMessageProcessor
fixes CNVS-12150

QA Test Plan:
- regression test incoming mail (check error reports)

Change-Id: Ib25cf1ad78cb76db3da5d97cf6e33740e50d472d
Reviewed-on: https://gerrit.instructure.com/32679
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2014-04-25 23:05:13 +00:00
Joseph Rodriguez a8c90d61df Extract and inject incoming message handler
fixes CNVS-12145

QA Test Plan:
- regression test incoming mail
- ensure that reply to discussion topic works

Change-Id: Iae88aa6da5cfe79e51609e233c05e356feacc198
Reviewed-on: https://gerrit.instructure.com/32610
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2014-04-25 23:04:42 +00:00
Joseph Rodriguez d88a31330f convert class methods to instance methods for IncomingMessageProcessor
fixes CNVS-12129

test plan
- regression on incoming mail

Change-Id: Ia9ab3419201c9fdbd89e2483a3fde51f54c7f982
Reviewed-on: https://gerrit.instructure.com/32594
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2014-04-25 23:04:27 +00:00
Ryan Shaw 0b4e9fe5d8 make rake canvas:compile_assets a TON faster
...by parallelizing everything I could

fixes: CNVS-12362

`time bundle exec rake canvas:compile_assets`
(on my I7 2.3GHz macbook pro)
before: "322.56s user 26.62s system 173% cpu 3:21.05 total"
after: "425.91s user 30.71s system 413% cpu 1:50.35 total"

If you ever find yourself needing to run everything all
sequentially (and not in multiple threads), you can
set the environment variable CANVAS_BUILD_CONCURRENCY=1
by default it will use all the cores your system has

You're welcome, anyone that has ever had to build canvas
or wait for jenkins to run :)

Test Plan:
* run "time bundle exec rake canvas:compile_assets"
* checkout this code
* run it again
* verify that it is faster, and everything works

Change-Id: Ib01506bc9638e86f4a329284458706279ef751ab
Reviewed-on: https://gerrit.instructure.com/33127
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2014-04-17 19:47:17 +00:00
Aaron Shafovaloff 20f692c884 upgraded requirejs to 2.1.10
- upgraded raphaël to 2.1.2
- upgraded FileAPI to 2.0.4
- amd-ified files
- removed unnecessary shims
- removed "use!" usage
- removed "order" requirejs plugin
- using new shim configuration format
- replace deprecated require.resourcesDone with !window.requirejs.s.contexts._.defQueue.length
- using UglifyJS separate from r.js
- added keep_trying_until in selenium specs to fix timing issue
- fix race condition in take_quiz.js with .file-upload-question-holder

Change-Id: I8c205ef4c80115fa0cbd662c184490f1b9626336
Reviewed-on: https://gerrit.instructure.com/29683
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Tested-by: Aaron Shafovaloff <ashafovaloff@instructure.com>
2014-03-10 22:27:53 +00:00
Shawn Meredith 26464cde51 spec: rspec 2.13 parallelized_specs compatibility
Change-Id: I3600a84a6b7bde5bc6b25bfcd8ff448dfed4463f
Reviewed-on: https://gerrit.instructure.com/28736
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Shawn Meredith <shawn@instructure.com>
2014-01-16 23:08:30 +00:00
Cody Cutrer 2c8fb04e0a remove backcompat for custom migration extensions
Change-Id: Ia8f225574c0359fc0be13a7f667572d4baef9600
Reviewed-on: https://gerrit.instructure.com/25801
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-10-31 18:24:12 +00:00
Cody Cutrer b7b5042b2c rename transaction attribute to disable_ddl_migration!
for Rails 4 compatibility

Change-Id: I7dd48ef8cce10e9e15536eebf3e4ab5aee365a40
Reviewed-on: https://gerrit.instructure.com/25686
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-10-29 20:33:53 +00:00
Jacob Fugal b12791aa99 to_json unnecessary (and wrongish) in render :json
refs CNVS-7597

render :json => thing will call ActiveSupport::JSON.encode(thing) unless
thing is a String. ActiveSupport::JSON.encode(thing) just calls
thing.to_json but with some circular reference checking that we want. we
may also want enhance ActiveSupport::JSON.encode to do additional
processing, and calling to_json straight up would bypass that.

in the cases where we do need to do the structural transformation before
passing to render :json (e.g. because of need to pass arguments), use
as_json to do structural transformation only, vs. to_json that does
serialization of the as_json result.

adds a rake task to lint the controllers to enforce as_json over to_json
in render json calls.

test-plan: heavy regression testing; no end behavior should change
(except a pair of serialization bugs that got fixed)

Change-Id: I7a91a9fe0eca70456bc5bca233f0ed6b27a54aaf
Reviewed-on: https://gerrit.instructure.com/23650
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-10-02 18:05:22 +00:00
Cody Cutrer 2deb504378 useful find_each
* automatically does with_exclusive_scope
 * if the scope has an order or group by, use an alternate
   implementation so it's not broken
 * alternate methods are cursors (postresql only) or temporary
   tables. if a transaction is already open, or we're on a slave,
   prefer a cursor (even over the normal method, since the query
   might be slow even without an order or group by)

test plan:
 * migrations should still work (especially data fixups)
 * lots of account reports use find_each; make sure they still run

Change-Id: If876b7b3401e6cda1d41f1c94b93af4810b78cf4
Reviewed-on: https://gerrit.instructure.com/22364
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-07-18 22:26:46 +00:00
Stanley Stuart 42888839b1 remove unused cucumber script runner
Change-Id: I391010689a6488c49a75eaef586783793fc29613
Reviewed-on: https://gerrit.instructure.com/20889
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
QA-Review: Stanley Stuart <stanley@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-05-23 22:44:42 +00:00
Cody Cutrer 9d9a110f07 make discussion_topic_materialized_view.discussion_topic_id a true primary key
also added a warning to migration_lint about tables with no primary keys

test plan:
 * run the migration; it should not fail

Change-Id: I67a065355bb516b84b00313725f079842bbd8974
Reviewed-on: https://gerrit.instructure.com/20705
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-05-21 16:58:52 +00:00
Brian Palmer 31f33164b5 remove 1.8 compatibility shims
- update the Gemfile to be 1.9 only, and raise an exception on wrong
  ruby version
- remove RUBY_VERSION checks, replacing with the applicable code
- remove the FasterCSV compatibility shim, just use CSV now

test plan: trying to bundle install on ruby 1.8 or 2.0 should raise an
exception, specs should pass, canvas should work as normal on 1.9

Change-Id: I49088e9d227c59c6d5d5acb417c2df971129474a
Reviewed-on: https://gerrit.instructure.com/19806
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-05-03 01:43:52 +00:00
Jon Willesen d8efd3e805 improve robustness of incoming message processor
replaced the mailman gem with custom code with more error
handling. this will allow the incoming message processor to
continue processing messages after encountering a message with
an encoding or parsing error. the broken messages will be moved
aside to a separate folder for later inspection.

fixes CNVS-4970

test plan:
 - read up on the new incoming_mail.yml configuration settings.
 - configure incoming_mail.yml with the test imap accounts
   using legacy settings and check for regressions.
 - reconfigure incoming_mail.yml to read from a directory.
 - copy some testing email files into the configured directory.
   test files should be a mix of:
   - emails with encoding errors
   - emails with syntax errors
   - normal emails
 - all of the normal emails should be processed normally
 - all of the error emails should be moved into the error
   subdirectory

Change-Id: I0f946a56b41492f007db2775aa6da3cdfa4fdd3f
Reviewed-on: https://gerrit.instructure.com/19729
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-04-29 14:47:09 +00:00
Cody Cutrer 8e9599757e migration_lint!
Change-Id: I0c0e12e0aa6401e15cf52915f1fdebe82686a0bf
Reviewed-on: https://gerrit.instructure.com/19837
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-04-22 15:22:32 +00:00
Brian Palmer cb5e957965 start adding rails 3.0 support
This can successfully load rails console and rails server. There are
many, many problems still. The idea is this won't change anything under
rails 2.3, it's all backwards compatible.

closes CNVS-4711

test plan: `touch RAILS3` in your Canvas Rails.root directory. The run
`bundle update` and verify that you get rails 3 installed. Run `bundle
exec rails c` to load console or `bundle exec rails s` to start a
webrick server. You can login, though the dashboard currently breaks.
Also jammit isn't working yet.

But more importantly, Rails 2.3 should still work same as ever. All
tests should pass, and a basic regression sanity check would be good too.

Change-Id: Idd6f35de88adde84cd2db3a650f44b71bd6e9684
Reviewed-on: https://gerrit.instructure.com/18453
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-03-22 19:08:40 +00:00