puppet-community-rangefinder-webhook 0.0.6.1 → 0.0.7

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: 8872284ad051b92ba6b526b725e9998bbeb0878f68d6b19a1bd96b33ed5f8365
4
- data.tar.gz: 93ee34d248e08a1c99aa7e1f93b6d3f96b25f78b3a2f0dc61be8a2ce7d8a1d55
3
+ metadata.gz: d73e5173657dae1253bfa073d424c3ccdc322e8d3f34542b2b0d50f1f2308f0e
4
+ data.tar.gz: 3a70e3100563497d1b4bc6063737ff07f70508d7b498d12129de03cc67989b7b
5
5
  SHA512:
6
- metadata.gz: 550e263e9657425654e2cb2ef134f514d58f399f622eef0ab9b043531fa320b8488ab5469c40021ca4da1d79b25285e3b544419a6736dda9fa2b7622131edf3c
7
- data.tar.gz: 7eaf6be60efab5391efd4a01f24fb50fc3b136c47791ce9515740a8d648e64ba6263749ea56c7e64e23be1ede3350ca0cd22e03aaf307e79dfb853faec59e423
6
+ metadata.gz: 476fe5720d1380f9e7e73f90e40ccce9aa759e6375a099ace9243e7d514002254162af016597ed400d4681e242997c42f0d0f95387f0f11c6cc348b528be425b
7
+ data.tar.gz: 8592e2d2702a7c73f46a16f57648840e0fd0b1b7be041072f727065d70a03d088a03fa32ebfe9e68ac9564ce15c8613a3301d43845e17d29e9924468b1e117a7
@@ -1,3 +1,11 @@
1
+ # v0.0.7
2
+
3
+ Validate and bail out early if the repository is not actually a Puppet module.
4
+ This is identified simply by the presence of a `metadata.json` file. This will
5
+ allow an org to enable the webhook for all repositories and it will just ignore
6
+ non-module repos.
7
+
8
+
1
9
  # v0.0.6.1
2
10
 
3
11
  Fixed a crasher when encountering unhandled filetypes.
@@ -78,8 +78,17 @@ class Rangefinder::Webhook < Sinatra::Base
78
78
  begin
79
79
  repo = payload.dig('pull_request', 'base', 'repo', 'full_name')
80
80
  idx = payload.dig('pull_request', 'number')
81
+
82
+ # And let's validate that it's actually a Puppet module in the first place!
83
+ @installation_client.contents(repo, :path => 'metadata.json')
84
+
81
85
  files = @installation_client.pull_request_files(repo, idx)
82
86
  paths = files.map {|file| file[:filename] }
87
+
88
+ rescue Octokit::NotFound
89
+ $logger.info "Not a Puppet module: #{repo}"
90
+ return
91
+
83
92
  rescue => e
84
93
  $logger.error "Problem retrieving file list from PR: #{e.message}"
85
94
  $logger.debug e.backtrace.join("\n")
@@ -1,5 +1,5 @@
1
1
  require 'rangefinder/version' # this is the Rangefinder version, not the Webhook!
2
2
  class Rangefinder::Webhook
3
- VERSION = '0.0.6.1'
3
+ VERSION = '0.0.7'
4
4
  end
5
5
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-community-rangefinder-webhook
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6.1
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Ford