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
has_one :mock_monitoring_service
has_one :microsoft_teams_service
has_one :packagist_service
has_one :github_service
# TODO: replace these relations with the fork network versions
has_one :forked_project_link, foreign_key: "forked_to_project_id"
......
# To add new service you should build a class inherited from Service
# and implement a set of methods
class Service < ActiveRecord::Base
prepend EE::Service
include Sortable
include Importable
......@@ -240,11 +241,8 @@ class Service < ActiveRecord::Base
external_wiki
flowdock
gemnasium
github
hipchat
irker
jenkins
jenkins_deprecated
jira
kubernetes
mattermost_slash_commands
......
......@@ -29,6 +29,7 @@ module EE
has_one :index_status
has_one :jenkins_service
has_one :jenkins_deprecated_service
has_one :github_service
has_many :approvers, 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
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' => [
{
required: true,
......@@ -699,6 +673,32 @@ module API
}
],
# 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' => [
{
required: true,
......
......@@ -250,32 +250,6 @@ module API
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' => [
{
required: true,
......@@ -587,6 +561,32 @@ module API
}
],
# 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' => [
{
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