Commit 7e55bb88 authored by Illya Klymov's avatar Illya Klymov

Remove jobs from importers

Path jobs was replaced by realtime_changes
parent 1ce28983
...@@ -87,15 +87,6 @@ class Import::BaseController < ApplicationController ...@@ -87,15 +87,6 @@ class Import::BaseController < ApplicationController
end end
# rubocop: enable CodeReuse/ActiveRecord # rubocop: enable CodeReuse/ActiveRecord
# rubocop: disable CodeReuse/ActiveRecord
def find_jobs(import_type)
current_user.created_projects
.with_import_state
.where(import_type: import_type)
.to_json(only: [:id], methods: [:import_status])
end
# rubocop: enable CodeReuse/ActiveRecord
# deprecated: being replaced by app/services/import/base_service.rb # deprecated: being replaced by app/services/import/base_service.rb
def find_or_create_namespace(names, owner) def find_or_create_namespace(names, owner)
names = params[:target_namespace].presence || names names = params[:target_namespace].presence || names
......
...@@ -26,10 +26,6 @@ class Import::BitbucketController < Import::BaseController ...@@ -26,10 +26,6 @@ class Import::BitbucketController < Import::BaseController
super super
end end
def jobs
render json: find_jobs('bitbucket')
end
def realtime_changes def realtime_changes
super super
end end
......
...@@ -56,10 +56,6 @@ class Import::BitbucketServerController < Import::BaseController ...@@ -56,10 +56,6 @@ class Import::BitbucketServerController < Import::BaseController
super super
end end
def jobs
render json: find_jobs('bitbucket_server')
end
def realtime_changes def realtime_changes
super super
end end
......
...@@ -58,10 +58,6 @@ class Import::FogbugzController < Import::BaseController ...@@ -58,10 +58,6 @@ class Import::FogbugzController < Import::BaseController
super super
end end
def jobs
render json: find_jobs('fogbugz')
end
def create def create
repo = client.repo(params[:repo_id]) repo = client.repo(params[:repo_id])
fb_session = { uri: session[:fogbugz_uri], token: session[:fogbugz_token] } fb_session = { uri: session[:fogbugz_uri], token: session[:fogbugz_token] }
......
...@@ -20,10 +20,6 @@ class Import::GitlabController < Import::BaseController ...@@ -20,10 +20,6 @@ class Import::GitlabController < Import::BaseController
super super
end end
def jobs
render json: find_jobs('gitlab')
end
def create def create
repo = client.project(params[:repo_id].to_i) repo = client.project(params[:repo_id].to_i)
target_namespace = find_or_create_namespace(repo['namespace']['path'], client.user['username']) target_namespace = find_or_create_namespace(repo['namespace']['path'], client.user['username'])
......
...@@ -24,14 +24,12 @@ namespace :import do ...@@ -24,14 +24,12 @@ namespace :import do
resource :gitlab, only: [:create], controller: :gitlab do resource :gitlab, only: [:create], controller: :gitlab do
get :status get :status
get :callback get :callback
get :jobs
get :realtime_changes get :realtime_changes
end end
resource :bitbucket, only: [:create], controller: :bitbucket do resource :bitbucket, only: [:create], controller: :bitbucket do
get :status get :status
get :callback get :callback
get :jobs
get :realtime_changes get :realtime_changes
end end
...@@ -39,7 +37,6 @@ namespace :import do ...@@ -39,7 +37,6 @@ namespace :import do
post :configure post :configure
get :status get :status
get :callback get :callback
get :jobs
get :realtime_changes get :realtime_changes
end end
...@@ -55,7 +52,6 @@ namespace :import do ...@@ -55,7 +52,6 @@ namespace :import do
resource :fogbugz, only: [:create, :new], controller: :fogbugz do resource :fogbugz, only: [:create, :new], controller: :fogbugz do
get :status get :status
post :callback post :callback
get :jobs
get :realtime_changes get :realtime_changes
get :new_user_map, path: :user_map get :new_user_map, path: :user_map
......
...@@ -180,20 +180,4 @@ RSpec.describe Import::BitbucketServerController do ...@@ -180,20 +180,4 @@ RSpec.describe Import::BitbucketServerController do
end end
end end
end end
describe 'GET jobs' do
before do
assign_session_tokens
end
it 'returns a list of imported projects' do
created_project = create(:project, import_type: 'bitbucket_server', creator_id: user.id)
get :jobs
expect(json_response.count).to eq(1)
expect(json_response.first['id']).to eq(created_project.id)
expect(json_response.first['import_status']).to eq('none')
end
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment