Skip to content
Snippets Groups Projects
Verified Commit e0a15da3 authored by Rémy Coutable's avatar Rémy Coutable
Browse files

tooling: Remove the Job class and 'waiting on job' logic as it's unused


Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent f812c5c0
No related branches found
No related tags found
1 merge request!110064ci: Remove dead code from scripts/trigger-build.rb
......@@ -33,7 +33,7 @@ def self.access_token
ENV['GITLAB_BOT_MULTI_PROJECT_PIPELINE_POLLING_TOKEN']
end
def invoke!(downstream_job_name: nil)
def invoke!
pipeline_variables = variables
puts "Triggering downstream pipeline on #{downstream_project_path}"
......@@ -48,18 +48,7 @@ def invoke!(downstream_job_name: nil)
puts "Triggered downstream pipeline: #{pipeline.web_url}\n"
puts "Waiting for downstream pipeline status"
downstream_job =
if downstream_job_name
downstream_client.pipeline_jobs(downstream_project_path, pipeline.id).auto_paginate.find do |potential_job|
potential_job.name == downstream_job_name
end
end
if downstream_job
Trigger::Job.new(downstream_project_path, downstream_job.id, downstream_client)
else
Trigger::Pipeline.new(downstream_project_path, pipeline.id, downstream_client)
end
Trigger::Pipeline.new(downstream_project_path, pipeline.id, downstream_client)
end
def variables
......@@ -321,7 +310,7 @@ def display_success_message
class DatabaseTesting < Base
IDENTIFIABLE_NOTE_TAG = 'gitlab-org/database-team/gitlab-com-database-testing:identifiable-note'
def invoke!(downstream_job_name: nil)
def invoke!
pipeline = super
project_path = variables['TOP_UPSTREAM_SOURCE_PROJECT']
merge_request_id = variables['TOP_UPSTREAM_MERGE_REQUEST_IID']
......@@ -438,8 +427,6 @@ def status
attr_reader :project, :gitlab_client, :start_time
end
Job = Class.new(Pipeline)
end
if $PROGRAM_NAME == __FILE__
......
......@@ -114,25 +114,6 @@ def ref_param_name
subject.invoke!
end
context 'with downstream_job_name: "foo"' do
let(:downstream_job) { Struct.new(:id, :name).new(42, 'foo') }
let(:paginated_resources) { Struct.new(:auto_paginate).new([downstream_job]) }
before do
stub_env('CI_COMMIT_REF_NAME', "#{ref}-ee")
end
it 'fetches the downstream job' do
expect_run_trigger_with_params
expect(downstream_gitlab_client).to receive(:pipeline_jobs)
.with(downstream_project_path, stubbed_pipeline.id).and_return(paginated_resources)
expect(Trigger::Job).to receive(:new)
.with(downstream_project_path, downstream_job.id, downstream_gitlab_client)
subject.invoke!(downstream_job_name: 'foo')
end
end
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment