Commit 642669a4 authored by Arturo Herrero's avatar Arturo Herrero

Exclude integrations (services) from import/export

The import/export functionality is not working for some integrations:
- Jira
- Redmine
- YouTrack
- Bugzilla
- CustomIssueTracker

After having a conversation with the people from the import team, we
have decided to remove the integrations from the import/export
functionality.
parent 0382457b
---
title: Exclude integrations (services) from import/export
merge_request: 35249
author:
type: changed
...@@ -95,7 +95,7 @@ The following items will be exported: ...@@ -95,7 +95,7 @@ The following items will be exported:
- Project and wiki repositories - Project and wiki repositories
- Project uploads - Project uploads
- Project configuration, including services - Project configuration, excluding integrations
- Issues with comments, merge requests with diffs and comments, labels, milestones, snippets, time tracking, - Issues with comments, merge requests with diffs and comments, labels, milestones, snippets, time tracking,
and other project entities and other project entities
- Design Management files and data - Design Management files and data
......
...@@ -89,7 +89,6 @@ tree: ...@@ -89,7 +89,6 @@ tree:
- :triggers - :triggers
- :pipeline_schedules - :pipeline_schedules
- :container_expiration_policy - :container_expiration_policy
- :services
- protected_branches: - protected_branches:
- :merge_access_levels - :merge_access_levels
- :push_access_levels - :push_access_levels
...@@ -261,12 +260,6 @@ excluded_attributes: ...@@ -261,12 +260,6 @@ excluded_attributes:
runners: runners:
- :token - :token
- :token_encrypted - :token_encrypted
services:
- :description
- :inherit_from_id
- :instance
- :template
- :title
error_tracking_setting: error_tracking_setting:
- :encrypted_token - :encrypted_token
- :encrypted_token_iv - :encrypted_token_iv
...@@ -355,8 +348,6 @@ methods: ...@@ -355,8 +348,6 @@ methods:
- :type - :type
statuses: statuses:
- :type - :type
services:
- :type
merge_request_diff_files: merge_request_diff_files:
- :utf8_diff - :utf8_diff
merge_requests: merge_requests:
......
...@@ -71,9 +71,9 @@ module Gitlab ...@@ -71,9 +71,9 @@ module Gitlab
def invalid_relation? def invalid_relation?
# Do not create relation if it is: # Do not create relation if it is:
# - An unknown service # - A service
# - A legacy trigger # - A legacy trigger
unknown_service? || legacy_trigger? service? || legacy_trigger?
end end
def setup_models def setup_models
...@@ -137,9 +137,8 @@ module Gitlab ...@@ -137,9 +137,8 @@ module Gitlab
end end
end end
def unknown_service? def service?
@relation_name == :services && parsed_relation_hash['type'] && @relation_name == :services
!Object.const_defined?(parsed_relation_hash['type'])
end end
def legacy_trigger? def legacy_trigger?
......
...@@ -175,14 +175,6 @@ RSpec.describe Gitlab::ImportExport::FastHashSerializer do ...@@ -175,14 +175,6 @@ RSpec.describe Gitlab::ImportExport::FastHashSerializer do
expect(subject['merge_requests'].first['resource_label_events']).not_to be_empty expect(subject['merge_requests'].first['resource_label_events']).not_to be_empty
end end
it 'saves the correct service type' do
expect(subject['services'].first['type']).to eq('CustomIssueTrackerService')
end
it 'saves the properties for a service' do
expect(subject['services'].first['properties']).to eq('one' => 'value')
end
it 'has project feature' do it 'has project feature' do
project_feature = subject['project_feature'] project_feature = subject['project_feature']
expect(project_feature).not_to be_empty expect(project_feature).not_to be_empty
......
...@@ -291,10 +291,6 @@ RSpec.describe Gitlab::ImportExport::Project::TreeRestorer do ...@@ -291,10 +291,6 @@ RSpec.describe Gitlab::ImportExport::Project::TreeRestorer do
expect(@project.auto_devops.deploy_strategy).to eq('continuous') expect(@project.auto_devops.deploy_strategy).to eq('continuous')
end end
it 'restores the correct service' do
expect(CustomIssueTrackerService.first).not_to be_nil
end
it 'restores zoom meetings' do it 'restores zoom meetings' do
meetings = @project.issues.first.zoom_meetings meetings = @project.issues.first.zoom_meetings
...@@ -553,8 +549,7 @@ RSpec.describe Gitlab::ImportExport::Project::TreeRestorer do ...@@ -553,8 +549,7 @@ RSpec.describe Gitlab::ImportExport::Project::TreeRestorer do
labels: 2, labels: 2,
label_with_priorities: 'A project label', label_with_priorities: 'A project label',
milestones: 1, milestones: 1,
first_issue_labels: 1, first_issue_labels: 1
services: 1
end end
context 'when there is an existing build with build token' do context 'when there is an existing build with build token' do
...@@ -637,7 +632,6 @@ RSpec.describe Gitlab::ImportExport::Project::TreeRestorer do ...@@ -637,7 +632,6 @@ RSpec.describe Gitlab::ImportExport::Project::TreeRestorer do
label_with_priorities: 'A project label', label_with_priorities: 'A project label',
milestones: 1, milestones: 1,
first_issue_labels: 1, first_issue_labels: 1,
services: 1,
import_failures: 1 import_failures: 1
it 'records the failures in the database' do it 'records the failures in the database' do
...@@ -757,18 +751,6 @@ RSpec.describe Gitlab::ImportExport::Project::TreeRestorer do ...@@ -757,18 +751,6 @@ RSpec.describe Gitlab::ImportExport::Project::TreeRestorer do
setup_reader(reader) setup_reader(reader)
end end
it 'does not import any templated services' do
expect(restored_project_json).to eq(true)
expect(project.services.where(template: true).count).to eq(0)
end
it 'does not import any instance services' do
expect(restored_project_json).to eq(true)
expect(project.services.where(instance: true).count).to eq(0)
end
it 'imports labels' do it 'imports labels' do
create(:group_label, name: 'Another label', group: project.group) create(:group_label, name: 'Another label', group: project.group)
...@@ -972,7 +954,6 @@ RSpec.describe Gitlab::ImportExport::Project::TreeRestorer do ...@@ -972,7 +954,6 @@ RSpec.describe Gitlab::ImportExport::Project::TreeRestorer do
label_with_priorities: nil, label_with_priorities: nil,
milestones: 1, milestones: 1,
first_issue_labels: 0, first_issue_labels: 0,
services: 0,
import_failures: 1 import_failures: 1
it 'records the failures in the database' do it 'records the failures in the database' do
......
...@@ -223,18 +223,6 @@ RSpec.describe Gitlab::ImportExport::Project::TreeSaver do ...@@ -223,18 +223,6 @@ RSpec.describe Gitlab::ImportExport::Project::TreeSaver do
it { is_expected.not_to be_empty } it { is_expected.not_to be_empty }
end end
context 'with services' do
let(:relation_name) { :services }
it 'saves the correct service type' do
expect(subject.first['type']).to eq('CustomIssueTrackerService')
end
it 'saves the properties for a service' do
expect(subject.first['properties']).to eq('one' => 'value')
end
end
context 'with project_feature' do context 'with project_feature' do
let(:relation_name) { :project_feature } let(:relation_name) { :project_feature }
...@@ -453,7 +441,6 @@ RSpec.describe Gitlab::ImportExport::Project::TreeSaver do ...@@ -453,7 +441,6 @@ RSpec.describe Gitlab::ImportExport::Project::TreeSaver do
create(:resource_label_event, label: group_label, merge_request: merge_request) create(:resource_label_event, label: group_label, merge_request: merge_request)
create(:event, :created, target: milestone, project: project, author: user) create(:event, :created, target: milestone, project: project, author: user)
create(:service, project: project, type: 'CustomIssueTrackerService', category: 'issue_tracker', properties: { one: 'value' })
create(:project_custom_attribute, project: project) create(:project_custom_attribute, project: project)
create(:project_custom_attribute, project: project) create(:project_custom_attribute, project: project)
......
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