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 +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/rangefinder/webhook.rb +9 -0
- data/lib/rangefinder/webhook/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d73e5173657dae1253bfa073d424c3ccdc322e8d3f34542b2b0d50f1f2308f0e
|
4
|
+
data.tar.gz: 3a70e3100563497d1b4bc6063737ff07f70508d7b498d12129de03cc67989b7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 476fe5720d1380f9e7e73f90e40ccce9aa759e6375a099ace9243e7d514002254162af016597ed400d4681e242997c42f0d0f95387f0f11c6cc348b528be425b
|
7
|
+
data.tar.gz: 8592e2d2702a7c73f46a16f57648840e0fd0b1b7be041072f727065d70a03d088a03fa32ebfe9e68ac9564ce15c8613a3301d43845e17d29e9924468b1e117a7
|
data/CHANGELOG.md
CHANGED
@@ -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.
|
data/lib/rangefinder/webhook.rb
CHANGED
@@ -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")
|