Commit affb8e23 authored by Alex Kalderimis's avatar Alex Kalderimis

Rename redmine service to integration

Renames the redmine project association from _service to _integration.
parent f296268b
...@@ -51,6 +51,7 @@ class Integration < ApplicationRecord ...@@ -51,6 +51,7 @@ class Integration < ApplicationRecord
jenkins jira jenkins jira
packagist pipelines_email pivotaltracker pushover packagist pipelines_email pivotaltracker pushover
mattermost mattermost_slash_commands microsoft_teams mock_ci mock_monitoring mattermost mattermost_slash_commands microsoft_teams mock_ci mock_monitoring
redmine
].to_set.freeze ].to_set.freeze
def self.renamed?(name) def self.renamed?(name)
......
...@@ -184,7 +184,7 @@ class Project < ApplicationRecord ...@@ -184,7 +184,7 @@ class Project < ApplicationRecord
has_one :pivotaltracker_integration, class_name: 'Integrations::Pivotaltracker' has_one :pivotaltracker_integration, class_name: 'Integrations::Pivotaltracker'
has_one :prometheus_service, class_name: 'Integrations::Prometheus', inverse_of: :project has_one :prometheus_service, class_name: 'Integrations::Prometheus', inverse_of: :project
has_one :pushover_integration, class_name: 'Integrations::Pushover' has_one :pushover_integration, class_name: 'Integrations::Pushover'
has_one :redmine_service, class_name: 'Integrations::Redmine' has_one :redmine_integration, class_name: 'Integrations::Redmine'
has_one :slack_service, class_name: 'Integrations::Slack' has_one :slack_service, class_name: 'Integrations::Slack'
has_one :slack_slash_commands_service, class_name: 'Integrations::SlackSlashCommands' has_one :slack_slash_commands_service, class_name: 'Integrations::SlackSlashCommands'
has_one :teamcity_service, class_name: 'Integrations::Teamcity' has_one :teamcity_service, class_name: 'Integrations::Teamcity'
......
...@@ -91,7 +91,7 @@ FactoryBot.define do ...@@ -91,7 +91,7 @@ FactoryBot.define do
issue_tracker issue_tracker
end end
factory :redmine_service, class: 'Integrations::Redmine' do factory :redmine_integration, class: 'Integrations::Redmine' do
project project
active { true } active { true }
issue_tracker issue_tracker
......
...@@ -396,7 +396,7 @@ FactoryBot.define do ...@@ -396,7 +396,7 @@ FactoryBot.define do
factory :redmine_project, parent: :project do factory :redmine_project, parent: :project do
has_external_issue_tracker { true } has_external_issue_tracker { true }
redmine_service redmine_integration
end end
factory :youtrack_project, parent: :project do factory :youtrack_project, parent: :project do
......
...@@ -118,7 +118,7 @@ RSpec.describe Banzai::Filter::References::ExternalIssueReferenceFilter do ...@@ -118,7 +118,7 @@ RSpec.describe Banzai::Filter::References::ExternalIssueReferenceFilter do
end end
context "redmine project" do context "redmine project" do
let_it_be(:service) { create(:redmine_service, project: project) } let_it_be(:integration) { create(:redmine_integration, project: project) }
before do before do
project.update!(issues_enabled: false) project.update!(issues_enabled: false)
......
...@@ -387,7 +387,7 @@ project: ...@@ -387,7 +387,7 @@ project:
- teamcity_service - teamcity_service
- pushover_integration - pushover_integration
- jira_integration - jira_integration
- redmine_service - redmine_integration
- youtrack_service - youtrack_service
- custom_issue_tracker_integration - custom_issue_tracker_integration
- bugzilla_integration - bugzilla_integration
......
...@@ -70,7 +70,7 @@ RSpec.describe Integration do ...@@ -70,7 +70,7 @@ RSpec.describe Integration do
describe '.by_type' do describe '.by_type' do
let!(:service1) { create(:jira_integration) } let!(:service1) { create(:jira_integration) }
let!(:service2) { create(:jira_integration) } let!(:service2) { create(:jira_integration) }
let!(:service3) { create(:redmine_service) } let!(:service3) { create(:redmine_integration) }
subject { described_class.by_type(type) } subject { described_class.by_type(type) }
......
...@@ -61,7 +61,7 @@ RSpec.describe Project, factory_default: :keep do ...@@ -61,7 +61,7 @@ RSpec.describe Project, factory_default: :keep do
it { is_expected.to have_one(:bamboo_integration) } it { is_expected.to have_one(:bamboo_integration) }
it { is_expected.to have_one(:teamcity_service) } it { is_expected.to have_one(:teamcity_service) }
it { is_expected.to have_one(:jira_integration) } it { is_expected.to have_one(:jira_integration) }
it { is_expected.to have_one(:redmine_service) } it { is_expected.to have_one(:redmine_integration) }
it { is_expected.to have_one(:youtrack_service) } it { is_expected.to have_one(:youtrack_service) }
it { is_expected.to have_one(:custom_issue_tracker_integration) } it { is_expected.to have_one(:custom_issue_tracker_integration) }
it { is_expected.to have_one(:bugzilla_integration) } it { is_expected.to have_one(:bugzilla_integration) }
......
...@@ -9,7 +9,7 @@ RSpec.describe 'query Jira service' do ...@@ -9,7 +9,7 @@ RSpec.describe 'query Jira service' do
let_it_be(:project) { create(:project) } let_it_be(:project) { create(:project) }
let_it_be(:jira_integration) { create(:jira_integration, project: project) } let_it_be(:jira_integration) { create(:jira_integration, project: project) }
let_it_be(:bugzilla_integration) { create(:bugzilla_integration, project: project) } let_it_be(:bugzilla_integration) { create(:bugzilla_integration, project: project) }
let_it_be(:redmine_service) { create(:redmine_service, project: project) } let_it_be(:redmine_integration) { create(:redmine_integration, project: project) }
let(:query) do let(:query) do
%( %(
......
...@@ -20,7 +20,7 @@ RSpec.describe Admin::PropagateIntegrationService do ...@@ -20,7 +20,7 @@ RSpec.describe Admin::PropagateIntegrationService do
end end
let_it_be(:different_type_inherited_integration) do let_it_be(:different_type_inherited_integration) do
create(:redmine_service, project: project, inherit_from_id: instance_integration.id) create(:redmine_integration, project: project, inherit_from_id: instance_integration.id)
end end
context 'with inherited integration' do context 'with inherited integration' do
......
...@@ -15,7 +15,7 @@ RSpec.describe 'projects/services/_form' do ...@@ -15,7 +15,7 @@ RSpec.describe 'projects/services/_form' do
current_user: user, current_user: user,
can?: true, can?: true,
current_application_settings: Gitlab::CurrentSettings.current_application_settings, current_application_settings: Gitlab::CurrentSettings.current_application_settings,
integration: project.redmine_service, integration: project.redmine_integration,
request: double(referer: '/services') request: double(referer: '/services')
) )
end end
......
...@@ -8,7 +8,7 @@ RSpec.describe PropagateIntegrationGroupWorker do ...@@ -8,7 +8,7 @@ RSpec.describe PropagateIntegrationGroupWorker do
let_it_be(:another_group) { create(:group) } let_it_be(:another_group) { create(:group) }
let_it_be(:subgroup1) { create(:group, parent: group) } let_it_be(:subgroup1) { create(:group, parent: group) }
let_it_be(:subgroup2) { create(:group, parent: group) } let_it_be(:subgroup2) { create(:group, parent: group) }
let_it_be(:integration) { create(:redmine_service, :instance) } let_it_be(:integration) { create(:redmine_integration, :instance) }
let(:job_args) { [integration.id, group.id, subgroup2.id] } let(:job_args) { [integration.id, group.id, subgroup2.id] }
...@@ -22,7 +22,7 @@ RSpec.describe PropagateIntegrationGroupWorker do ...@@ -22,7 +22,7 @@ RSpec.describe PropagateIntegrationGroupWorker do
end end
context 'with a group integration' do context 'with a group integration' do
let_it_be(:integration) { create(:redmine_service, group: group, project: nil) } let_it_be(:integration) { create(:redmine_integration, group: group, project: nil) }
it 'calls to BulkCreateIntegrationService' do it 'calls to BulkCreateIntegrationService' do
expect(BulkCreateIntegrationService).to receive(:new) expect(BulkCreateIntegrationService).to receive(:new)
......
...@@ -5,8 +5,8 @@ require 'spec_helper' ...@@ -5,8 +5,8 @@ require 'spec_helper'
RSpec.describe PropagateIntegrationInheritDescendantWorker do RSpec.describe PropagateIntegrationInheritDescendantWorker do
let_it_be(:group) { create(:group) } let_it_be(:group) { create(:group) }
let_it_be(:subgroup) { create(:group, parent: group) } let_it_be(:subgroup) { create(:group, parent: group) }
let_it_be(:group_integration) { create(:redmine_service, group: group, project: nil) } let_it_be(:group_integration) { create(:redmine_integration, group: group, project: nil) }
let_it_be(:subgroup_integration) { create(:redmine_service, group: subgroup, project: nil, inherit_from_id: group_integration.id) } let_it_be(:subgroup_integration) { create(:redmine_integration, group: subgroup, project: nil, inherit_from_id: group_integration.id) }
it_behaves_like 'an idempotent worker' do it_behaves_like 'an idempotent worker' do
let(:job_args) { [group_integration.id, subgroup_integration.id, subgroup_integration.id] } let(:job_args) { [group_integration.id, subgroup_integration.id, subgroup_integration.id] }
......
...@@ -4,10 +4,10 @@ require 'spec_helper' ...@@ -4,10 +4,10 @@ require 'spec_helper'
RSpec.describe PropagateIntegrationInheritWorker do RSpec.describe PropagateIntegrationInheritWorker do
describe '#perform' do describe '#perform' do
let_it_be(:integration) { create(:redmine_service, :instance) } let_it_be(:integration) { create(:redmine_integration, :instance) }
let_it_be(:integration1) { create(:redmine_service, inherit_from_id: integration.id) } let_it_be(:integration1) { create(:redmine_integration, inherit_from_id: integration.id) }
let_it_be(:integration2) { create(:bugzilla_integration, inherit_from_id: integration.id) } let_it_be(:integration2) { create(:bugzilla_integration, inherit_from_id: integration.id) }
let_it_be(:integration3) { create(:redmine_service) } let_it_be(:integration3) { create(:redmine_integration) }
it_behaves_like 'an idempotent worker' do it_behaves_like 'an idempotent worker' do
let(:job_args) { [integration.id, integration1.id, integration3.id] } let(:job_args) { [integration.id, integration1.id, integration3.id] }
......
...@@ -8,7 +8,7 @@ RSpec.describe PropagateIntegrationProjectWorker do ...@@ -8,7 +8,7 @@ RSpec.describe PropagateIntegrationProjectWorker do
let_it_be(:project1) { create(:project) } let_it_be(:project1) { create(:project) }
let_it_be(:project2) { create(:project, group: group) } let_it_be(:project2) { create(:project, group: group) }
let_it_be(:project3) { create(:project, group: group) } let_it_be(:project3) { create(:project, group: group) }
let_it_be(:integration) { create(:redmine_service, :instance) } let_it_be(:integration) { create(:redmine_integration, :instance) }
let(:job_args) { [integration.id, project1.id, project3.id] } let(:job_args) { [integration.id, project1.id, project3.id] }
...@@ -22,7 +22,7 @@ RSpec.describe PropagateIntegrationProjectWorker do ...@@ -22,7 +22,7 @@ RSpec.describe PropagateIntegrationProjectWorker do
end end
context 'with a group integration' do context 'with a group integration' do
let_it_be(:integration) { create(:redmine_service, group: group, project: nil) } let_it_be(:integration) { create(:redmine_integration, group: group, project: nil) }
it 'calls to BulkCreateIntegrationService' do it 'calls to BulkCreateIntegrationService' do
expect(BulkCreateIntegrationService).to receive(:new) expect(BulkCreateIntegrationService).to receive(:new)
......
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