upgrade to aws-sdk v3

Change-Id: I52ed6d98b70cac11f3004789fb750ace79c5a0d8
Reviewed-on: https://gerrit.instructure.com/110693
Reviewed-by: Tyler Pickett <tpickett@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
This commit is contained in:
Cody Cutrer 2017-05-03 12:54:26 -06:00
parent 1aaec208fd
commit f50f695176
19 changed files with 29 additions and 23 deletions

View File

@ -48,7 +48,11 @@ gem 'folio-pagination', '0.0.12', require: 'folio/rails'
gem 'addressable', '2.5.0', require: false
gem "after_transaction_commit", '1.1.1'
gem "aws-sdk", '2.6.7', require: false
gem "aws-sdk", "3.0.0.rc3", require: false
gem "aws-sdk-s3", '1.0.0.rc2', require: false
gem "aws-sdk-sns", '1.0.0.rc1', require: false
gem "aws-sdk-sqs", '1.0.0.rc2', require: false
gem "aws-sdk-kinesis", '1.0.0.rc1', require: false
gem 'barby', '0.6.5', require: false
gem 'rqrcode', '0.10.1', require: false
gem 'chunky_png', '1.3.8', require: false

View File

@ -16,7 +16,7 @@
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
require 'aws-sdk'
require 'aws-sdk-sqs'
class BounceNotificationProcessor
attr_reader :config

View File

@ -16,7 +16,7 @@
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
require 'aws-sdk'
require 'aws-sdk-sns'
class DeveloperKey < ActiveRecord::Base
include CustomValidations

View File

@ -16,7 +16,7 @@
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
require 'aws-sdk'
require 'aws-sdk-sns'
class NotificationEndpoint < ActiveRecord::Base
belongs_to :access_token

View File

@ -16,7 +16,7 @@
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
require 'aws-sdk'
require 'aws-sdk-sqs'
class ConfigurationMissingError < StandardError; end

View File

@ -140,7 +140,7 @@ module AttachmentFu # :nodoc:
mattr_reader :bucket
def self.included(base) #:nodoc:
require 'aws-sdk'
require 'aws-sdk-s3'
s3_config_path = base.attachment_options[:s3_config_path] || (Rails.root + 'config/amazon_s3.yml')
s3_config = YAML.load(ERB.new(File.read(s3_config_path)).result)[Rails.env].symbolize_keys

View File

@ -20,7 +20,8 @@ Gem::Specification.new do |spec|
spec.add_dependency "html_text_helper"
spec.add_dependency "utf8_cleaner"
spec.add_dependency "canvas_statsd"
spec.add_dependency "aws-sdk", "~> 2.6.7"
spec.add_dependency "aws-sdk-s3"
spec.add_dependency "aws-sdk-sqs"
spec.add_development_dependency "bundler", "~> 1.5"
spec.add_development_dependency "byebug"

View File

@ -16,7 +16,8 @@
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
require 'aws-sdk'
require 'aws-sdk-s3'
require 'aws-sdk-sqs'
require File.expand_path('../configurable_timeout', __FILE__)
module IncomingMailProcessor

View File

@ -16,7 +16,7 @@
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
require 'aws-sdk'
require 'aws-sdk-kinesis'
require 'json'
require 'active_support'
require 'active_support/core_ext/object/blank'

View File

@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
spec.require_paths = ["lib"]
spec.add_dependency "aws-sdk", "~> 2.6.7"
spec.add_dependency "aws-sdk-kinesis"
spec.add_dependency "canvas_statsd"
spec.add_dependency "activesupport"

View File

@ -17,7 +17,7 @@
#
require 'spec_helper'
require 'aws-sdk'
require 'aws-sdk-kinesis'
describe LiveEvents::Client do
def stub_config(opts = {})

View File

@ -2,6 +2,6 @@ source "https://rubygems.org"
gemspec
gem "aws-sdk", "2.6.7" # old cuz canvas
gem "aws-sdk-s3", "1.0.0.rc3"
gem "rspec"
gem "byebug"

View File

@ -15,9 +15,9 @@
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
gem "aws-sdk", "=2.6.7" unless defined? Bundler
gem "aws-sdk-s3", "1.0.0.rc3" unless defined? Bundler
require "json"
require "aws-sdk"
require "aws-sdk-s3"
require "fileutils"
require "tmpdir"
require 'yaml'

View File

@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
spec.test_files = spec.files.grep(%r{^spec/})
spec.require_paths = ["lib"]
spec.add_dependency "aws-sdk", "~> 2.6.7"
spec.add_dependency "aws-sdk-s3"
spec.add_dependency "activesupport", ">= 3.2", "< 5.1"
spec.add_dependency "activerecord", ">= 3.2", "< 5.1"
spec.add_dependency "globby", ">= 0.1.2"

View File

@ -24,7 +24,7 @@ module Canvas
attr_accessor :bucket, :config, :mutex
def initialize(folder='dist')
require 'aws-sdk'
require 'aws-sdk-s3'
@folder = folder
@config = Canvas::Cdn.config
@s3 = Aws::S3::Resource.new(access_key_id: config.aws_access_key_id,

View File

@ -16,7 +16,7 @@
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
require 'aws-sdk'
require 'aws-sdk-kinesis'
module Canvas::Plugins::Validators::LiveEventsValidator
def self.validate(settings, plugin_setting)

View File

@ -16,7 +16,7 @@
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
require 'aws-sdk'
require 'aws-sdk-sqs'
module Services
class NotificationService

View File

@ -2,7 +2,7 @@
require File.expand_path('../../config/boot', __FILE__)
require 'aws-sdk'
require 'aws-sdk-kinesis'
require 'json'
require 'pp'

View File

@ -91,7 +91,7 @@ describe BrandableCSS do
it 'uploads json file to s3 if cdn is enabled' do
Canvas::Cdn.stubs(:enabled?).returns(true)
Canvas::Cdn.stubs(:config).returns(ActiveSupport::OrderedOptions.new.merge(region: 'us-east-1'))
Canvas::Cdn.stubs(:config).returns(ActiveSupport::OrderedOptions.new.merge(region: 'us-east-1', aws_access_key_id: 'id', aws_secret_access_key: 'secret', bucket: 'cdn'))
file = StringIO.new
BrandableCSS.stubs(:default_brand_json_file).returns(file)
@ -102,7 +102,7 @@ describe BrandableCSS do
it 'deletes the local json file if cdn is enabled' do
Canvas::Cdn.stubs(:enabled?).returns(true)
Canvas::Cdn.stubs(:config).returns(ActiveSupport::OrderedOptions.new.merge(region: 'us-east-1'))
Canvas::Cdn.stubs(:config).returns(ActiveSupport::OrderedOptions.new.merge(region: 'us-east-1', aws_access_key_id: 'id', aws_secret_access_key: 'secret', bucket: 'cdn'))
file = StringIO.new
BrandableCSS.stubs(:default_brand_json_file).returns(file)
File.expects(:delete).with(BrandableCSS.default_brand_json_file)
@ -122,7 +122,7 @@ describe BrandableCSS do
it 'uploads javascript file to s3 if cdn is enabled' do
Canvas::Cdn.stubs(:enabled?).returns(true)
Canvas::Cdn.stubs(:config).returns(ActiveSupport::OrderedOptions.new.merge(region: 'us-east-1'))
Canvas::Cdn.stubs(:config).returns(ActiveSupport::OrderedOptions.new.merge(region: 'us-east-1', aws_access_key_id: 'id', aws_secret_access_key: 'secret', bucket: 'cdn'))
file = StringIO.new
BrandableCSS.stubs(:default_brand_js_file).returns(file)
@ -133,7 +133,7 @@ describe BrandableCSS do
it 'delete the local javascript file if cdn is enabled' do
Canvas::Cdn.stubs(:enabled?).returns(true)
Canvas::Cdn.stubs(:config).returns(ActiveSupport::OrderedOptions.new.merge(region: 'us-east-1'))
Canvas::Cdn.stubs(:config).returns(ActiveSupport::OrderedOptions.new.merge(region: 'us-east-1', aws_access_key_id: 'id', aws_secret_access_key: 'secret', bucket: 'cdn'))
file = StringIO.new
BrandableCSS.stubs(:default_brand_js_file).returns(file)
File.expects(:delete).with(BrandableCSS.default_brand_js_file)