Commit 2b205674 authored by Toon Claes's avatar Toon Claes

Merge branch '331064-remove-BuildsEmail-integration' into 'master'

Remove `BuildsEmailService` records from `services` table

See merge request gitlab-org/gitlab!63264
parents 36f30dac 272464a4
# frozen_string_literal: true
# This class is to be removed with 9.1
# We should also by then remove BuildsEmailService from database
# https://gitlab.com/gitlab-org/gitlab/-/issues/331064
module Integrations
class BuildsEmail < Integration
def self.to_param
'builds_email'
end
def self.supported_events
%w[]
end
end
end
# frozen_string_literal: true
class RemoveBuildsEmailServiceFromServices < ActiveRecord::Migration[6.1]
def up
execute("DELETE from services WHERE type = 'BuildsEmailService'")
end
def down
# no-op
end
end
fb02e0fee2760dad203b54d81c342dbf1461b3010503cab05da1eb14ab5d33da
\ No newline at end of file
# frozen_string_literal: true
require 'spec_helper'
require_migration!('remove_builds_email_service_from_services')
RSpec.describe RemoveBuildsEmailServiceFromServices do
let(:namespaces) { table(:namespaces) }
let(:projects) { table(:projects) }
let(:services) { table(:services) }
let(:namespace) { namespaces.create!(name: 'foo', path: 'bar') }
let(:project) { projects.create!(namespace_id: namespace.id) }
it 'correctly deletes `BuildsEmailService` services' do
services.create!(project_id: project.id, type: 'BuildsEmailService')
services.create!(project_id: project.id, type: 'OtherService')
expect(services.all.pluck(:type)).to match_array %w[BuildsEmailService OtherService]
migrate!
expect(services.all.pluck(:type)).to eq %w[OtherService]
end
end
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