Commit Graph

18 Commits

Author SHA1 Message Date
Simon Williams ad4938f565 catch more errors for external feed failure
when I ran through the loop against canvas production data, I ran into
a couple additional errors.

fixes CNVS-21542

test plan:
- try adding an external feed to a port that doesn't exist, like
  localhost:9999
- add valid external feeds before and after that invalid one
- the valid feeds should still import, even though the invalid one will
  fail

Change-Id: I4d0ef178ce18b9675d5138f3800dc9109fc97499
Reviewed-on: https://gerrit.instructure.com/57310
Tested-by: Jenkins
Reviewed-by: Benjamin Porter <bporter@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2015-07-06 14:10:14 +00:00
Simon Williams 2acf92b81d don't send external feed fetch errors to sentry
we already handle external feed errors by incrementing a counter of
consecutive failures and only continuing to poll feeds with
< 5 consecutive errors.

fixes CNVS-20369

test plan:
- basic regression test of external feed functionality

Change-Id: I8d41729a4321bdacbb7ffa8a58495a1cafc0de48
Reviewed-on: https://gerrit.instructure.com/53833
Tested-by: Jenkins
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Adam Stone <astone@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2015-06-22 17:20:55 +00:00
Strand McCutchen 1a24af8e53 fix Lint/StringConversionInInterpolation issue
Change-Id: Ibea00b023aa91e4f4a627161fbe87dbb54d22daf
fixes: CNVS-20009
Reviewed-on: https://gerrit.instructure.com/52884
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: Strand McCutchen <smccutchen@instructure.com>
QA-Review: Strand McCutchen <smccutchen@instructure.com>
2015-04-27 20:53:25 +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
Simon Williams acc58fa712 allow external feed urls to be https
instead of rolling our own request feed method, just use CanvasHttp,
which already supports https urls

fixes CNVS-17680

test plan:
- go to the course announcements page, add a feed with an https url
- in the console, set it's created_at to before the last post from the
  feed
- run `ExternalFeedAggregator.process`
- it should work, creating a new announcements for the post

Change-Id: I43c48e3520a2129aad91e55ffa7aa8aa82e8814a
Reviewed-on: https://gerrit.instructure.com/46322
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Sean Lewis <slewis@instructure.com>
Tested-by: Jenkins
Product-Review: Simon Williams <simon@instructure.com>
2015-01-23 20:03:49 +00:00
Simon Williams b10f626dde remove unused external feeds columns
external feeds have three columns that really aren't adding any value

* body_match: never used anywhere in the code, always nil in the
  database
* feed_type: always 'rss/atom' (built to handle ical, but never used)
* feed_purpose: always 'announcements' (build to handle calendar_events,
  but never used)

closes CNVS-17581

test plan:
- create an external feed on the announcements page
- wait for the rss feed to post a new story and the aggregator to run,
  OR, in a rails console:
  * set the created_at date on the external feed to before the last
    posted entry, something like
      ef = ExternalFeed.last
      ef.created_at = 5.days.ago
      ef.save!
  * run the external feed aggregator, like so:
      ExternalFeedAggregator.process
- it should create an announcement for the blog post from that feed

Change-Id: I74deffbdaaa1e217f8eefbdfd1000d50c2406cb1
Reviewed-on: https://gerrit.instructure.com/45990
Reviewed-by: Joel Hough <joel@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2015-01-07 23:36:18 +00:00
Cody Cutrer 0434a78850 do some preloads in ExternalFeedAggregator
this vastly improves performance when a root account has been deleted

also fix problem where skipped courses would cause the loop to run
indefinitely

Change-Id: I9c8ae5b1901abe5f59f3011ec8f433f06d7671b9
Reviewed-on: https://gerrit.instructure.com/44654
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-11-19 23:18:44 +00:00
Cody Cutrer 413f350a28 avoid a transaction (even on the slave) processing external feeds
fixes CNVS-16468

Change-Id: I1c5afb3351340e1cf8580143f1b722830a757412
Reviewed-on: https://gerrit.instructure.com/43332
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-10-27 21:13:45 +00:00
Cody Cutrer e79632e8a6 ensure ExternalFeedAggregator doesn't choke through pgbouncer
refs CNVS-15875

Change-Id: I2ac0b7ddf350b08486ad0ea4cf03e3715cc1f39a
Reviewed-on: https://gerrit.instructure.com/43182
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-10-23 21:22:03 +00:00
Brian Palmer 5dce4d2660 fix external feed iteration through bouncer
Change-Id: Ia4798b064d845efe9a134e1e2125d80826157b61
Reviewed-on: https://gerrit.instructure.com/39946
Reviewed-by: Cody Cutrer <cody@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 03:42:53 +00:00
Brian Palmer 5039dd79b9 don't load all external_feeds into memory at once
Change-Id: Ia83d96b781b679907000ae1db33b60afbd7461df
Reviewed-on: https://gerrit.instructure.com/39859
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2014-08-24 19:06:36 +00:00
Zach Pendleton 0fe154f15e remove import and external_feed_id from calendar_events.
removed unused code to import an ical feed into a calendar,
and dropped the external_feed_id from the calendar_events
table because it isn't being used.

Change-Id: I9c093f4f2f63cc503d74bfc1cde089bf24ea0d73
Reviewed-on: https://gerrit.instructure.com/19615
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Eric Berry <ericb@instructure.com>
QA-Review: Zach Pendleton <zachp@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-04-22 22:19:00 +00:00
Brian Palmer 77ca8ac013 remove deprecated rails constant usage
basically convert RAILS_ROOT -> Rails.root , RAILS_ENV -> Rails.env ,
RAILS_DEFAULT_LOGGER -> Rails.logger

This is necessary for rails 3

Change-Id: I138e1aa217fa8fb186d23ac09b04031c1e2b665e
Reviewed-on: https://gerrit.instructure.com/18412
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Eric Berry <ericb@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2013-03-11 12:14:08 -06:00
Cody Cutrer 7b8dd548d3 a few more things to skip for deleted root accounts refs #6891
Change-Id: Id56c0f9a157734483fad29ffd95b9ea146ff1002
Reviewed-on: https://gerrit.instructure.com/13060
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-08-21 13:49:23 -06:00
Cody Cutrer bdbebfaec8 check all models for protecting attributes refs #3847
Change-Id: I7cba6e26ad98e91723e2ccf0a28b8db79bb37b5c
Reviewed-on: https://gerrit.instructure.com/3631
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-05-25 17:38:50 -06:00
Brian Palmer b657f4e959 generate an error report for all errors, not just some of them
refs #4487

This consolidates our ErrorReport class with our ErrorLogging mechanism,
it's all in ErrorReport now and you call ErrorReport.log_error or
ErrorReport.log_exception to both create an ErrorReport object, and call
the hooks similar to what ErrorLogging did so that plugins for other
error handling mechanisms can be injected.

ErrorReport has a category field now, similar to how ErrorLogging used
to take a type. the /error_reports UI can filter by category.

The plugin interface was designed with Hoptoad integration in mind, but
it should be pretty general.

Change-Id: I59f7a0d44cf4b6215ad13ff92d30e1d1af607b74
Reviewed-on: https://gerrit.instructure.com/3577
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-05-11 10:36:56 -06:00
Brian Whitmer 8b8173dcc9 Initial commit.
closes #6988138
2011-01-31 18:57:29 -07:00