Commit d2bd7606 authored by James Edwards-Jones's avatar James Edwards-Jones

Moves GithubService changes to ee/ folders

parent 3ecfa112
...@@ -137,7 +137,6 @@ class Project < ActiveRecord::Base ...@@ -137,7 +137,6 @@ class Project < ActiveRecord::Base
has_one :mock_monitoring_service has_one :mock_monitoring_service
has_one :microsoft_teams_service has_one :microsoft_teams_service
has_one :packagist_service has_one :packagist_service
has_one :github_service
# TODO: replace these relations with the fork network versions # TODO: replace these relations with the fork network versions
has_one :forked_project_link, foreign_key: "forked_to_project_id" has_one :forked_project_link, foreign_key: "forked_to_project_id"
......
# To add new service you should build a class inherited from Service # To add new service you should build a class inherited from Service
# and implement a set of methods # and implement a set of methods
class Service < ActiveRecord::Base class Service < ActiveRecord::Base
prepend EE::Service
include Sortable include Sortable
include Importable include Importable
...@@ -240,11 +241,8 @@ class Service < ActiveRecord::Base ...@@ -240,11 +241,8 @@ class Service < ActiveRecord::Base
external_wiki external_wiki
flowdock flowdock
gemnasium gemnasium
github
hipchat hipchat
irker irker
jenkins
jenkins_deprecated
jira jira
kubernetes kubernetes
mattermost_slash_commands mattermost_slash_commands
......
...@@ -29,6 +29,7 @@ module EE ...@@ -29,6 +29,7 @@ module EE
has_one :index_status has_one :index_status
has_one :jenkins_service has_one :jenkins_service
has_one :jenkins_deprecated_service has_one :jenkins_deprecated_service
has_one :github_service
has_many :approvers, as: :target, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent has_many :approvers, as: :target, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent
has_many :approver_groups, as: :target, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent has_many :approver_groups, as: :target, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent
......
module EE
module Service
extend ActiveSupport::Concern
module ClassMethods
extend ::Gitlab::Utils::Override
override :available_services_names
def available_services_names
ee_service_names = %w[
github
jenkins
jenkins_deprecated
]
(super + ee_service_names).sort_by(&:downcase)
end
end
end
end
...@@ -368,32 +368,6 @@ module API ...@@ -368,32 +368,6 @@ module API
desc: "The project's slug on gemnasium.com" desc: "The project's slug on gemnasium.com"
} }
], ],
'github' => [
{
required: true,
name: :token,
type: String,
desc: 'GitHub API token with repo:status OAuth scope'
},
{
required: false,
name: :api_url,
type: String,
desc: 'GitHub instance API URL, defaults to https://api.github.com'
},
{
required: true,
name: :owner,
type: String,
desc: 'Owner or organization of the GitHub repo'
},
{
required: true,
name: :repository_name,
type: String,
desc: "GitHub repository name"
}
],
'hipchat' => [ 'hipchat' => [
{ {
required: true, required: true,
...@@ -699,6 +673,32 @@ module API ...@@ -699,6 +673,32 @@ module API
} }
], ],
# EE-specific services # EE-specific services
'github' => [
{
required: true,
name: :token,
type: String,
desc: 'GitHub API token with repo:status OAuth scope'
},
{
required: false,
name: :api_url,
type: String,
desc: 'GitHub instance API URL, defaults to https://api.github.com'
},
{
required: true,
name: :owner,
type: String,
desc: 'Owner or organization of the GitHub repo'
},
{
required: true,
name: :repository_name,
type: String,
desc: "GitHub repository name"
}
],
'jenkins' => [ 'jenkins' => [
{ {
required: true, required: true,
......
...@@ -250,32 +250,6 @@ module API ...@@ -250,32 +250,6 @@ module API
desc: "The project's slug on gemnasium.com" desc: "The project's slug on gemnasium.com"
} }
], ],
'github' => [
{
required: true,
name: :token,
type: String,
desc: 'GitHub API token with repo:status OAuth scope'
},
{
required: false,
name: :api_url,
type: String,
desc: 'GitHub instance API URL, defaults to https://api.github.com'
},
{
required: true,
name: :owner,
type: String,
desc: 'Owner or organization of the GitHub repo'
},
{
required: true,
name: :repository_name,
type: String,
desc: "GitHub repository name"
}
],
'hipchat' => [ 'hipchat' => [
{ {
required: true, required: true,
...@@ -587,6 +561,32 @@ module API ...@@ -587,6 +561,32 @@ module API
} }
], ],
# EE-specific services # EE-specific services
'github' => [
{
required: true,
name: :token,
type: String,
desc: 'GitHub API token with repo:status OAuth scope'
},
{
required: false,
name: :api_url,
type: String,
desc: 'GitHub instance API URL, defaults to https://api.github.com'
},
{
required: true,
name: :owner,
type: String,
desc: 'Owner or organization of the GitHub repo'
},
{
required: true,
name: :repository_name,
type: String,
desc: "GitHub repository name"
}
],
'jenkins' => [ 'jenkins' => [
{ {
required: true, required: true,
......
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