From 7d3795081148bd5b22085175e718ce4faad94233 Mon Sep 17 00:00:00 2001 From: Mathias Meyer Date: Fri, 4 Oct 2013 12:39:13 +0200 Subject: [PATCH] Log head commit and commit ids properly for push. --- lib/travis/listener/app.rb | 6 ++++-- spec/payloads.rb | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/travis/listener/app.rb b/lib/travis/listener/app.rb index 18ce846..803b5f2 100644 --- a/lib/travis/listener/app.rb +++ b/lib/travis/listener/app.rb @@ -79,9 +79,9 @@ def valid_ips def handle_event return unless handle_event? + debug "Request created: #{payload.inspect}" info "uuid=#{uuid} delivery_guid=#{delivery_guid} type=#{event_type} repository=#{slug} #{event_details}" Travis::Sidekiq::BuildRequest.perform_async(data) - debug "Request created: #{payload.inspect}" end def handle_event? @@ -111,7 +111,9 @@ def event_details if event_type == 'pull_request' "number=#{decoded_payload['number']} action=#{decoded_payload['action']} source=#{decoded_payload['pull_request']['head']['repo']['full_name']} head=#{decoded_payload['pull_request']['head']['sha'][0..6]} ref=#{decoded_payload['pull_request']['head']['ref']} user=#{decoded_payload['pull_request']['user']['login']}" else - "ref=#{decoded_payload['ref'][0..6]} head=#{decoded_payload['head']} commits=#{decoded_payload["commits"].map {|c| c['sha'][0..6]}.join(",")}" + "ref=#{decoded_payload['ref']} " + + "head=#{decoded_payload['head_commit']['id']} " + "commits=#{decoded_payload["commits"].map {|c| c['id'][0..6]}.join(",")}" end end diff --git a/spec/payloads.rb b/spec/payloads.rb index 641ce3f..0b14d43 100644 --- a/spec/payloads.rb +++ b/spec/payloads.rb @@ -8,6 +8,10 @@ "name": "svenfuchs" } }, + "head_commit": { + "id": "9854592", + "message": "Bump to 0.0.15" + }, "commits": [{ "id": "9854592", "message": "Bump to 0.0.15",