diff --git a/lib/travis/scheduler/serialize/worker.rb b/lib/travis/scheduler/serialize/worker.rb index c2107d28..d659eff4 100644 --- a/lib/travis/scheduler/serialize/worker.rb +++ b/lib/travis/scheduler/serialize/worker.rb @@ -69,6 +69,7 @@ def job_data pull_request_head_branch: request.pull_request_head_ref, pull_request_head_sha: request.pull_request_head_sha, pull_request_head_slug: request.pull_request_head_slug, + pull_request_title: request.pull_request_title, ) end data diff --git a/lib/travis/scheduler/serialize/worker/request.rb b/lib/travis/scheduler/serialize/worker/request.rb index 4d8d7470..f6d01455 100644 --- a/lib/travis/scheduler/serialize/worker/request.rb +++ b/lib/travis/scheduler/serialize/worker/request.rb @@ -21,6 +21,10 @@ def pull_request_head_slug pull_request ? pull_request.head_repo_slug : pull_request_head_repo['full_name'] end + def pull_request_title + pull_request ? pull_request.title : pull_request_head['title'] + end + private # TODO remove once we've backfilled the pull_requests table diff --git a/spec/travis/scheduler/serialize/worker_spec.rb b/spec/travis/scheduler/serialize/worker_spec.rb index 3b2d314e..05d2721c 100644 --- a/spec/travis/scheduler/serialize/worker_spec.rb +++ b/spec/travis/scheduler/serialize/worker_spec.rb @@ -199,7 +199,7 @@ def encrypted(value) let(:ref) { 'refs/pull/180/merge' } let(:pr_number) { 180 } let(:payload) { { 'pull_request' => { 'head' => { 'ref' => 'head_branch', 'sha' => '62aaef', 'repo' => {'full_name' => 'travis-ci/gem-release'} } } } } - let(:pull_request) { PullRequest.create(head_ref: 'head_branch', head_repo_slug: 'travis-ci/gem-release') } + let(:pull_request) { PullRequest.create(head_ref: 'head_branch', head_repo_slug: 'travis-ci/gem-release', title: 'Awesome pull request') } before { request.update_attributes(pull_request: pull_request, base_commit: '0cd9ff', head_commit: '62aaef') } @@ -235,6 +235,7 @@ def encrypted(value) pull_request_head_branch: 'head_branch', pull_request_head_sha: '62aaef', pull_request_head_slug: 'travis-ci/gem-release', + pull_request_title: 'Awesome pull request', allow_failure: allow_failure, stage_name: nil, name: 'jobname',