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:
- Project and wiki repositories
- Project uploads
- Project configuration, including services
- Project configuration, excluding integrations
- Issues with comments, merge requests with diffs and comments, labels, milestones, snippets, time tracking,
and other project entities
- Design Management files and data
......
......@@ -89,7 +89,6 @@ tree:
- :triggers
- :pipeline_schedules
- :container_expiration_policy
- :services
- protected_branches:
- :merge_access_levels
- :push_access_levels
......@@ -261,12 +260,6 @@ excluded_attributes:
runners:
- :token
- :token_encrypted
services:
- :description
- :inherit_from_id
- :instance
- :template
- :title
error_tracking_setting:
- :encrypted_token
- :encrypted_token_iv
......@@ -355,8 +348,6 @@ methods:
- :type
statuses:
- :type
services:
- :type
merge_request_diff_files:
- :utf8_diff
merge_requests:
......
......@@ -71,9 +71,9 @@ module Gitlab
def invalid_relation?
# Do not create relation if it is:
# - An unknown service
# - A service
# - A legacy trigger
unknown_service? || legacy_trigger?
service? || legacy_trigger?
end
def setup_models
......@@ -137,9 +137,8 @@ module Gitlab
end
end
def unknown_service?
@relation_name == :services && parsed_relation_hash['type'] &&
!Object.const_defined?(parsed_relation_hash['type'])
def service?
@relation_name == :services
end
def legacy_trigger?
......
......@@ -175,14 +175,6 @@ RSpec.describe Gitlab::ImportExport::FastHashSerializer do
expect(subject['merge_requests'].first['resource_label_events']).not_to be_empty
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
project_feature = subject['project_feature']
expect(project_feature).not_to be_empty
......
......@@ -291,10 +291,6 @@ RSpec.describe Gitlab::ImportExport::Project::TreeRestorer do
expect(@project.auto_devops.deploy_strategy).to eq('continuous')
end
it 'restores the correct service' do
expect(CustomIssueTrackerService.first).not_to be_nil
end
it 'restores zoom meetings' do
meetings = @project.issues.first.zoom_meetings
......@@ -553,8 +549,7 @@ RSpec.describe Gitlab::ImportExport::Project::TreeRestorer do
labels: 2,
label_with_priorities: 'A project label',
milestones: 1,
first_issue_labels: 1,
services: 1
first_issue_labels: 1
end
context 'when there is an existing build with build token' do
......@@ -637,7 +632,6 @@ RSpec.describe Gitlab::ImportExport::Project::TreeRestorer do
label_with_priorities: 'A project label',
milestones: 1,
first_issue_labels: 1,
services: 1,
import_failures: 1
it 'records the failures in the database' do
......@@ -757,18 +751,6 @@ RSpec.describe Gitlab::ImportExport::Project::TreeRestorer do
setup_reader(reader)
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
create(:group_label, name: 'Another label', group: project.group)
......@@ -972,7 +954,6 @@ RSpec.describe Gitlab::ImportExport::Project::TreeRestorer do
label_with_priorities: nil,
milestones: 1,
first_issue_labels: 0,
services: 0,
import_failures: 1
it 'records the failures in the database' do
......
......@@ -223,18 +223,6 @@ RSpec.describe Gitlab::ImportExport::Project::TreeSaver do
it { is_expected.not_to be_empty }
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
let(:relation_name) { :project_feature }
......@@ -453,7 +441,6 @@ RSpec.describe Gitlab::ImportExport::Project::TreeSaver do
create(:resource_label_event, label: group_label, merge_request: merge_request)
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)
......
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