Commit 9209736a authored by Robert Speicher's avatar Robert Speicher

Merge branch '56959-drop-project_auto_devops_domain' into 'master'

Removes project_auto_devops#domain column

Closes #56959

See merge request gitlab-org/gitlab-ce!28574
parents b9798c15 bfed2311
# frozen_string_literal: true # frozen_string_literal: true
class ProjectAutoDevops < ApplicationRecord class ProjectAutoDevops < ApplicationRecord
include IgnorableColumn
ignore_column :domain
belongs_to :project belongs_to :project
enum deploy_strategy: { enum deploy_strategy: {
...@@ -12,8 +16,6 @@ class ProjectAutoDevops < ApplicationRecord ...@@ -12,8 +16,6 @@ class ProjectAutoDevops < ApplicationRecord
scope :enabled, -> { where(enabled: true) } scope :enabled, -> { where(enabled: true) }
scope :disabled, -> { where(enabled: false) } scope :disabled, -> { where(enabled: false) }
validates :domain, allow_blank: true, hostname: { allow_numeric_hostname: true }
after_save :create_gitlab_deploy_token, if: :needs_to_create_deploy_token? after_save :create_gitlab_deploy_token, if: :needs_to_create_deploy_token?
def predefined_variables def predefined_variables
......
---
title: Removes project_auto_devops#domain column
merge_request: 28574
author:
type: other
# frozen_string_literal: true
class DropProjectAutoDevopsDomain < ActiveRecord::Migration[5.1]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def change
remove_column :project_auto_devops, :domain, :string
end
end
...@@ -1633,7 +1633,6 @@ ActiveRecord::Schema.define(version: 20190527194900) do ...@@ -1633,7 +1633,6 @@ ActiveRecord::Schema.define(version: 20190527194900) do
t.datetime_with_timezone "created_at", null: false t.datetime_with_timezone "created_at", null: false
t.datetime_with_timezone "updated_at", null: false t.datetime_with_timezone "updated_at", null: false
t.boolean "enabled" t.boolean "enabled"
t.string "domain"
t.integer "deploy_strategy", default: 0, null: false t.integer "deploy_strategy", default: 0, null: false
t.index ["project_id"], name: "index_project_auto_devops_on_project_id", unique: true, using: :btree t.index ["project_id"], name: "index_project_auto_devops_on_project_id", unique: true, using: :btree
end end
......
...@@ -109,7 +109,7 @@ describe Projects::Settings::CiCdController do ...@@ -109,7 +109,7 @@ describe Projects::Settings::CiCdController do
end end
context 'when updating the auto_devops settings' do context 'when updating the auto_devops settings' do
let(:params) { { auto_devops_attributes: { enabled: '', domain: 'mepmep.md' } } } let(:params) { { auto_devops_attributes: { enabled: '' } } }
context 'following the instance default' do context 'following the instance default' do
let(:params) { { auto_devops_attributes: { enabled: '' } } } let(:params) { { auto_devops_attributes: { enabled: '' } } }
......
...@@ -2,7 +2,6 @@ FactoryBot.define do ...@@ -2,7 +2,6 @@ FactoryBot.define do
factory :project_auto_devops do factory :project_auto_devops do
project project
enabled true enabled true
domain "example.com"
deploy_strategy :continuous deploy_strategy :continuous
trait :continuous_deployment do trait :continuous_deployment do
......
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