puppet-community-rangefinder-webhook 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4631ce560cf731fdbb3e6c842240e5a421640cd53b1559b603a03f54629cd7d1
4
- data.tar.gz: ff76e5b43713f753efd50388ebeb4035ef133e9b9516dc36f72ef9da1d2db1cf
3
+ metadata.gz: ef7ddc103f99dd6467e3eb219847e1a8d5976133ee118b77eea9dc0a30e8c0d1
4
+ data.tar.gz: 6c0dc61f6c7389722da76f642ed7fde664580486654d67109471d380f4d6a3e7
5
5
  SHA512:
6
- metadata.gz: '0034868fbf65995ad3649d7dd8d5b28fbe739b282aadfa7c095925eaac7721a918e1b7133a2de8795efa4fa1b38891489f81ae73b86c4ce06f177e8665e8b894'
7
- data.tar.gz: 87b437db1ad3c33a17cc09302c97119977d8b9663225c26dfc6591e87073d890ec13baf7e7b927f7d81dd309aed92df538d48886693593a05b1c8e863a7c5224
6
+ metadata.gz: f718c1bb85d95de3f2b564fc4fdbd7f486115b2aa7790499574d81739923adcc9f1947446f0322831f4f34e60a1a17c948381eab52f8acd6f06ae6398408efb8
7
+ data.tar.gz: 16efde15c4e7280cbcd2375f75c209e8b5f3b1e83c527d0f35c9d82899382136b51b594c35ab3f14139eca24891f6c81c87d7aa4bcffb963654e01e39b0fb94e
@@ -1,3 +1,9 @@
1
+ # v0.0.2
2
+
3
+ * Check against the base repo instead of head
4
+ * A bit more error handling
5
+
6
+
1
7
  # v0.0.1
2
8
 
3
9
  * Initial release.
@@ -71,10 +71,16 @@ class Rangefinder::Webhook < Sinatra::Base
71
71
 
72
72
  helpers do
73
73
  def scan_for_impact(payload)
74
- repo = payload.dig('pull_request', 'head', 'repo', 'full_name')
75
- idx = payload.dig('pull_request', 'number')
76
- files = @installation_client.pull_request_files(repo, idx)
77
- paths = files.map {|file| file[:filename] }
74
+ begin
75
+ repo = payload.dig('pull_request', 'base', 'repo', 'full_name')
76
+ idx = payload.dig('pull_request', 'number')
77
+ files = @installation_client.pull_request_files(repo, idx)
78
+ paths = files.map {|file| file[:filename] }
79
+ rescue => e
80
+ $logger.error "Problem retrieving file list from PR: #{e.message}"
81
+ $logger.debug e.backtrace.join("\n")
82
+ return
83
+ end
78
84
 
79
85
  Dir.mktmpdir do |dir|
80
86
  Dir.chdir(dir) do
@@ -1,5 +1,5 @@
1
1
  require 'rangefinder/version'
2
2
  class Rangefinder::Webhook
3
- VERSION = '0.0.1'
3
+ VERSION = '0.0.2'
4
4
  end
5
5
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-community-rangefinder-webhook
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Ford
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-19 00:00:00.000000000 Z
11
+ date: 2018-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra