Merge branch 'zj-remove-deprecated-ci-service' into 'master'

Remove deprecated CI service

Closes #28094

See merge request !9221
This commit is contained in:
Douwe Maan 2017-02-15 17:40:29 +00:00
commit dc6b666025
5 changed files with 22 additions and 11 deletions

View File

@ -1,8 +0,0 @@
# TODO(ayufan): The GitLabCiService is deprecated and the type should be removed when the database entries are removed
class GitlabCiService < CiService
# We override the active accessor to always make GitLabCiService disabled
# Otherwise the GitLabCiService can be picked, but should never be since it's deprecated
def active
false
end
end

View File

@ -27,7 +27,7 @@ class Service < ActiveRecord::Base
validates :project_id, presence: true, unless: Proc.new { |service| service.template? }
scope :visible, -> { where.not(type: ['GitlabIssueTrackerService', 'GitlabCiService']) }
scope :visible, -> { where.not(type: 'GitlabIssueTrackerService') }
scope :issue_trackers, -> { where(category: 'issue_tracker') }
scope :external_wikis, -> { where(type: 'ExternalWikiService').active }
scope :active, -> { where(active: true) }

View File

@ -0,0 +1,4 @@
---
title: Remove deprecated GitlabCiService
merge_request:
author:

View File

@ -0,0 +1,15 @@
class DeleteDeprecatedGitlabCiService < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def up
disable_statement_timeout
execute("DELETE FROM services WHERE type = 'GitlabCiService';")
end
def down
# noop
end
end

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20170211073944) do
ActiveRecord::Schema.define(version: 20170214111112) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -1351,4 +1351,4 @@ ActiveRecord::Schema.define(version: 20170211073944) do
add_foreign_key "timelogs", "merge_requests", name: "fk_timelogs_merge_requests_merge_request_id", on_delete: :cascade
add_foreign_key "trending_projects", "projects", on_delete: :cascade
add_foreign_key "u2f_registrations", "users"
end
end