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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
8b9084b4
Commit
8b9084b4
authored
May 20, 2021
by
Alex Kalderimis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename asana_service
Renames `asana_service` to `asana_integration`
parent
d0e635a0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
5 deletions
+41
-5
app/graphql/types/projects/service_type_enum.rb
app/graphql/types/projects/service_type_enum.rb
+8
-1
app/models/integration.rb
app/models/integration.rb
+30
-1
app/models/project.rb
app/models/project.rb
+1
-1
spec/lib/gitlab/import_export/all_models.yml
spec/lib/gitlab/import_export/all_models.yml
+1
-1
spec/models/project_spec.rb
spec/models/project_spec.rb
+1
-1
No files found.
app/graphql/types/projects/service_type_enum.rb
View file @
8b9084b4
...
...
@@ -6,7 +6,14 @@ module Types
graphql_name
'ServiceType'
::
Integration
.
available_services_types
(
include_dev:
false
).
each
do
|
service_type
|
value
service_type
.
underscore
.
upcase
,
value:
service_type
,
description:
"
#{
service_type
}
type"
replacement
=
Integration
.
integration_type_for_service_type
(
service_type
)
deprecation
=
{
reason: :renamed
,
replacement:
replacement
,
milestone:
'14.0'
}
if
replacement
.
present?
value
service_type
.
underscore
.
upcase
,
value:
service_type
,
description:
"
#{
service_type
}
type"
,
deprecation:
deprecation
end
::
Integration
.
available_integration_types
(
include_dev:
false
).
each
do
|
type
|
value
type
.
underscore
.
upcase
,
value:
type
,
description:
"
#{
type
}
integration"
end
end
end
...
...
app/models/integration.rb
View file @
8b9084b4
...
...
@@ -219,6 +219,7 @@ class Integration < ApplicationRecord
# Returns a list of available service names.
# Example: ["asana", ...]
# @deprecated
def
self
.
available_services_names
(
include_project_specific:
true
,
include_dev:
true
)
service_names
=
services_names
service_names
+=
project_specific_services_names
if
include_project_specific
...
...
@@ -227,10 +228,22 @@ class Integration < ApplicationRecord
service_names
.
sort_by
(
&
:downcase
)
end
def
self
.
services_names
# used as part of the renaming effort
RENAMED_TO_INTEGRATION
=
%w[asana]
def
self
.
available_integration_names
(
**
args
)
available_services_names
(
**
args
)
.
select
{
RENAMED_TO_INTEGRATION
.
include?
(
_1
)
}
end
def
self
.
integration_names
INTEGRATION_NAMES
end
def
self
.
services_names
integration_names
end
def
self
.
dev_services_names
return
[]
unless
Rails
.
env
.
development?
...
...
@@ -249,6 +262,18 @@ class Integration < ApplicationRecord
end
end
def
self
.
available_integration_types
(
include_project_specific:
true
,
include_dev:
true
)
available_integration_names
(
include_project_specific:
include_project_specific
,
include_dev:
include_dev
).
map
do
|
name
|
integration_name_to_type
(
name
)
end
end
def
self
.
integration_type_for_service_type
(
type_name
)
name
=
type_name
.
chomp
(
type_name
)
integration_name_to_type
(
name
)
if
RENAMED_TO_INTEGRATION
.
include?
(
name
)
end
# Returns the model for the given service name.
# Example: "asana" => Integrations::Asana
def
self
.
service_name_to_model
(
name
)
...
...
@@ -262,6 +287,10 @@ class Integration < ApplicationRecord
"
#{
name
}
_service"
.
camelize
end
def
self
.
integration_name_to_type
(
name
)
"
#{
name
}
_integration"
.
camelize
end
# Returns the model for the given STI type.
# Example: "AsanaService" => Integrations::Asana
def
self
.
service_type_to_model
(
type
)
...
...
app/models/project.rb
View file @
8b9084b4
...
...
@@ -155,7 +155,7 @@ class Project < ApplicationRecord
has_many
:boards
# Project integrations
has_one
:asana_
service
,
class_name:
'Integrations::Asana'
has_one
:asana_
integration
,
class_name:
'Integrations::Asana'
has_one
:assembla_service
,
class_name:
'Integrations::Assembla'
has_one
:bamboo_service
,
class_name:
'Integrations::Bamboo'
has_one
:bugzilla_service
,
class_name:
'Integrations::Bugzilla'
...
...
spec/lib/gitlab/import_export/all_models.yml
View file @
8b9084b4
...
...
@@ -377,7 +377,7 @@ project:
-
prometheus_service
-
flowdock_service
-
assembla_service
-
asana_
service
-
asana_
integration
-
slack_service
-
microsoft_teams_service
-
mattermost_service
...
...
spec/models/project_spec.rb
View file @
8b9084b4
...
...
@@ -43,7 +43,7 @@ RSpec.describe Project, factory_default: :keep do
it
{
is_expected
.
to
have_one
(
:webex_teams_service
)
}
it
{
is_expected
.
to
have_one
(
:packagist_service
)
}
it
{
is_expected
.
to
have_one
(
:pushover_service
)
}
it
{
is_expected
.
to
have_one
(
:asana_
service
)
}
it
{
is_expected
.
to
have_one
(
:asana_
integration
)
}
it
{
is_expected
.
to
have_many
(
:boards
)
}
it
{
is_expected
.
to
have_one
(
:campfire_service
)
}
it
{
is_expected
.
to
have_one
(
:datadog_service
)
}
...
...
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