puppet-community-rangefinder 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 +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +11 -6
- data/lib/rangefinder/bigquery.rb +7 -5
- data/lib/rangefinder/version.rb +1 -1
- metadata +12 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ca220be6aa4a132ea5446370c2be2e02fa5d4d391026eea586e24636f6010c8
|
4
|
+
data.tar.gz: 3aa913744e8abc0a9425ebe22e3dea4a32c957e1382df8eedda2c4241d055bbb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 865fc5f2c07268fb2dcb18e23b1ac56eb9b700008fde3cdadf663470c9410a4fc85faa61242adb9c46b1c19c6c2977390216b18140636694070b8158f6d07ed2
|
7
|
+
data.tar.gz: d65542c4505d25adee4058818240870cdce74a0dd1a2ef04bb5178cf673a476a6f2870a07c68cd3afc834ce4b051cb3ec3f0de00976b4d8166b7fd5a4b5ea61c
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -5,12 +5,17 @@ Predicts downstream impact of breaking file changes
|
|
5
5
|
|
6
6
|
Rangefinder provides a command that can infer what a file defines and then tell
|
7
7
|
you what Forge modules use it. In other words, if you change the interface
|
8
|
-
provided by that file -- this will tell you what Forge modules must adapt to
|
8
|
+
provided by that file -- this will tell you what Forge modules must adapt to
|
9
|
+
that change.
|
10
|
+
|
11
|
+
If the file being evaluated is part of a Puppet module, then Rangefinder will
|
12
|
+
use that module's `metadata.json` to identify the name, and then use it to
|
13
|
+
fine-tune the way the results are presented.
|
9
14
|
|
10
15
|
It will separate output by the modules that we *know* will be impacted and those
|
11
16
|
which we can only *guess* that will be impacted. We can tell the difference based
|
12
|
-
on whether the impacted module has properly described dependencies in their
|
13
|
-
`metadata.json
|
17
|
+
on whether the impacted module has properly described dependencies in their own
|
18
|
+
`metadata.json` and whether `rangefinder` can figure out a dependency match.
|
14
19
|
|
15
20
|
This currently knows how to interpret and look up:
|
16
21
|
|
@@ -41,9 +46,9 @@ Contact [me](mailto:ben.ford@puppet.com) for credentials.
|
|
41
46
|
|
42
47
|
## Running
|
43
48
|
|
44
|
-
Just run the `rangefinder` command with a list of files
|
45
|
-
|
46
|
-
|
49
|
+
Just run the `rangefinder` command with a list of files. If it knows what the
|
50
|
+
file defines, then it will print out a list of Forge modules that use the thing
|
51
|
+
defined by that file.
|
47
52
|
|
48
53
|
You can also `--render-as` either `json` or `yaml`.
|
49
54
|
|
data/lib/rangefinder/bigquery.rb
CHANGED
@@ -17,7 +17,7 @@ class Rangefinder::Bigquery
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def find(namespace, kind, name)
|
20
|
-
sql = "SELECT module, i.source, m.source AS repo
|
20
|
+
sql = "SELECT DISTINCT module, i.source, m.source AS repo
|
21
21
|
FROM `bto-dataops-datalake-prod.community.forge_itemized` AS i
|
22
22
|
JOIN `bto-dataops-datalake-prod.community.forge_modules` AS m
|
23
23
|
ON m.slug = i.module
|
@@ -25,11 +25,13 @@ class Rangefinder::Bigquery
|
|
25
25
|
|
26
26
|
data = @dataset.query(sql, params: {kind: kind.to_s, name: name})
|
27
27
|
|
28
|
+
exact, near = data.partition {|row| row[:source] == namespace and not namespace.nil?}
|
29
|
+
|
28
30
|
{
|
29
|
-
:kind
|
30
|
-
:name
|
31
|
-
:exact =>
|
32
|
-
:near =>
|
31
|
+
:kind => kind,
|
32
|
+
:name => name,
|
33
|
+
:exact => exact,
|
34
|
+
:near => near,
|
33
35
|
}
|
34
36
|
end
|
35
37
|
end
|
data/lib/rangefinder/version.rb
CHANGED
metadata
CHANGED
@@ -1,41 +1,47 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet-community-rangefinder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
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-
|
11
|
+
date: 2018-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: puppet
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '5.0'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '7.0'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: '5.0'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '7.0'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: google-cloud-bigquery
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
31
|
-
- - "
|
37
|
+
- - "~>"
|
32
38
|
- !ruby/object:Gem::Version
|
33
39
|
version: '1.0'
|
34
40
|
type: :runtime
|
35
41
|
prerelease: false
|
36
42
|
version_requirements: !ruby/object:Gem::Requirement
|
37
43
|
requirements:
|
38
|
-
- - "
|
44
|
+
- - "~>"
|
39
45
|
- !ruby/object:Gem::Version
|
40
46
|
version: '1.0'
|
41
47
|
description: |2
|