Commit Graph

56 Commits

Author SHA1 Message Date
Cody Cutrer 0415279fe6 expose installation uuid in health_check
refs CNVS-24699

test plan:
 * go to /health_check.json
 * it should include an installation_uuid

Change-Id: I4eedd51ccee7a5cdcd15df4af30443ff9fa01145
Reviewed-on: https://gerrit.instructure.com/66219
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
2015-11-06 04:37:36 +00:00
Derek Bender d6eaed579f create ProvisionalGrade table and model
- extracted some shared behavior between submissions and provisional grades
- improved organization in submissions

refs: CNVS-22006
Change-Id: I4207893362e4548d1d76d066322f3b333357807a
Reviewed-on: https://gerrit.instructure.com/59643
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Derek Bender <dbender@instructure.com>
2015-08-07 17:12:37 +00:00
Cody Cutrer fcd944d600 explicitly reference functions from extensions in their correct schema
fixes CNVS-21362

test plan:
 * make sure you have pg_collkey installed
 * test user search
 * it shouldn't asplode

Change-Id: I911d57ea950679b3e26390c140149c528eae0a2d
Reviewed-on: https://gerrit.instructure.com/56969
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2015-07-13 23:02:57 +00:00
Derek Bender bbbb9b1e54 use more robust require_dependency
per cody cutrer's request.

Change-Id: Ifb9b9a7ad6084fcc40b0f0bbfd0d99febc05ca9e
ref: CNVS-21552
Reviewed-on: https://gerrit.instructure.com/57607
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Derek Bender <dbender@instructure.com>
QA-Review: Adrian Foong <afoong@instructure.com>
2015-07-02 20:17:35 +00:00
Derek Bender 1d732eb542 fix spring reloader on DraftStateValidations
previously, when using `bin/spring`, often the error
`Expected <snip>/lib/canvas/draft_state_validations.rb to define
Canvas::DraftStateValidations` would come up when modifying application
code (not spec code). The only away around this problem would be to issues
a `bin/spring stop` command. The problem appears to be a Rails loading
convention that canvas wasn't respecting so this commit attempts to
correct this issue so that spring no longer blows up on a regular basis.

Change-Id: Icd44f4dceb75dc965f0c9a50b500f505c82cd15b
Fixes: CNVS-21552
Reviewed-on: https://gerrit.instructure.com/57319
Tested-by: Jenkins
Reviewed-by: Dylan Ross <dross@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Product-Review: Derek Bender <dbender@instructure.com>
QA-Review: Adrian Foong <afoong@instructure.com>
2015-07-02 15:27:37 +00:00
Cody Cutrer 0e1e3748eb avoid a stack frame in timeouts
Change-Id: Ie664ccae56af13feafff60564192d8557bca7fbe
Reviewed-on: https://gerrit.instructure.com/54525
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-05-19 16:20:13 +00:00
Cody Cutrer a9f8e81b54 refactor account authorization configs into per-auth type classes
test plan:
 * basic smoke test configuring and using non-Canvas authentication

Change-Id: I45b5fda173a400d9eebb04d17d979e798d297c38
Reviewed-on: https://gerrit.instructure.com/50864
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2015-04-28 15:17:59 +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 486b03af76 share redis cache and redis data connections if possible
had to change the level that marshalling is disabled for the data
redis so that marshalling can be enabled for cache

test plan:
 * configure redis.yml
 * configure cache_store.yml for development/production to be
   cache_store: redis_store and nothing else
 * open console
 * Canvas.redis.set('a', 1); Canvas.redis.get('a') should return
   "1" (as a string)
 * Rails.cache.write('a', 1); Rails.cache.read('a') should return
   1 (as a Fixnum)
 * Canvas.redis.__getobj__.object_id should be the same as
   Rails.cache.instance_variable_get(:@data).object_id
 * netstat -an should show only one connection from your console
   process to the redis server
 * with an already populated cache (having used Canvas before
   applying this commit), click around Canvas, and make sure
   nothing breaks

Change-Id: I507b95af3ec35f65501bb61e428a3e8479b8f895
Reviewed-on: https://gerrit.instructure.com/48134
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2015-02-04 16:00:03 +00:00
Jacob Fugal fda30aa841 drop unused Canvas.cache_store_config method
refs CNVS-9546

Change-Id: I8d62c8b9c93d49ad0b987b0cdef1aa21093971b6
Reviewed-on: https://gerrit.instructure.com/28442
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-01-23 20:22:58 +00:00
Jacob Fugal 8d29be0dc6 fixes for plugins in gems/plugins/
fixes CNVS-15130

allows access to a plugin's models (during truncation for specs),
migrations, assets, periodic jobs, prepended routes, api routes (during
documentation), flagging as reloadable, spec docs, etc. once the plugin
lives in gems/plugins/ instead of vendor/plugins/

Change-Id: Ia7a2fdf5ad6258c5de962e982b6bf62ebaf4d075
Reviewed-on: https://gerrit.instructure.com/42287
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2014-10-29 16:52:29 +00:00
Cody Cutrer 4b38652108 remove unused config option
especially since we don't use dynamic finders anymore

refs CNVS-15126

Change-Id: Idba2142a8b4559ddf7932e5f155d4744f30c7c19
Reviewed-on: https://gerrit.instructure.com/41280
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-09-18 16:21:12 +00:00
Brian Palmer 6666663076 rails4: upgrade redis-store and friends
fixes CNVS-15414

This applies to rails3 as well, we just use the appropriate version of
redis-rails for each.

test plan: redis should work as before, for both cache and data.

Change-Id: Ic34729190936a133b908e31ff186934fa435c1b6
Reviewed-on: https://gerrit.instructure.com/40898
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-09-11 16:31:52 +00:00
Cody Cutrer 061d60899e configurize possible postgres extensions
Change-Id: I57bf7eebf4a9f5a828dffb3d4b689b6cac9aa0f0
Reviewed-on: https://gerrit.instructure.com/40197
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-08-28 22:02:22 +00:00
Brian Palmer d6c9d87f76 add the canvas version to delayed_jobs_pool proc name
test plan: with a VERSION file in your rails root, run delayed jobs, the
process name will include the contents of the VERSION file. with no
VERSION file, it won't.

Change-Id: I773ff4ace5facdb48d415ad7528daaf761aeab1d
Reviewed-on: https://gerrit.instructure.com/40162
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2014-08-28 18:25:49 +00:00
Brian Palmer 7d1e9e81b1 skip redis initialization if no servers specified
matches behavior of memcache block above

Change-Id: I0baba8d2b55c362403a9e1d3e9499c022c8b039c
Reviewed-on: https://gerrit.instructure.com/39975
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2014-08-26 20:30:12 +00:00
Cody Cutrer 7ef41ca038 allow sharing cache_store configs between database servers
(switchman handles the details)

test plan:
 * in cache_store.yml, have something like:

oneoff:
  cache_store: redis_store

development: oneoff

 * launch rails console in development mode; Rails.cache should be a redis store

Change-Id: Ie12e655264b1f8c4a5df6ef31cf84d12cc913eb6
Reviewed-on: https://gerrit.instructure.com/39923
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-08-26 20:09:38 +00:00
Brian Palmer 3d7c964d07 support redis timeout option for cache and data conns
test plan:

- add a `timeout: 1` option to redis.yml
- confirm that rails cache and redis operations complete as normal
- to test timeout, you can set up a dummy tcp server that listens but
  never accepts, add it to the redis config, and verify that the (first)
  redis operation times out as expected. after the first, it'll be
  blacklisted for 5m as usual.

Change-Id: I2494b4b319afffcf1ea6ab87eb1c3d7d3baec58b
Reviewed-on: https://gerrit.instructure.com/39895
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2014-08-26 00:08:05 +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
Simon Williams 60936919a2 refactor Canvas.timeout_protection in preparation for gemification
closes CNVS-13444

test plan:
- specs should pass
- external services (like turnitin or crocodoc) should still work

Change-Id: I223320f8c6b0dafd79d6e47fbdaedfb6300dc512
Reviewed-on: https://gerrit.instructure.com/35939
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-06-14 04:09:46 +00:00
Cody Cutrer 8178266194 split yaml file loading out of Setting
refs CNVS-13024

Setting wasn't properly being initialized as unsharded because
it was loading before Switchman. The reason we need Setting before
switchman is just for yaml loading, so split that into its own
class.

Change-Id: I5456e103cb216dba2d5af4e9c20a697b468c923b
Reviewed-on: https://gerrit.instructure.com/35043
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-05-21 18:27:06 +00:00
Jacob Fugal b5de4b72fb sanity check cache_store.yml and warn of misconfig
test-plan:
 - create a cache_store.yml that's not a hash
 - try to boot canvas, get an appropriate error
 - create a cache_store.yml with non-hash values for the top level keys
   (e.g. entire file is "cache_store: redis_store")
 - try to boot canvas, get an appropriate error

Change-Id: I4e8965a61c11c64e1d81894e8ae316761ac12f1b
Reviewed-on: https://gerrit.instructure.com/29663
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
2014-03-05 18:48:19 +00:00
Jacob Fugal ea3af32b50 gracefully handle absence of cache_store.yml
test-plan:

 - don't have a config/cache_store.yml
 - try and boot canvas

Change-Id: I58ceca7bc3b618421e7d66987bbd18b2646babf4
Reviewed-on: https://gerrit.instructure.com/29582
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2014-02-04 23:03:40 +00:00
Jacob Fugal c7ef846e86 update cache_store initialization
refs CNVS-9546

for rails2, when using multiple environment-conditioned caches,
middleware must be inserted for each cache. so we need to instantiate
them and manage the middleware at boot. adjust accordingly

for rails3, we're using switchman and switchman has been updated to
manage this for us. we just need to give it the full cache configuration
map up front.

also changes the default for Canvas.cache_store_config's second
parameter to true, extracting the nil_is_nil=false behavior into the
fallback value for Rails.env in the new Canvas.cache_stores method. the
only remaining callers of this method are in some plugins which passed
an explicit true value for that parameter. once those plugins are
updated to access Canvas.cache_stores directly,
Canvas.cache_store_config will be removed.

Change-Id: I80eb09679303f2778a6ddc9ab476e695a6754465
Reviewed-on: https://gerrit.instructure.com/28441
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
2014-02-04 15:55:46 +00:00
Jacob Fugal d53ff776c7 only use homebrew NilStore with rails2
refs CNVS-4704

we can use the built in :null_store with rails3

Change-Id: I0dc6c441da4f300fe8ee870b8c676c8e449d1830
Reviewed-on: https://gerrit.instructure.com/26332
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
2013-11-19 19:46:08 +00:00
Cody Cutrer c0b8e3babe don't shell out to ps in specs
avoids warnings about DYLD_ env vars if you have those set

Change-Id: If3a5ea88727a64fa61dd7591a82f445b7491b042
Reviewed-on: https://gerrit.instructure.com/25833
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-10-30 20:56:35 +00:00
Cody Cutrer d935ab98b1 deprecate Setting.get_cached
now that we have SIGHUP, we were changing everything to it anyway,
so just let caching in-proc be the default

Change-Id: Id1b44722522ac9693b17695da7107c99a359d5ac
Reviewed-on: https://gerrit.instructure.com/25020
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>
2013-10-10 00:42:52 +00:00
Brian Palmer 4becc9391c don't update the service timeout again if we're over the limit
refs CNVS-8371

test plan:
* trigger 3 ldap timeouts, see test plan in c17f3570bd
* you'll be blocked from further ldap attempts for 1 minute. after that
  minute passes, verify that canvas starts making ldap attempts again.

Change-Id: I8ac6b74bd75f6f3e18deaf3a1fabd01fb867c26e
Reviewed-on: https://gerrit.instructure.com/25047
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-10-05 19:14:45 +00:00
Brian Palmer c17f3570bd use the now-standard timeout_protection for ldap binding
The previous code was a one-off written before timeout_protection
existed. This means that we'll now allow N timeouts (3 by default) in
the given period, rather than refusing to connect to the LDAP server
after just one timeout.

closes CNVS-8371

test plan:

* Configure an account to use ldap. Rather than setting up a real ldap
  server, it's sufficient for this testing to just use nc or another
  application to listen on the port you specify in the account config.
* Attempt to login to the account, and see canvas in your nc output.
  Allow it to timeout. Attempt again, and canvas will hit your "ldap
  server" again. After 3 timed out attempts, canvas will blacklist your
  server for 1 minute.
* Also verify that logging in with ldap still works against a real ldap.

Change-Id: I60293d01690be3cc24f57b8bcd5c6c52e23fc2a9
Reviewed-on: https://gerrit.instructure.com/24657
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>
2013-10-03 22:18:16 +00:00
Jon Willesen 3a4c1c24fd add timeouts to incoming message processor
incoming message processor should not wait indefinitely on
external connections. it now implements timeouts on external
connections that are controlled by the Canvas.timeout_protection
method. It uses incoming_message_processor as the serivce name,
which makes these meaningful settings to change the timeout
behavior:
 - service_incoming_message_processor_timeout
 - service_incoming_message_processor_cutoff
 - service_incoming_message_processor_error_ttl

fixes CNVS-8198

test plan:
 - see the incoming message processor wiki page for instructions
   on how to do the configuration and run these tests.
 - create a fifo in an empty directory, configure
   incoming_mail.yml to read from the directory, run
   script/process_incoming_emails and make sure it exits in
   30 seconds or so.
 - use nc -l <port> to listen on a port, configure
   incoming_mail.yml to access that port on localhost, and run
   script/process_incoming_emails and make sure it exits in
   30 seconds or so.
 - run script/process_incoming_emails against an actual email
   account and make sure it can still process emails normally.

Change-Id: I23c67c1e8c0581a1e6ca69ab2c7b8855090688d1
Reviewed-on: https://gerrit.instructure.com/24483
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
Product-Review: Jon Willesen <jonw@instructure.com>
2013-09-25 16:47:02 +00:00
Brian Palmer 5cd9b153d4 include canvas revision in health_check json response
test plan:

curl -H 'Accept: application/json' http://<domain>/health_check

If you have a VERSION file in your canvas dir it'll report that
version, otherwise "Unknown"

Change-Id: I43c72140541ea441d4ec96a4c179d8db775843b7
Reviewed-on: https://gerrit.instructure.com/24595
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-09-23 19:53:08 +00:00
Brian Palmer 2059907654 integrate memory/cpu stats gathering with RequestThrottle
This data will be needed for throttling abusive users based on cpu + db
usage.

refs CNVS-7008

This also replaces Canvas.sample_cpu_time with just using Process.times,
which works cross-platform and is likely faster.

test plan: specs, and you can verify that the STAT line is still being
logged to the rails log and the statsd messages are still being sent
over UDP if statsd is enabled

Change-Id: I6a5aac389e6de9caa12751d57532f32464acaeca
Reviewed-on: https://gerrit.instructure.com/23499
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-08-21 16:59:01 +00:00
Brian Palmer fc22e21830 remove redis.pipelined usage
Unfortuanately the current ruby redis gem doesn't support pipelining
with a redis cluster, even if all the commands are acting on the same
key. Since we're working on turning the data redis into a cluster, these
have got to go.

test plan: specs should cover all this. could also do a quick regression
test on failed logouts (shouldn't error, should still limit failed login
attempts)

Change-Id: Ifa950268416e9086b72610914d7efc8a816d628b
Reviewed-on: https://gerrit.instructure.com/23457
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-08-19 20:33:45 +00:00
Duane Johnson f100d205f3 refactor redis config loading
Refs CNVS-5333

Change-Id: Ie5104082a70604660537aa707ca012d055705150
Reviewed-on: https://gerrit.instructure.com/20514
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Duane Johnson <duane@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
2013-05-23 19:04:35 +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
Cody Cutrer 39baee8b69 remove TEST_ENV_NUMBER hardcoding in config files
instead, you should be putting ERB in the config files

Change-Id: I75ddb75a77a6c7192583dd5eec88f4686d869e48
2013-03-05 15:02:31 -07:00
Shawn Meredith 2944785514 redis config fix automation
Change-Id: Ib1d99a1e15ff948ee7a0be5bd0c898b9acc882f4
Reviewed-on: https://gerrit.instructure.com/16123
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Jake Sorce <jake@instructure.com>
2012-12-18 11:13:02 -07:00
Cody Cutrer c1a08e7119 generate safe file urls relative to the shard of the files domain
allows it to be a different shard than where the file is. I had
to remove type casting from dynamic finders that don't know how
to deal with non-integral global ids.

also cache s3 urls on the same shard as the attachment

test plan:
 * have multiple shards and S3 storage
 * have a single safe files domain
 * you should be able to upload and download files in all shards
 * verify that it's going against the files domain, not the normal
   domain

Change-Id: I2b498fc1df20d5b43bf20f702580451621eeaf6a
Reviewed-on: https://gerrit.instructure.com/15158
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-11-12 09:17:37 -07:00
Brian Palmer c25465506a redis jobs backend
This supports all the features of our current delayed jobs backend,
including priorities, queues, jobs scheduled for the future, strands,
periodic jobs, etc.

Atomicity is guaranteed by using the new Lua scripting features of Redis
2.6, so this requires 2.6 (which is still only a release candidate as of this
time).

It's not yet production ready (see the TODO at the top of the
redis/job.rb file), so trying to start canvas in prod with redis jobs
configured will raise an error as a safeguard.

The tests have been modified to all pass with redis configured as the
jobs backend. Some selenium specs were removed because the jobs UI lost
some functionality that I didn't think was important enough to port to
redis (listing the most popular tags for future and failed jobs, for
example).

Change-Id: Ie57b15bae1d4ba7b2b2344c872411165551d1ac8
Reviewed-on: https://gerrit.instructure.com/12120
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-09-19 08:50:11 -06:00
Brian Palmer 45fa50d156 fix passenger redis connect
Change-Id: I57033b09969beaac8001c147dbdd22b59fea6bcd
Reviewed-on: https://gerrit.instructure.com/13603
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
2012-09-10 17:40:48 -06:00
Cody Cutrer 72f298bf46 a little more flexibility with cache_store config refs #10114
no user visible change

test plan:
 * smoke test with and without caching configured

Change-Id: Ia21a996988021d647e56f85cd8ce818b64001681
Reviewed-on: https://gerrit.instructure.com/13248
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-08-28 10:55:26 -06:00
Brian Palmer 9ff857f5b0 link_data endpoint for canvas collections
Canvas will use this to pull the data about a link before creating a
collection item (currently uses embed.ly)

test plan: not possible to test this through the UI yet

Change-Id: Ie248be4081871aa3aa747510d96edc3c7cc3a0a6
Reviewed-on: https://gerrit.instructure.com/10777
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
2012-05-21 10:35:31 -06:00
Brian Palmer 2b5cbcb73f handle redis failure on forking reconnect
test plan: run canvas through passenger and give it a bad IP for the
redis box, verify it can spin up new processes

Change-Id: I7d847da1c290261f89cbf2d792c875eefd20fe2c
Reviewed-on: https://gerrit.instructure.com/10551
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-05-04 11:25:04 -06:00
Brian Palmer 24514f54e0 Canvas.revision
and display the revision on /plugins

test plan: without a VERSION file, visit /plugins and see the "Unknown"
displayed. With a VERSION file, visit /plugins and see the first line of
that file displayed.

Change-Id: I0bcb3c855c70ba444158e17302eadab317dffb02
Reviewed-on: https://gerrit.instructure.com/9197
Reviewed-by: Brian Palmer <brianp@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2012-03-19 18:03:29 -06:00
Brian Palmer 3cd842817a reconnect redis when in passenger smart spawning mode
Change-Id: I125616609ef15354e324cc8c1bc971c6bc4a2620
Reviewed-on: https://gerrit.instructure.com/9322
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2012-03-09 10:21:55 -07:00
Brian Palmer a411f71755 add the wiziq web conference plugin
test plan: enable the plugin in /plugins, enter your creds, and start a
wiziq conference. teachers should be able to launch the conference, and
multiple students should be able to join.

closes #5738

Change-Id: I609542a0b13271e85dc18ff8b82ad6714736cc72
Reviewed-on: https://gerrit.instructure.com/8160
Tested-by: Brian Palmer <brianp@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2012-02-03 13:48:20 -07:00
Brian Palmer 39dc3f9cf0 use the redis data instance rather than rails cache for oauth codes
Change-Id: I882dc9fb4ad14388e8cae4e129e7175f3f140087
Reviewed-on: https://gerrit.instructure.com/4990
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-08-10 13:10:49 -06:00
Brian Palmer e6800c8b6a fix initialization of redis-cache cache store
The current version of redis-cache takes only the list of servers, it
doesn't support other config options like key prefix or database number.

Change-Id: If233c46d77b58650627dda75d7a8e1f2f212eb7f
Reviewed-on: https://gerrit.instructure.com/4801
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-07-25 16:35:29 -06:00
Brian Palmer 630200c32e support redis as well as memcache for a rails cache store
closes #4498

Change-Id: Icf29882d8c0d351574496ba0494c1d8c518a3e7f
Reviewed-on: https://gerrit.instructure.com/4580
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-07-20 14:59:03 -06:00
Brian Palmer 8564b1db63 optionally track completed job stats in redis
Right now this is just a data dump, pretty much.

Change-Id: I401cef17e2129556d99ca0a6547ae52712915650
Reviewed-on: https://gerrit.instructure.com/3970
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-06-01 10:58:37 -06:00