diff --git a/Gemfile b/Gemfile index d609ff6610f1ceaa127851ea24e2781ae3e00843..5510d7ee6395f28e4b914ba87d7305add10b2058 100644 --- a/Gemfile +++ b/Gemfile @@ -158,7 +158,7 @@ gem "slack-notifier", "~> 1.0.0" gem 'asana', '~> 0.0.6' # FogBugz integration -gem 'ruby-fogbugz' +gem 'ruby-fogbugz', '~> 0.2.0' # d3 gem 'd3_rails', '~> 3.5.5' diff --git a/Gemfile.lock b/Gemfile.lock index 29f7213bd67ee2c7417ddbe738ca2bab5b08b80d..4f16e14c8976ba2ed8343783a9e88250965989af 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -575,8 +575,8 @@ GEM powerpack (~> 0.0.6) rainbow (>= 1.99.1, < 3.0) ruby-progressbar (~> 1.4) - ruby-fogbugz (0.1.1) - crack + ruby-fogbugz (0.2.0) + crack (~> 0.4) ruby-progressbar (1.7.1) ruby-saml (1.0.0) nokogiri (>= 1.5.10) @@ -849,7 +849,7 @@ DEPENDENCIES rqrcode-rails3 rspec-rails (~> 3.3.0) rubocop (= 0.28.0) - ruby-fogbugz + ruby-fogbugz (~> 0.2.0) sanitize (~> 2.0) sass-rails (~> 4.0.5) sdoc diff --git a/app/controllers/import/fogbugz_controller.rb b/app/controllers/import/fogbugz_controller.rb index bda534fb4de1902174b7afda272e814894c4565b..849646cd6652403006d9a601a2909d03e70b474f 100644 --- a/app/controllers/import/fogbugz_controller.rb +++ b/app/controllers/import/fogbugz_controller.rb @@ -2,7 +2,6 @@ class Import::FogbugzController < Import::BaseController before_action :verify_fogbugz_import_enabled before_action :user_map, only: [:new_user_map, :create_user_map] - # Doesn't work yet due to bug in ruby-fogbugz, see below rescue_from Fogbugz::AuthenticationException, with: :fogbugz_unauthorized def new @@ -13,8 +12,8 @@ def callback begin res = Gitlab::FogbugzImport::Client.new(import_params.symbolize_keys) rescue - # Needed until https://github.com/firmafon/ruby-fogbugz/pull/9 is merged - return redirect_to :back, alert: 'Could not authenticate with FogBugz, check your URL, email, and password' + # If the URI is invalid various errors can occur + return redirect_to new_import_fogbugz_path, alert: 'Could not connect to FogBugz, check your URL' end session[:fogbugz_token] = res.get_token session[:fogbugz_uri] = params[:uri] @@ -92,8 +91,7 @@ def user_map end def fogbugz_unauthorized(exception) - flash[:alert] = exception.message - redirect_to new_import_fogbugz_path + redirect_to new_import_fogbugz_path, alert: exception.message end def import_params