Commit Graph

8 Commits

Author SHA1 Message Date
Brian Palmer 554789efbf fix the CanvasHttp::Error superclass
It was inheriting from Exception, so the rescue clause in
external_feed_aggregator.rb wasn't catching it, causing the entire
ExternalFeedAggregator.process job to fail.

Looking at the other uses of CanvasHttp, I see no reason to believe that
this was intentional.

closes CNVS-21213

Test plan: as mentioned above the problem here is that when an
ExternalFeed throws this error, it was not being caught properly and so
all external feeds afterwards in the queue would not be processed.  In
order to recreate these conditions we need a feed that fails and then we
need to make sure there are more feeds afterwards in the queue.
- First add a valid rss external feed.  We'll use this just to make sure
  the system is working.
- Then add a url (doesn't even have to be to an rss feed) that redirects
  more than 3 times before resolving.  This will trigger the redirect
  error, that was causing the problem.  You can verify if a url will break
  by running CanvasHttp.get('http://broken.redirects') in a rails console
- Then add another valid rss feed.  This will be the one that comes
  after the broken one, and it working successfully is what we're
  looking for.
- The system loads feeds to check in order of a "refresh_date" which is
  initially set to the time they were created, and then reset to the last
  time they were updated. This is why the order of creation is important
  above, because we'll create a refresh order that has a valid feed after
  a broken feed.
- The feed import system is set up to ignore rss entries that were
  created before the feed object was created. To get around this, you
  can manually update the created_at time of these objects.  Find a time
  that is before the last entry in the two valid feeds, and run:
    `ExternalFeed.update_all(created_at: 6.hours.ago)`
- Finally we're set, just run this in the console, to simulate the
  delayed job that runs:
    `ExternalFeedAggregator.process`
- And ensure that new entries from both the first and third feeds are
  imported.

Change-Id: If60158719d1b618c1e706ea0d056bc6b08f87457
Reviewed-on: https://gerrit.instructure.com/53494
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2015-06-17 14:44:40 +00:00
Paul Hinze 071d6d8a96 align rspec version in gems with parent
update spec_helpers to fix deprecation warning after upgrade

Change-Id: I31b370d1d60f73d5256c69a8d5e69418657f880d
Reviewed-on: https://gerrit.instructure.com/39144
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Paul Hinze <paulh@instructure.com>
QA-Review: Paul Hinze <paulh@instructure.com>
2014-08-12 22:27:39 +00:00
Brian Palmer 0a71091080 determine canvadocs http/https based on url
This is common functionality, so I pulled it out into the canvas_http
gem.

test plan: a canvadocs config using an http:// url should work, as well
as https:// urls which already worked.

Change-Id: I640445bfcf9b5c903d37aeb9db6c566430e2113d
Reviewed-on: https://gerrit.instructure.com/36760
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
QA-Review: Cameron Matheson <cameron@instructure.com>
2014-06-24 15:26:18 +00:00
Cody Cutrer 92ea7c5be5 bundle check before bundle install for gem tests
they're likely already installed, and it will save a ton of trips
to rubygems.org

Change-Id: I9ccf2194619a6e8f97d7f21b4e232dac7ff20d3c
Reviewed-on: https://gerrit.instructure.com/35694
Reviewed-by: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-06-03 20:09:10 +00:00
Shawn Meredith e6de56a029 spec: vendored_gems pin rspec versions
Change-Id: Ibad1c172e58a69eb3a5a9ff2c874e861086ae227
Reviewed-on: https://gerrit.instructure.com/35756
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-06-03 14:54:02 +00:00
Simon Williams dc3b16f9bf add gem names to gem script runners
Change-Id: I0dad5345aae75e552af97f5b54ded10bbfebbe37
Reviewed-on: https://gerrit.instructure.com/33925
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2014-04-28 15:51:28 +00:00
Brad Humphrey b9bdfaf8c9 limit temp file name length when upload files via url
Test plan
 * Upload a file using the url file upload api with a 500+ character name
 * It should upload

Change-Id: I19ad272c1f5702ee5bc3c369060b3f6cea4077d7
Reviewed-on: https://gerrit.instructure.com/32890
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
2014-04-07 15:20:57 +00:00
Joseph Rodriguez ccd8b38d6a Extract canvas_http into seperate gem.
Change-Id: Ib90c12b99d30853a0a1a0235c9aa1b5dd645f614
fixes: CNVS-11949
Reviewed-on: https://gerrit.instructure.com/32176
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
QA-Review: August Thornton <august@instructure.com>
2014-04-02 17:22:38 +00:00