Commit 8f0eabed authored by Alex Kalderimis's avatar Alex Kalderimis

Rename drone_ci_service to drone_ci_integration

Renames project association from drone_ci_service to
drone_ci_integration.
parent 14b0cb06
......@@ -43,7 +43,7 @@ class Integration < ApplicationRecord
asana assembla
bamboo bugzilla buildkite
campfire confluence custom_issue_tracker
datadog
datadog discord drone_ci
].to_set.freeze
serialize :properties, JSON # rubocop:disable Cop/ActiveRecordSerialize
......
......@@ -156,8 +156,8 @@ class Project < ApplicationRecord
has_one :confluence_integration, class_name: 'Integrations::Confluence'
has_one :custom_issue_tracker_integration, class_name: 'Integrations::CustomIssueTracker'
has_one :datadog_integration, class_name: 'Integrations::Datadog'
has_one :discord_service, class_name: 'Integrations::Discord'
has_one :drone_ci_service, class_name: 'Integrations::DroneCi'
has_one :discord_integration, class_name: 'Integrations::Discord'
has_one :drone_ci_integration, class_name: 'Integrations::DroneCi'
has_one :emails_on_push_service, class_name: 'Integrations::EmailsOnPush'
has_one :ewm_service, class_name: 'Integrations::Ewm'
has_one :external_wiki_service, class_name: 'Integrations::ExternalWiki'
......
......@@ -5,13 +5,13 @@ require 'spec_helper'
RSpec.describe Projects::ServiceHookLogsController do
let(:project) { create(:project, :repository) }
let(:user) { create(:user) }
let(:service) { create(:drone_ci_service, project: project) }
let(:log) { create(:web_hook_log, web_hook: service.service_hook) }
let(:integration) { create(:drone_ci_integration, project: project) }
let(:log) { create(:web_hook_log, web_hook: integration.service_hook) }
let(:log_params) do
{
namespace_id: project.namespace,
project_id: project,
service_id: service.to_param,
service_id: integration.to_param,
id: log.id
}
end
......@@ -35,7 +35,7 @@ RSpec.describe Projects::ServiceHookLogsController do
it 'executes the hook and redirects to the service form' do
expect_any_instance_of(ServiceHook).to receive(:execute)
expect_any_instance_of(described_class).to receive(:set_hook_execution_notice)
expect(subject).to redirect_to(edit_project_service_path(project, service))
expect(subject).to redirect_to(edit_project_service_path(project, integration))
end
end
end
......@@ -38,7 +38,7 @@ FactoryBot.define do
end
end
factory :drone_ci_service, class: 'Integrations::DroneCi' do
factory :drone_ci_integration, class: 'Integrations::DroneCi' do
project
active { true }
drone_url { 'https://bamboo.example.com' }
......
......@@ -9,7 +9,7 @@ RSpec.describe Types::Projects::ServiceType do
it 'resolves the corresponding type for objects' do
expect(described_class.resolve_type(build(:jira_service), {})).to eq(Types::Projects::Services::JiraServiceType)
expect(described_class.resolve_type(build(:service), {})).to eq(Types::Projects::Services::BaseServiceType)
expect(described_class.resolve_type(build(:drone_ci_service), {})).to eq(Types::Projects::Services::BaseServiceType)
expect(described_class.resolve_type(build(:drone_ci_integration), {})).to eq(Types::Projects::Services::BaseServiceType)
expect(described_class.resolve_type(build(:custom_issue_tracker_integration), {})).to eq(Types::Projects::Services::BaseServiceType)
end
end
......
......@@ -196,8 +196,8 @@ RSpec.describe Gitlab::Auth, :use_clean_rails_memory_store_caching do
end
it 'recognizes other ci services' do
project.create_drone_ci_service(active: true)
project.drone_ci_service.update(token: 'token')
project.create_drone_ci_integration(active: true)
project.drone_ci_integration.update!(token: 'token')
expect(gl_auth.find_for_git_client('drone-ci-token', 'token', project: project, ip: 'ip')).to eq(Gitlab::Auth::Result.new(nil, project, :ci, described_class.build_authentication_abilities))
end
......
......@@ -364,8 +364,8 @@ project:
- campfire_integration
- confluence_integration
- datadog_integration
- discord_service
- drone_ci_service
- discord_integration
- drone_ci_integration
- emails_on_push_service
- pipelines_email_service
- mattermost_slash_commands_service
......
......@@ -31,7 +31,7 @@ RSpec.describe Integrations::DroneCi, :use_clean_rails_memory_store_caching do
end
end
shared_context :drone_ci_service do
shared_context :drone_ci_integration do
let(:drone) { described_class.new }
let(:project) { create(:project, :repository, name: 'project') }
let(:path) { project.full_path }
......@@ -67,14 +67,14 @@ RSpec.describe Integrations::DroneCi, :use_clean_rails_memory_store_caching do
end
describe "service page/path methods" do
include_context :drone_ci_service
include_context :drone_ci_integration
it { expect(drone.build_page(sha, branch)).to eq(build_page) }
it { expect(drone.commit_status_path(sha, branch)).to eq(commit_status_path) }
end
describe '#commit_status' do
include_context :drone_ci_service
include_context :drone_ci_integration
it 'returns the contents of the reactive cache' do
stub_reactive_cache(drone, { commit_status: 'foo' }, 'sha', 'ref')
......@@ -84,7 +84,7 @@ RSpec.describe Integrations::DroneCi, :use_clean_rails_memory_store_caching do
end
describe '#calculate_reactive_cache' do
include_context :drone_ci_service
include_context :drone_ci_integration
describe '#commit_status' do
subject { drone.calculate_reactive_cache(sha, branch)[:commit_status] }
......@@ -130,7 +130,7 @@ RSpec.describe Integrations::DroneCi, :use_clean_rails_memory_store_caching do
end
describe "execute" do
include_context :drone_ci_service
include_context :drone_ci_integration
let(:user) { create(:user, username: 'username') }
let(:push_sample_data) do
......
......@@ -47,8 +47,8 @@ RSpec.describe Project, factory_default: :keep do
it { is_expected.to have_many(:boards) }
it { is_expected.to have_one(:campfire_integration) }
it { is_expected.to have_one(:datadog_integration) }
it { is_expected.to have_one(:discord_service) }
it { is_expected.to have_one(:drone_ci_service) }
it { is_expected.to have_one(:discord_integration) }
it { is_expected.to have_one(:drone_ci_integration) }
it { is_expected.to have_one(:emails_on_push_service) }
it { is_expected.to have_one(:pipelines_email_service) }
it { is_expected.to have_one(:irker_service) }
......
......@@ -4,15 +4,15 @@ require 'spec_helper'
RSpec.describe ServiceHookPresenter do
let(:web_hook_log) { create(:web_hook_log, web_hook: service_hook) }
let(:service_hook) { create(:service_hook, integration: service) }
let(:service) { create(:drone_ci_service, project: project) }
let(:service_hook) { create(:service_hook, integration: integration) }
let(:integration) { create(:drone_ci_integration, project: project) }
let(:project) { create(:project) }
describe '#logs_details_path' do
subject { service_hook.present.logs_details_path(web_hook_log) }
let(:expected_path) do
"/#{project.namespace.path}/#{project.name}/-/services/#{service.to_param}/hook_logs/#{web_hook_log.id}"
"/#{project.namespace.path}/#{project.name}/-/services/#{integration.to_param}/hook_logs/#{web_hook_log.id}"
end
it { is_expected.to eq(expected_path) }
......@@ -22,7 +22,7 @@ RSpec.describe ServiceHookPresenter do
subject { service_hook.present.logs_retry_path(web_hook_log) }
let(:expected_path) do
"/#{project.namespace.path}/#{project.name}/-/services/#{service.to_param}/hook_logs/#{web_hook_log.id}/retry"
"/#{project.namespace.path}/#{project.name}/-/services/#{integration.to_param}/hook_logs/#{web_hook_log.id}/retry"
end
it { is_expected.to eq(expected_path) }
......
......@@ -18,10 +18,10 @@ RSpec.describe WebHookLogPresenter do
end
context 'service hook' do
let(:web_hook) { create(:service_hook, integration: service) }
let(:service) { create(:drone_ci_service, project: project) }
let(:web_hook) { create(:service_hook, integration: integration) }
let(:integration) { create(:drone_ci_integration, project: project) }
it { is_expected.to eq(project_service_hook_log_path(project, service, web_hook_log)) }
it { is_expected.to eq(project_service_hook_log_path(project, integration, web_hook_log)) }
end
end
......@@ -38,10 +38,10 @@ RSpec.describe WebHookLogPresenter do
end
context 'service hook' do
let(:web_hook) { create(:service_hook, integration: service) }
let(:service) { create(:drone_ci_service, project: project) }
let(:web_hook) { create(:service_hook, integration: integration) }
let(:integration) { create(:drone_ci_integration, project: project) }
it { is_expected.to eq(retry_project_service_hook_log_path(project, service, web_hook_log)) }
it { is_expected.to eq(retry_project_service_hook_log_path(project, integration, web_hook_log)) }
end
end
end
......@@ -3,7 +3,7 @@
require 'spec_helper'
RSpec.describe 'projects/services/edit' do
let(:integration) { create(:drone_ci_service, project: project) }
let(:integration) { create(:drone_ci_integration, project: project) }
let(:project) { create(:project) }
before 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