Commit 313c82d0 authored by Alex Kalderimis's avatar Alex Kalderimis

Rename bugzilla service

Renames `bugzilla_service` to `bugzilla_integration`
parent b8293b2f
...@@ -229,7 +229,7 @@ class Integration < ApplicationRecord ...@@ -229,7 +229,7 @@ class Integration < ApplicationRecord
end end
# used as part of the renaming effort # used as part of the renaming effort
RENAMED_TO_INTEGRATION = %w[asana assembla bamboo].freeze RENAMED_TO_INTEGRATION = %w[asana assembla bamboo bugzilla].freeze
def self.available_integration_names(**args) def self.available_integration_names(**args)
available_services_names(**args) available_services_names(**args)
......
...@@ -158,7 +158,7 @@ class Project < ApplicationRecord ...@@ -158,7 +158,7 @@ class Project < ApplicationRecord
has_one :asana_integration, class_name: 'Integrations::Asana' has_one :asana_integration, class_name: 'Integrations::Asana'
has_one :assembla_integration, class_name: 'Integrations::Assembla' has_one :assembla_integration, class_name: 'Integrations::Assembla'
has_one :bamboo_integration, class_name: 'Integrations::Bamboo' has_one :bamboo_integration, class_name: 'Integrations::Bamboo'
has_one :bugzilla_service, class_name: 'Integrations::Bugzilla' has_one :bugzilla_integration, class_name: 'Integrations::Bugzilla'
has_one :buildkite_service, class_name: 'Integrations::Buildkite' has_one :buildkite_service, class_name: 'Integrations::Buildkite'
has_one :campfire_service, class_name: 'Integrations::Campfire' has_one :campfire_service, class_name: 'Integrations::Campfire'
has_one :confluence_service, class_name: 'Integrations::Confluence' has_one :confluence_service, class_name: 'Integrations::Confluence'
......
...@@ -85,7 +85,7 @@ FactoryBot.define do ...@@ -85,7 +85,7 @@ FactoryBot.define do
confluence_url { 'https://example.atlassian.net/wiki' } confluence_url { 'https://example.atlassian.net/wiki' }
end end
factory :bugzilla_service, class: 'Integrations::Bugzilla' do factory :bugzilla_integration, class: 'Integrations::Bugzilla' do
project project
active { true } active { true }
issue_tracker issue_tracker
......
...@@ -291,7 +291,7 @@ RSpec.describe Gitlab::BackgroundMigration::MigrateIssueTrackersSensitiveData, s ...@@ -291,7 +291,7 @@ RSpec.describe Gitlab::BackgroundMigration::MigrateIssueTrackersSensitiveData, s
services.create!(id: 20, type: 'JiraService', properties: jira_properties.to_json, category: 'issue_tracker') services.create!(id: 20, type: 'JiraService', properties: jira_properties.to_json, category: 'issue_tracker')
end end
let!(:bugzilla_service_valid) do let!(:bugzilla_integration_valid) do
services.create!(id: 11, type: 'BugzillaService', title: nil, properties: tracker_properties.to_json, category: 'issue_tracker') services.create!(id: 11, type: 'BugzillaService', title: nil, properties: tracker_properties.to_json, category: 'issue_tracker')
end end
...@@ -314,14 +314,14 @@ RSpec.describe Gitlab::BackgroundMigration::MigrateIssueTrackersSensitiveData, s ...@@ -314,14 +314,14 @@ RSpec.describe Gitlab::BackgroundMigration::MigrateIssueTrackersSensitiveData, s
expect(jira_service_valid.title).to eq(title) expect(jira_service_valid.title).to eq(title)
expect(jira_service_valid.description).to eq(description) expect(jira_service_valid.description).to eq(description)
bugzilla_service_valid.reload bugzilla_integration_valid.reload
data = IssueTrackerData.find_by(service_id: bugzilla_service_valid.id) data = IssueTrackerData.find_by(service_id: bugzilla_integration_valid.id)
expect(data.project_url).to eq(url) expect(data.project_url).to eq(url)
expect(data.issues_url).to eq(issues_url) expect(data.issues_url).to eq(issues_url)
expect(data.new_issue_url).to eq(new_issue_url) expect(data.new_issue_url).to eq(new_issue_url)
expect(bugzilla_service_valid.title).to eq(title) expect(bugzilla_integration_valid.title).to eq(title)
expect(bugzilla_service_valid.description).to eq(description) expect(bugzilla_integration_valid.description).to eq(description)
end end
end end
end end
...@@ -391,7 +391,7 @@ project: ...@@ -391,7 +391,7 @@ project:
- redmine_service - redmine_service
- youtrack_service - youtrack_service
- custom_issue_tracker_service - custom_issue_tracker_service
- bugzilla_service - bugzilla_integration
- ewm_service - ewm_service
- external_wiki_service - external_wiki_service
- mock_ci_service - mock_ci_service
......
...@@ -22,7 +22,7 @@ RSpec.describe MigrateIssueTrackersData do ...@@ -22,7 +22,7 @@ RSpec.describe MigrateIssueTrackersData do
services.create!(type: 'JiraService', properties: nil, category: 'issue_tracker') services.create!(type: 'JiraService', properties: nil, category: 'issue_tracker')
end end
let!(:bugzilla_service) do let!(:bugzilla_integration) do
services.create!(type: 'BugzillaService', properties: properties, category: 'issue_tracker') services.create!(type: 'BugzillaService', properties: properties, category: 'issue_tracker')
end end
...@@ -55,7 +55,7 @@ RSpec.describe MigrateIssueTrackersData do ...@@ -55,7 +55,7 @@ RSpec.describe MigrateIssueTrackersData do
freeze_time do freeze_time do
migrate! migrate!
expect(migration_name).to be_scheduled_delayed_migration(3.minutes, jira_service.id, bugzilla_service.id) expect(migration_name).to be_scheduled_delayed_migration(3.minutes, jira_service.id, bugzilla_integration.id)
expect(migration_name).to be_scheduled_delayed_migration(6.minutes, youtrack_service.id, gitlab_service.id) expect(migration_name).to be_scheduled_delayed_migration(6.minutes, youtrack_service.id, gitlab_service.id)
expect(BackgroundMigrationWorker.jobs.size).to eq(2) expect(BackgroundMigrationWorker.jobs.size).to eq(2)
end end
......
...@@ -22,7 +22,7 @@ RSpec.describe RescheduleMigrateIssueTrackersData do ...@@ -22,7 +22,7 @@ RSpec.describe RescheduleMigrateIssueTrackersData do
services.create!(id: 11, type: 'JiraService', properties: nil, category: 'issue_tracker') services.create!(id: 11, type: 'JiraService', properties: nil, category: 'issue_tracker')
end end
let!(:bugzilla_service) do let!(:bugzilla_integration) do
services.create!(id: 12, type: 'BugzillaService', properties: properties, category: 'issue_tracker') services.create!(id: 12, type: 'BugzillaService', properties: properties, category: 'issue_tracker')
end end
...@@ -56,7 +56,7 @@ RSpec.describe RescheduleMigrateIssueTrackersData do ...@@ -56,7 +56,7 @@ RSpec.describe RescheduleMigrateIssueTrackersData do
freeze_time do freeze_time do
migrate! migrate!
expect(migration_name).to be_scheduled_delayed_migration(3.minutes, jira_service.id, bugzilla_service.id) expect(migration_name).to be_scheduled_delayed_migration(3.minutes, jira_service.id, bugzilla_integration.id)
expect(migration_name).to be_scheduled_delayed_migration(6.minutes, youtrack_service.id, gitlab_service.id) expect(migration_name).to be_scheduled_delayed_migration(6.minutes, youtrack_service.id, gitlab_service.id)
expect(BackgroundMigrationWorker.jobs.size).to eq(2) expect(BackgroundMigrationWorker.jobs.size).to eq(2)
end end
...@@ -70,7 +70,7 @@ RSpec.describe RescheduleMigrateIssueTrackersData do ...@@ -70,7 +70,7 @@ RSpec.describe RescheduleMigrateIssueTrackersData do
let!(:valid_issue_tracker_data) do let!(:valid_issue_tracker_data) do
issue_tracker_data.create!( issue_tracker_data.create!(
service_id: bugzilla_service.id, service_id: bugzilla_integration.id,
encrypted_issues_url: 'http://url.com', encrypted_issues_url: 'http://url.com',
encrypted_issues_url_iv: 'somevalue' encrypted_issues_url_iv: 'somevalue'
) )
...@@ -78,7 +78,7 @@ RSpec.describe RescheduleMigrateIssueTrackersData do ...@@ -78,7 +78,7 @@ RSpec.describe RescheduleMigrateIssueTrackersData do
let!(:invalid_issue_tracker_data) do let!(:invalid_issue_tracker_data) do
issue_tracker_data.create!( issue_tracker_data.create!(
service_id: bugzilla_service.id, service_id: bugzilla_integration.id,
encrypted_issues_url: 'http:url.com', encrypted_issues_url: 'http:url.com',
encrypted_issues_url_iv: nil encrypted_issues_url_iv: nil
) )
...@@ -86,7 +86,7 @@ RSpec.describe RescheduleMigrateIssueTrackersData do ...@@ -86,7 +86,7 @@ RSpec.describe RescheduleMigrateIssueTrackersData do
let!(:valid_jira_tracker_data) do let!(:valid_jira_tracker_data) do
jira_tracker_data.create!( jira_tracker_data.create!(
service_id: bugzilla_service.id, service_id: bugzilla_integration.id,
encrypted_url: 'http://url.com', encrypted_url: 'http://url.com',
encrypted_url_iv: 'somevalue' encrypted_url_iv: 'somevalue'
) )
...@@ -94,7 +94,7 @@ RSpec.describe RescheduleMigrateIssueTrackersData do ...@@ -94,7 +94,7 @@ RSpec.describe RescheduleMigrateIssueTrackersData do
let!(:invalid_jira_tracker_data) do let!(:invalid_jira_tracker_data) do
jira_tracker_data.create!( jira_tracker_data.create!(
service_id: bugzilla_service.id, service_id: bugzilla_integration.id,
encrypted_url: 'http://url.com', encrypted_url: 'http://url.com',
encrypted_url_iv: nil encrypted_url_iv: nil
) )
......
...@@ -64,7 +64,7 @@ RSpec.describe Project, factory_default: :keep do ...@@ -64,7 +64,7 @@ RSpec.describe Project, factory_default: :keep do
it { is_expected.to have_one(:redmine_service) } it { is_expected.to have_one(:redmine_service) }
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_service) } it { is_expected.to have_one(:custom_issue_tracker_service) }
it { is_expected.to have_one(:bugzilla_service) } it { is_expected.to have_one(:bugzilla_integration) }
it { is_expected.to have_one(:ewm_service) } it { is_expected.to have_one(:ewm_service) }
it { is_expected.to have_one(:external_wiki_service) } it { is_expected.to have_one(:external_wiki_service) }
it { is_expected.to have_one(:confluence_service) } it { is_expected.to have_one(:confluence_service) }
......
...@@ -8,7 +8,7 @@ RSpec.describe 'query Jira service' do ...@@ -8,7 +8,7 @@ RSpec.describe 'query Jira service' do
let_it_be(:current_user) { create(:user) } let_it_be(:current_user) { create(:user) }
let_it_be(:project) { create(:project) } let_it_be(:project) { create(:project) }
let_it_be(:jira_service) { create(:jira_service, project: project) } let_it_be(:jira_service) { create(:jira_service, project: project) }
let_it_be(:bugzilla_service) { create(:bugzilla_service, 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_service) { create(:redmine_service, project: project) }
let(:query) do let(:query) do
......
...@@ -103,7 +103,7 @@ RSpec.describe Issues::CloseService do ...@@ -103,7 +103,7 @@ RSpec.describe Issues::CloseService do
end end
context 'with an active external issue tracker not supporting close_issue' do context 'with an active external issue tracker not supporting close_issue' do
let!(:external_issue_tracker) { create(:bugzilla_service, project: project) } let!(:external_issue_tracker) { create(:bugzilla_integration, project: project) }
it 'does not close the issue on the external issue tracker' do it 'does not close the issue on the external issue tracker' do
project.reload project.reload
......
...@@ -735,7 +735,7 @@ RSpec.describe ::SystemNotes::IssuablesService do ...@@ -735,7 +735,7 @@ RSpec.describe ::SystemNotes::IssuablesService do
end end
it 'is true with issue tracker not supporting referencing' do it 'is true with issue tracker not supporting referencing' do
create(:bugzilla_service, project: project) create(:bugzilla_integration, project: project)
project.reload project.reload
expect(service.cross_reference_disallowed?(noteable)).to be_truthy expect(service.cross_reference_disallowed?(noteable)).to be_truthy
......
...@@ -6,7 +6,7 @@ RSpec.describe PropagateIntegrationInheritWorker do ...@@ -6,7 +6,7 @@ RSpec.describe PropagateIntegrationInheritWorker do
describe '#perform' do describe '#perform' do
let_it_be(:integration) { create(:redmine_service, :instance) } let_it_be(:integration) { create(:redmine_service, :instance) }
let_it_be(:integration1) { create(:redmine_service, inherit_from_id: integration.id) } let_it_be(:integration1) { create(:redmine_service, inherit_from_id: integration.id) }
let_it_be(:integration2) { create(:bugzilla_service, 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_service) }
it_behaves_like 'an idempotent worker' do it_behaves_like 'an idempotent worker' 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