Commit 95af2964 authored by Luke Duncalfe's avatar Luke Duncalfe

Merge branch '330300-ajk-p' into 'master'

Rename project integration associations: P [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!64215
parents e3159dcf 37267dc3
...@@ -48,6 +48,7 @@ class Integration < ApplicationRecord ...@@ -48,6 +48,7 @@ class Integration < ApplicationRecord
flowdock flowdock
hangouts_chat hangouts_chat
irker irker
packagist pipelines_email pivotaltracker pushover
].to_set.freeze ].to_set.freeze
def self.renamed?(name) def self.renamed?(name)
......
...@@ -178,10 +178,10 @@ class Project < ApplicationRecord ...@@ -178,10 +178,10 @@ class Project < ApplicationRecord
has_one :mattermost_slash_commands_service, class_name: 'Integrations::MattermostSlashCommands' has_one :mattermost_slash_commands_service, class_name: 'Integrations::MattermostSlashCommands'
has_one :microsoft_teams_service, class_name: 'Integrations::MicrosoftTeams' has_one :microsoft_teams_service, class_name: 'Integrations::MicrosoftTeams'
has_one :mock_ci_service, class_name: 'Integrations::MockCi' has_one :mock_ci_service, class_name: 'Integrations::MockCi'
has_one :packagist_service, class_name: 'Integrations::Packagist' has_one :packagist_integration, class_name: 'Integrations::Packagist'
has_one :pipelines_email_service, class_name: 'Integrations::PipelinesEmail' has_one :pipelines_email_integration, class_name: 'Integrations::PipelinesEmail'
has_one :pivotaltracker_service, class_name: 'Integrations::Pivotaltracker' has_one :pivotaltracker_integration, class_name: 'Integrations::Pivotaltracker'
has_one :pushover_service, class_name: 'Integrations::Pushover' has_one :pushover_integration, class_name: 'Integrations::Pushover'
has_one :redmine_service, class_name: 'Integrations::Redmine' has_one :redmine_service, 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'
......
...@@ -173,7 +173,7 @@ FactoryBot.define do ...@@ -173,7 +173,7 @@ FactoryBot.define do
type { 'SlackSlashCommandsService' } type { 'SlackSlashCommandsService' }
end end
factory :pipelines_email_service, class: 'Integrations::PipelinesEmail' do factory :pipelines_email_integration, class: 'Integrations::PipelinesEmail' do
project project
active { true } active { true }
type { 'PipelinesEmailService' } type { 'PipelinesEmailService' }
......
...@@ -367,12 +367,12 @@ project: ...@@ -367,12 +367,12 @@ project:
- discord_integration - discord_integration
- drone_ci_integration - drone_ci_integration
- emails_on_push_integration - emails_on_push_integration
- pipelines_email_service - pipelines_email_integration
- mattermost_slash_commands_service - mattermost_slash_commands_service
- slack_slash_commands_service - slack_slash_commands_service
- irker_integration - irker_integration
- packagist_service - packagist_integration
- pivotaltracker_service - pivotaltracker_integration
- prometheus_service - prometheus_service
- flowdock_integration - flowdock_integration
- assembla_integration - assembla_integration
...@@ -385,7 +385,7 @@ project: ...@@ -385,7 +385,7 @@ project:
- buildkite_integration - buildkite_integration
- bamboo_integration - bamboo_integration
- teamcity_service - teamcity_service
- pushover_service - pushover_integration
- jira_service - jira_service
- redmine_service - redmine_service
- youtrack_service - youtrack_service
......
...@@ -2854,7 +2854,7 @@ RSpec.describe Ci::Pipeline, :mailer, factory_default: :keep do ...@@ -2854,7 +2854,7 @@ RSpec.describe Ci::Pipeline, :mailer, factory_default: :keep do
end end
it 'builds hook data once' do it 'builds hook data once' do
create(:pipelines_email_service) create(:pipelines_email_integration)
expect(Gitlab::DataBuilder::Pipeline).to receive(:build).once.and_call_original expect(Gitlab::DataBuilder::Pipeline).to receive(:build).once.and_call_original
......
...@@ -33,14 +33,14 @@ RSpec.describe Integrations::Packagist do ...@@ -33,14 +33,14 @@ RSpec.describe Integrations::Packagist do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:push_sample_data) { Gitlab::DataBuilder::Push.build_sample(project, user) } let(:push_sample_data) { Gitlab::DataBuilder::Push.build_sample(project, user) }
let(:packagist_service) { described_class.create!(packagist_params) } let(:packagist_integration) { described_class.create!(packagist_params) }
before do before do
stub_request(:post, packagist_hook_url) stub_request(:post, packagist_hook_url)
end end
it 'calls Packagist API' do it 'calls Packagist API' do
packagist_service.execute(push_sample_data) packagist_integration.execute(push_sample_data)
expect(a_request(:post, packagist_hook_url)).to have_been_made.once expect(a_request(:post, packagist_hook_url)).to have_been_made.once
end end
......
...@@ -41,8 +41,8 @@ RSpec.describe Project, factory_default: :keep do ...@@ -41,8 +41,8 @@ RSpec.describe Project, factory_default: :keep do
it { is_expected.to have_one(:hangouts_chat_integration) } it { is_expected.to have_one(:hangouts_chat_integration) }
it { is_expected.to have_one(:unify_circuit_service) } it { is_expected.to have_one(:unify_circuit_service) }
it { is_expected.to have_one(:webex_teams_service) } it { is_expected.to have_one(:webex_teams_service) }
it { is_expected.to have_one(:packagist_service) } it { is_expected.to have_one(:packagist_integration) }
it { is_expected.to have_one(:pushover_service) } it { is_expected.to have_one(:pushover_integration) }
it { is_expected.to have_one(:asana_integration) } it { is_expected.to have_one(:asana_integration) }
it { is_expected.to have_many(:boards) } it { is_expected.to have_many(:boards) }
it { is_expected.to have_one(:campfire_integration) } it { is_expected.to have_one(:campfire_integration) }
...@@ -50,9 +50,9 @@ RSpec.describe Project, factory_default: :keep do ...@@ -50,9 +50,9 @@ RSpec.describe Project, factory_default: :keep do
it { is_expected.to have_one(:discord_integration) } it { is_expected.to have_one(:discord_integration) }
it { is_expected.to have_one(:drone_ci_integration) } it { is_expected.to have_one(:drone_ci_integration) }
it { is_expected.to have_one(:emails_on_push_integration) } it { is_expected.to have_one(:emails_on_push_integration) }
it { is_expected.to have_one(:pipelines_email_service) } it { is_expected.to have_one(:pipelines_email_integration) }
it { is_expected.to have_one(:irker_integration) } it { is_expected.to have_one(:irker_integration) }
it { is_expected.to have_one(:pivotaltracker_service) } it { is_expected.to have_one(:pivotaltracker_integration) }
it { is_expected.to have_one(:flowdock_integration) } it { is_expected.to have_one(:flowdock_integration) }
it { is_expected.to have_one(:assembla_integration) } it { is_expected.to have_one(:assembla_integration) }
it { is_expected.to have_one(:slack_slash_commands_service) } it { is_expected.to have_one(:slack_slash_commands_service) }
......
...@@ -23,8 +23,8 @@ RSpec.describe Integrations::Test::ProjectService do ...@@ -23,8 +23,8 @@ RSpec.describe Integrations::Test::ProjectService do
expect(subject).to eq(success_result) expect(subject).to eq(success_result)
end end
context 'PipelinesEmailService' do context 'with Integrations::PipelinesEmail' do
let(:integration) { create(:pipelines_email_service, project: project) } let(:integration) { create(:pipelines_email_integration, project: project) }
it_behaves_like 'tests for integration with pipeline data' it_behaves_like 'tests for integration with pipeline data'
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