Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
972440b1
Commit
972440b1
authored
Apr 25, 2017
by
Tiago Botelho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tadds migration to remove invalid services
parent
67974f1d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
47 additions
and
25 deletions
+47
-25
db/migrate/20170421102337_remove_nil_type_services.rb
db/migrate/20170421102337_remove_nil_type_services.rb
+12
-0
spec/factories/services.rb
spec/factories/services.rb
+13
-0
spec/lib/gitlab/import_export/project.json
spec/lib/gitlab/import_export/project.json
+19
-22
spec/lib/gitlab/import_export/relation_factory_spec.rb
spec/lib/gitlab/import_export/relation_factory_spec.rb
+1
-1
spec/models/project_services/issue_tracker_service_spec.rb
spec/models/project_services/issue_tracker_service_spec.rb
+1
-1
spec/models/service_spec.rb
spec/models/service_spec.rb
+1
-1
No files found.
db/migrate/20170421102337_remove_nil_type_services.rb
0 → 100644
View file @
972440b1
class
RemoveNilTypeServices
<
ActiveRecord
::
Migration
DOWNTIME
=
false
def
up
execute
<<-
SQL
DELETE FROM services WHERE type IS NULL OR type = '';
SQL
end
def
down
end
end
spec/factories/services.rb
View file @
972440b1
FactoryGirl
.
define
do
FactoryGirl
.
define
do
factory
:service
do
factory
:service
do
project
factory: :empty_project
project
factory: :empty_project
type
'Service'
end
factory
:custom_issue_tracker_service
,
class:
CustomIssueTrackerService
do
project
factory: :empty_project
type
'CustomIssueTrackerService'
category
'issue_tracker'
active
true
properties
(
project_url:
'https://project.url.com'
,
issues_url:
'https://issues.url.com'
,
new_issue_url:
'https://newissue.url.com'
)
end
end
factory
:kubernetes_service
do
factory
:kubernetes_service
do
...
...
spec/lib/gitlab/import_export/project.json
View file @
972440b1
...
@@ -6980,28 +6980,6 @@
...
@@ -6980,28 +6980,6 @@
],
],
"services"
:
[
"services"
:
[
{
"id"
:
164
,
"title"
:
null
,
"project_id"
:
5
,
"created_at"
:
"2016-06-14T15:02:07.372Z"
,
"updated_at"
:
"2016-06-14T15:02:07.372Z"
,
"active"
:
false
,
"properties"
:
{
},
"template"
:
false
,
"push_events"
:
true
,
"issues_events"
:
true
,
"merge_requests_events"
:
true
,
"tag_push_events"
:
true
,
"note_events"
:
true
,
"build_events"
:
true
,
"category"
:
"issue_tracker"
,
"type"
:
"CustomIssueTrackerService"
,
"default"
:
true
,
"wiki_page_events"
:
true
},
{
{
"id"
:
100
,
"id"
:
100
,
"title"
:
"JetBrains TeamCity CI"
,
"title"
:
"JetBrains TeamCity CI"
,
...
@@ -7019,6 +6997,7 @@
...
@@ -7019,6 +6997,7 @@
"tag_push_events"
:
true
,
"tag_push_events"
:
true
,
"note_events"
:
true
,
"note_events"
:
true
,
"build_events"
:
true
,
"build_events"
:
true
,
"type"
:
"TeamcityService"
,
"category"
:
"ci"
,
"category"
:
"ci"
,
"default"
:
false
,
"default"
:
false
,
"wiki_page_events"
:
true
"wiki_page_events"
:
true
...
@@ -7040,6 +7019,7 @@
...
@@ -7040,6 +7019,7 @@
"tag_push_events"
:
true
,
"tag_push_events"
:
true
,
"note_events"
:
true
,
"note_events"
:
true
,
"pipeline_events"
:
true
,
"pipeline_events"
:
true
,
"type"
:
"SlackService"
,
"category"
:
"common"
,
"category"
:
"common"
,
"default"
:
false
,
"default"
:
false
,
"wiki_page_events"
:
true
"wiki_page_events"
:
true
...
@@ -7061,6 +7041,7 @@
...
@@ -7061,6 +7041,7 @@
"tag_push_events"
:
true
,
"tag_push_events"
:
true
,
"note_events"
:
true
,
"note_events"
:
true
,
"build_events"
:
true
,
"build_events"
:
true
,
"type"
:
"RedmineService"
,
"category"
:
"issue_tracker"
,
"category"
:
"issue_tracker"
,
"default"
:
false
,
"default"
:
false
,
"wiki_page_events"
:
true
"wiki_page_events"
:
true
...
@@ -7082,6 +7063,7 @@
...
@@ -7082,6 +7063,7 @@
"tag_push_events"
:
true
,
"tag_push_events"
:
true
,
"note_events"
:
true
,
"note_events"
:
true
,
"build_events"
:
true
,
"build_events"
:
true
,
"type"
:
"PushoverService"
,
"category"
:
"common"
,
"category"
:
"common"
,
"default"
:
false
,
"default"
:
false
,
"wiki_page_events"
:
true
"wiki_page_events"
:
true
...
@@ -7103,6 +7085,7 @@
...
@@ -7103,6 +7085,7 @@
"tag_push_events"
:
true
,
"tag_push_events"
:
true
,
"note_events"
:
true
,
"note_events"
:
true
,
"build_events"
:
true
,
"build_events"
:
true
,
"type"
:
"PivotalTrackerService"
,
"category"
:
"common"
,
"category"
:
"common"
,
"default"
:
false
,
"default"
:
false
,
"wiki_page_events"
:
true
"wiki_page_events"
:
true
...
@@ -7125,6 +7108,7 @@
...
@@ -7125,6 +7108,7 @@
"tag_push_events"
:
true
,
"tag_push_events"
:
true
,
"note_events"
:
true
,
"note_events"
:
true
,
"build_events"
:
true
,
"build_events"
:
true
,
"type"
:
"JiraService"
,
"category"
:
"issue_tracker"
,
"category"
:
"issue_tracker"
,
"default"
:
false
,
"default"
:
false
,
"wiki_page_events"
:
true
"wiki_page_events"
:
true
...
@@ -7146,6 +7130,7 @@
...
@@ -7146,6 +7130,7 @@
"tag_push_events"
:
true
,
"tag_push_events"
:
true
,
"note_events"
:
true
,
"note_events"
:
true
,
"build_events"
:
true
,
"build_events"
:
true
,
"type"
:
"IrkerService"
,
"category"
:
"common"
,
"category"
:
"common"
,
"default"
:
false
,
"default"
:
false
,
"wiki_page_events"
:
true
"wiki_page_events"
:
true
...
@@ -7167,6 +7152,7 @@
...
@@ -7167,6 +7152,7 @@
"tag_push_events"
:
true
,
"tag_push_events"
:
true
,
"note_events"
:
true
,
"note_events"
:
true
,
"pipeline_events"
:
true
,
"pipeline_events"
:
true
,
"type"
:
"HipchatService"
,
"category"
:
"common"
,
"category"
:
"common"
,
"default"
:
false
,
"default"
:
false
,
"wiki_page_events"
:
true
"wiki_page_events"
:
true
...
@@ -7188,6 +7174,7 @@
...
@@ -7188,6 +7174,7 @@
"tag_push_events"
:
true
,
"tag_push_events"
:
true
,
"note_events"
:
true
,
"note_events"
:
true
,
"build_events"
:
true
,
"build_events"
:
true
,
"type"
:
"GemnasiumService"
,
"category"
:
"common"
,
"category"
:
"common"
,
"default"
:
false
,
"default"
:
false
,
"wiki_page_events"
:
true
"wiki_page_events"
:
true
...
@@ -7209,6 +7196,7 @@
...
@@ -7209,6 +7196,7 @@
"tag_push_events"
:
true
,
"tag_push_events"
:
true
,
"note_events"
:
true
,
"note_events"
:
true
,
"build_events"
:
true
,
"build_events"
:
true
,
"type"
:
"FlowdockService"
,
"category"
:
"common"
,
"category"
:
"common"
,
"default"
:
false
,
"default"
:
false
,
"wiki_page_events"
:
true
"wiki_page_events"
:
true
...
@@ -7230,6 +7218,7 @@
...
@@ -7230,6 +7218,7 @@
"tag_push_events"
:
true
,
"tag_push_events"
:
true
,
"note_events"
:
true
,
"note_events"
:
true
,
"build_events"
:
true
,
"build_events"
:
true
,
"type"
:
"ExternalWikiService"
,
"category"
:
"common"
,
"category"
:
"common"
,
"default"
:
false
,
"default"
:
false
,
"wiki_page_events"
:
true
"wiki_page_events"
:
true
...
@@ -7251,6 +7240,7 @@
...
@@ -7251,6 +7240,7 @@
"tag_push_events"
:
true
,
"tag_push_events"
:
true
,
"note_events"
:
true
,
"note_events"
:
true
,
"build_events"
:
true
,
"build_events"
:
true
,
"type"
:
"EmailsOnPushService"
,
"category"
:
"common"
,
"category"
:
"common"
,
"default"
:
false
,
"default"
:
false
,
"wiki_page_events"
:
true
"wiki_page_events"
:
true
...
@@ -7272,6 +7262,7 @@
...
@@ -7272,6 +7262,7 @@
"tag_push_events"
:
true
,
"tag_push_events"
:
true
,
"note_events"
:
true
,
"note_events"
:
true
,
"build_events"
:
true
,
"build_events"
:
true
,
"type"
:
"DroneCiService"
,
"category"
:
"ci"
,
"category"
:
"ci"
,
"default"
:
false
,
"default"
:
false
,
"wiki_page_events"
:
true
"wiki_page_events"
:
true
...
@@ -7293,6 +7284,7 @@
...
@@ -7293,6 +7284,7 @@
"tag_push_events"
:
true
,
"tag_push_events"
:
true
,
"note_events"
:
true
,
"note_events"
:
true
,
"build_events"
:
true
,
"build_events"
:
true
,
"type"
:
"CustomIssueTrackerService"
,
"category"
:
"issue_tracker"
,
"category"
:
"issue_tracker"
,
"default"
:
false
,
"default"
:
false
,
"wiki_page_events"
:
true
"wiki_page_events"
:
true
...
@@ -7314,6 +7306,7 @@
...
@@ -7314,6 +7306,7 @@
"tag_push_events"
:
true
,
"tag_push_events"
:
true
,
"note_events"
:
true
,
"note_events"
:
true
,
"build_events"
:
true
,
"build_events"
:
true
,
"type"
:
"CampfireService"
,
"category"
:
"common"
,
"category"
:
"common"
,
"default"
:
false
,
"default"
:
false
,
"wiki_page_events"
:
true
"wiki_page_events"
:
true
...
@@ -7335,6 +7328,7 @@
...
@@ -7335,6 +7328,7 @@
"tag_push_events"
:
true
,
"tag_push_events"
:
true
,
"note_events"
:
true
,
"note_events"
:
true
,
"build_events"
:
true
,
"build_events"
:
true
,
"type"
:
"BuildkiteService"
,
"category"
:
"ci"
,
"category"
:
"ci"
,
"default"
:
false
,
"default"
:
false
,
"wiki_page_events"
:
true
"wiki_page_events"
:
true
...
@@ -7356,6 +7350,7 @@
...
@@ -7356,6 +7350,7 @@
"tag_push_events"
:
true
,
"tag_push_events"
:
true
,
"note_events"
:
true
,
"note_events"
:
true
,
"build_events"
:
true
,
"build_events"
:
true
,
"type"
:
"BambooService"
,
"category"
:
"ci"
,
"category"
:
"ci"
,
"default"
:
false
,
"default"
:
false
,
"wiki_page_events"
:
true
"wiki_page_events"
:
true
...
@@ -7377,6 +7372,7 @@
...
@@ -7377,6 +7372,7 @@
"tag_push_events"
:
true
,
"tag_push_events"
:
true
,
"note_events"
:
true
,
"note_events"
:
true
,
"build_events"
:
true
,
"build_events"
:
true
,
"type"
:
"AssemblaService"
,
"category"
:
"common"
,
"category"
:
"common"
,
"default"
:
false
,
"default"
:
false
,
"wiki_page_events"
:
true
"wiki_page_events"
:
true
...
@@ -7398,6 +7394,7 @@
...
@@ -7398,6 +7394,7 @@
"tag_push_events"
:
true
,
"tag_push_events"
:
true
,
"note_events"
:
true
,
"note_events"
:
true
,
"build_events"
:
true
,
"build_events"
:
true
,
"type"
:
"AssemblaService"
,
"category"
:
"common"
,
"category"
:
"common"
,
"default"
:
false
,
"default"
:
false
,
"wiki_page_events"
:
true
"wiki_page_events"
:
true
...
...
spec/lib/gitlab/import_export/relation_factory_spec.rb
View file @
972440b1
...
@@ -60,7 +60,7 @@ describe Gitlab::ImportExport::RelationFactory, lib: true do
...
@@ -60,7 +60,7 @@ describe Gitlab::ImportExport::RelationFactory, lib: true do
end
end
context
'original service exists'
do
context
'original service exists'
do
let
(
:service_id
)
{
Service
.
create
(
project:
project
).
id
}
let
(
:service_id
)
{
create
(
:service
,
project:
project
).
id
}
it
'does not have the original service_id'
do
it
'does not have the original service_id'
do
expect
(
created_object
.
service_id
).
not_to
eq
(
service_id
)
expect
(
created_object
.
service_id
).
not_to
eq
(
service_id
)
...
...
spec/models/project_services/issue_tracker_service_spec.rb
View file @
972440b1
...
@@ -8,7 +8,7 @@ describe IssueTrackerService, models: true do
...
@@ -8,7 +8,7 @@ describe IssueTrackerService, models: true do
let
(
:service
)
{
RedmineService
.
new
(
project:
project
,
active:
true
)
}
let
(
:service
)
{
RedmineService
.
new
(
project:
project
,
active:
true
)
}
before
do
before
do
create
(
:
service
,
project:
project
,
active:
true
,
category:
'issue_tracker'
)
create
(
:
custom_issue_tracker_service
,
project:
project
)
end
end
context
'when service is changed manually by user'
do
context
'when service is changed manually by user'
do
...
...
spec/models/service_spec.rb
View file @
972440b1
...
@@ -7,7 +7,7 @@ describe Service, models: true do
...
@@ -7,7 +7,7 @@ describe Service, models: true do
end
end
describe
'Validations'
do
describe
'Validations'
do
it
{
is_expected
.
to
validate_presence_of
(
:type
)
.
on
(
:create
)
}
it
{
is_expected
.
to
validate_presence_of
(
:type
)
}
end
end
describe
"Test Button"
do
describe
"Test Button"
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment