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
end
# 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
def find_or_create_namespace(names, owner)
names = params[:target_namespace].presence || names
......
......@@ -26,10 +26,6 @@ class Import::BitbucketController < Import::BaseController
super
end
def jobs
render json: find_jobs('bitbucket')
end
def realtime_changes
super
end
......
......@@ -56,10 +56,6 @@ class Import::BitbucketServerController < Import::BaseController
super
end
def jobs
render json: find_jobs('bitbucket_server')
end
def realtime_changes
super
end
......
......@@ -58,10 +58,6 @@ class Import::FogbugzController < Import::BaseController
super
end
def jobs
render json: find_jobs('fogbugz')
end
def create
repo = client.repo(params[:repo_id])
fb_session = { uri: session[:fogbugz_uri], token: session[:fogbugz_token] }
......
......@@ -20,10 +20,6 @@ class Import::GitlabController < Import::BaseController
super
end
def jobs
render json: find_jobs('gitlab')
end
def create
repo = client.project(params[:repo_id].to_i)
target_namespace = find_or_create_namespace(repo['namespace']['path'], client.user['username'])
......
......@@ -24,14 +24,12 @@ namespace :import do
resource :gitlab, only: [:create], controller: :gitlab do
get :status
get :callback
get :jobs
get :realtime_changes
end
resource :bitbucket, only: [:create], controller: :bitbucket do
get :status
get :callback
get :jobs
get :realtime_changes
end
......@@ -39,7 +37,6 @@ namespace :import do
post :configure
get :status
get :callback
get :jobs
get :realtime_changes
end
......@@ -55,7 +52,6 @@ namespace :import do
resource :fogbugz, only: [:create, :new], controller: :fogbugz do
get :status
post :callback
get :jobs
get :realtime_changes
get :new_user_map, path: :user_map
......
......@@ -180,20 +180,4 @@ RSpec.describe Import::BitbucketServerController do
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
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