Commit 86a35180 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'delete_mock_deployment_records' into 'master'

Delete MockDeploymentService records

See merge request gitlab-org/gitlab!50030
parents eeec468d f697b597
# frozen_string_literal: true
# Deprecated, to be deleted in 13.8 (https://gitlab.com/gitlab-org/gitlab/-/issues/293914)
#
# This was a class used only in development environment but became unusable
# since DeploymentService was deleted
class MockDeploymentService < Service
default_value_for :category, 'deployment'
......@@ -31,26 +35,4 @@ class MockDeploymentService < Service
def can_test?
false
end
def rollout_status(environment)
case environment.name
when 'staging'
::Gitlab::Kubernetes::RolloutStatus.new([], status: :not_found)
when 'test'
::Gitlab::Kubernetes::RolloutStatus.new([], status: :loading)
else
::Gitlab::Kubernetes::RolloutStatus.new(rollout_status_deployments)
end
end
private
def rollout_status_instances
data = File.read(Rails.root.join('spec', 'fixtures', 'rollout_status_instances.json'))
Gitlab::Json.parse(data)
end
def rollout_status_deployments
[OpenStruct.new(instances: rollout_status_instances)]
end
end
......@@ -24,7 +24,7 @@ class Service < ApplicationRecord
# Fake services to help with local development.
DEV_SERVICE_NAMES = %w[
mock_ci mock_deployment mock_monitoring
mock_ci mock_monitoring
].freeze
serialize :properties, JSON # rubocop:disable Cop/ActiveRecordSerialize
......
---
title: Delete MockDeploymentService records, used only in development environments
merge_request: 50030
author:
type: other
......@@ -6,7 +6,6 @@ class Gitlab::Seeder::Environments
end
def seed!
@project.create_mock_deployment_service!(active: true)
@project.create_mock_monitoring_service!(active: true)
create_master_deployments!('production')
......
# frozen_string_literal: true
class DeleteMockDeploymentServiceRecords < ActiveRecord::Migration[6.0]
DOWNTIME = false
def up
if Rails.env.development?
execute("DELETE FROM services WHERE type = 'MockDeploymentService'")
end
end
def down
# no-op
end
end
8aa288d8f4a02030528e096c3aa4e109c57f4ca2515442ca0bfb3463cf9ff609
\ No newline at end of file
......@@ -847,7 +847,6 @@ module API
def self.development_service_classes
[
::MockCiService,
::MockDeploymentService,
::MockMonitoringService
]
end
......
......@@ -398,10 +398,6 @@ FactoryBot.define do
jira_service
end
factory :mock_deployment_project, parent: :project do
mock_deployment_service
end
factory :prometheus_project, parent: :project do
after :create do |project|
project.create_prometheus_service(
......
......@@ -27,12 +27,6 @@ FactoryBot.define do
end
end
factory :mock_deployment_service do
project
type { 'MockDeploymentService' }
active { true }
end
factory :prometheus_service do
project
active { 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