Commit 3bb340f2 authored by Dylan Griffith's avatar Dylan Griffith

Merge branch '220342-remove-services-from-import-export' into 'master'

Exclude integrations (services) from Project Import/Export

See merge request gitlab-org/gitlab!35249
parents e646fca7 ac530abe
......@@ -6,7 +6,7 @@ module ExportHelper
[
_('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, and other project entities'),
_('LFS objects'),
_('Issue Boards'),
......
---
title: Exclude integrations (services) from Project Import/Export
merge_request: 35249
author:
type: changed
......@@ -97,7 +97,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:
......
......@@ -70,10 +70,8 @@ module Gitlab
private
def invalid_relation?
# Do not create relation if it is:
# - An unknown service
# - A legacy trigger
unknown_service? || legacy_trigger?
# Do not create relation if it is a legacy trigger
legacy_trigger?
end
def setup_models
......@@ -137,11 +135,6 @@ module Gitlab
end
end
def unknown_service?
@relation_name == :services && parsed_relation_hash['type'] &&
!Object.const_defined?(parsed_relation_hash['type'])
end
def legacy_trigger?
@relation_name == :'Ci::Trigger' && @relation_hash['owner_id'].nil?
end
......
......@@ -17760,7 +17760,7 @@ msgstr ""
msgid "Project clone URL"
msgstr ""
msgid "Project configuration, including services"
msgid "Project configuration, excluding integrations"
msgstr ""
msgid "Project description (optional)"
......
......@@ -455,9 +455,6 @@
],
"pipeline_schedules":[
],
"services":[
],
"protected_branches":[
......
......@@ -141,48 +141,6 @@
]
}
],
"services": [
{
"id": 100,
"project_id": 5,
"created_at": "2016-06-14T15:01:51.315Z",
"updated_at": "2016-06-14T15:01:51.315Z",
"active": false,
"properties": {},
"template": true,
"instance": false,
"push_events": true,
"issues_events": true,
"merge_requests_events": true,
"tag_push_events": true,
"note_events": true,
"job_events": true,
"type": "TeamcityService",
"category": "ci",
"default": false,
"wiki_page_events": true
},
{
"id": 101,
"project_id": 5,
"created_at": "2016-06-14T15:01:51.315Z",
"updated_at": "2016-06-14T15:01:51.315Z",
"active": false,
"properties": {},
"template": false,
"instance": true,
"push_events": true,
"issues_events": true,
"merge_requests_events": true,
"tag_push_events": true,
"note_events": true,
"job_events": true,
"type": "JiraService",
"category": "ci",
"default": false,
"wiki_page_events": true
}
],
"snippets": [],
"hooks": [],
"custom_attributes": [
......
......@@ -32,7 +32,6 @@
],
"labels": [],
"issues": [],
"services": [],
"snippets": [],
"hooks": []
}
......@@ -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)
......
......@@ -461,36 +461,6 @@ DeployKey:
- public
- can_push
- last_used_at
Service:
- id
- type
- title
- project_id
- created_at
- updated_at
- active
- properties
- template
- instance
- alert_events
- push_events
- issues_events
- commit_events
- merge_requests_events
- tag_push_events
- note_events
- pipeline_events
- job_events
- comment_on_event_enabled
- comment_detail
- category
- default
- wiki_page_events
- confidential_issues_events
- confidential_note_events
- deployment_events
- description
- inherit_from_id
ProjectHook:
- id
- url
......
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