From 4cbdba85829bac0aa4a273c154680f4be01dc2f5 Mon Sep 17 00:00:00 2001 From: Denis Rouzaud Date: Fri, 2 Mar 2018 21:55:45 -0400 Subject: [PATCH 1/4] add pull request title to worker --- lib/travis/scheduler/serialize/worker.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/travis/scheduler/serialize/worker.rb b/lib/travis/scheduler/serialize/worker.rb index 079c62ef..aab6b0c0 100644 --- a/lib/travis/scheduler/serialize/worker.rb +++ b/lib/travis/scheduler/serialize/worker.rb @@ -61,6 +61,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 From 6fc8c9b57cae100e67b1990ad88e821a986abce2 Mon Sep 17 00:00:00 2001 From: Denis Rouzaud Date: Fri, 2 Mar 2018 22:04:10 -0400 Subject: [PATCH 2/4] Update request.rb --- lib/travis/scheduler/serialize/worker/request.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/travis/scheduler/serialize/worker/request.rb b/lib/travis/scheduler/serialize/worker/request.rb index 4d8d7470..053ac80d 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.head_repo_title : pull_request_head_repo['title'] + end + private # TODO remove once we've backfilled the pull_requests table From 3bda40b736ff4c60e65ec4545877b6b61db46ce7 Mon Sep 17 00:00:00 2001 From: Denis Rouzaud Date: Fri, 2 Mar 2018 22:11:06 -0400 Subject: [PATCH 3/4] Update request.rb --- lib/travis/scheduler/serialize/worker/request.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/travis/scheduler/serialize/worker/request.rb b/lib/travis/scheduler/serialize/worker/request.rb index 053ac80d..f6d01455 100644 --- a/lib/travis/scheduler/serialize/worker/request.rb +++ b/lib/travis/scheduler/serialize/worker/request.rb @@ -22,7 +22,7 @@ def pull_request_head_slug end def pull_request_title - pull_request ? pull_request.head_repo_title : pull_request_head_repo['title'] + pull_request ? pull_request.title : pull_request_head['title'] end private From db3a17197eb41d45eee7a8d8ad9ad647b6b4996a Mon Sep 17 00:00:00 2001 From: Hiro Asari Date: Thu, 15 Nov 2018 17:02:34 -0500 Subject: [PATCH 4/4] Fix worker_spec.rb --- spec/travis/scheduler/serialize/worker_spec.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/travis/scheduler/serialize/worker_spec.rb b/spec/travis/scheduler/serialize/worker_spec.rb index bec5b42d..af0f247e 100644 --- a/spec/travis/scheduler/serialize/worker_spec.rb +++ b/spec/travis/scheduler/serialize/worker_spec.rb @@ -185,7 +185,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') } @@ -219,6 +219,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 }, source: {