puppet-community-rangefinder 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +3 -0
- data/LICENSE +201 -0
- data/README.md +354 -0
- data/bin/rangefinder +61 -0
- data/lib/rangefinder.rb +96 -0
- data/lib/rangefinder/bigquery.rb +35 -0
- data/lib/rangefinder/parser.rb +4 -0
- data/lib/rangefinder/parser/puppet.rb +33 -0
- data/lib/rangefinder/parser/ruby.rb +22 -0
- data/lib/rangefinder/version.rb +3 -0
- metadata +91 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 7986044b95869bd79c6a178eaca3144fd1e51ee9a3b03ade69f6d35defea98c1
|
4
|
+
data.tar.gz: 9dd7301b92a27c9e10ac645e07bbbfc4729c46389338072511ea9f2ded204ecf
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 693ebb9f951938e2da629f8d6cf85e5843bcdea5d2a11a69de0f93a23641fed57cd92dfe7c31e1ccbd11ec745898bdf840639ef4e77dffa617067ef607bccdf4
|
7
|
+
data.tar.gz: a74f95290fe024d045548783d8293cae30d2e25e7dd73d7f428ef3752f00a17635e53a57082e4f78090313347035ea676b1d7f3c3ae46e80c36d96a333208374
|
data/CHANGELOG.md
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,201 @@
|
|
1
|
+
Apache License
|
2
|
+
Version 2.0, January 2004
|
3
|
+
http://www.apache.org/licenses/
|
4
|
+
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
6
|
+
|
7
|
+
1. Definitions.
|
8
|
+
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
11
|
+
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
13
|
+
the copyright owner that is granting the License.
|
14
|
+
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
16
|
+
other entities that control, are controlled by, or are under common
|
17
|
+
control with that entity. For the purposes of this definition,
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
19
|
+
direction or management of such entity, whether by contract or
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
22
|
+
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
24
|
+
exercising permissions granted by this License.
|
25
|
+
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
27
|
+
including but not limited to software source code, documentation
|
28
|
+
source, and configuration files.
|
29
|
+
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
31
|
+
transformation or translation of a Source form, including but
|
32
|
+
not limited to compiled object code, generated documentation,
|
33
|
+
and conversions to other media types.
|
34
|
+
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
36
|
+
Object form, made available under the License, as indicated by a
|
37
|
+
copyright notice that is included in or attached to the work
|
38
|
+
(an example is provided in the Appendix below).
|
39
|
+
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
46
|
+
the Work and Derivative Works thereof.
|
47
|
+
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
49
|
+
the original version of the Work and any modifications or additions
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
61
|
+
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
64
|
+
subsequently incorporated within the Work.
|
65
|
+
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
72
|
+
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
78
|
+
where such license applies only to those patent claims licensable
|
79
|
+
by such Contributor that are necessarily infringed by their
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
82
|
+
institute patent litigation against any entity (including a
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
85
|
+
or contributory patent infringement, then any patent licenses
|
86
|
+
granted to You under this License for that Work shall terminate
|
87
|
+
as of the date such litigation is filed.
|
88
|
+
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
91
|
+
modifications, and in Source or Object form, provided that You
|
92
|
+
meet the following conditions:
|
93
|
+
|
94
|
+
(a) You must give any other recipients of the Work or
|
95
|
+
Derivative Works a copy of this License; and
|
96
|
+
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
98
|
+
stating that You changed the files; and
|
99
|
+
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
102
|
+
attribution notices from the Source form of the Work,
|
103
|
+
excluding those notices that do not pertain to any part of
|
104
|
+
the Derivative Works; and
|
105
|
+
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
108
|
+
include a readable copy of the attribution notices contained
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
111
|
+
of the following places: within a NOTICE text file distributed
|
112
|
+
as part of the Derivative Works; within the Source form or
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
114
|
+
within a display generated by the Derivative Works, if and
|
115
|
+
wherever such third-party notices normally appear. The contents
|
116
|
+
of the NOTICE file are for informational purposes only and
|
117
|
+
do not modify the License. You may add Your own attribution
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
120
|
+
that such additional attribution notices cannot be construed
|
121
|
+
as modifying the License.
|
122
|
+
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
124
|
+
may provide additional or different license terms and conditions
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
128
|
+
the conditions stated in this License.
|
129
|
+
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
133
|
+
this License, without any additional terms or conditions.
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
135
|
+
the terms of any separate license agreement you may have executed
|
136
|
+
with Licensor regarding such Contributions.
|
137
|
+
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
140
|
+
except as required for reasonable and customary use in describing the
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
142
|
+
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
152
|
+
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
158
|
+
incidental, or consequential damages of any character arising as a
|
159
|
+
result of this License or out of the use or inability to use the
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
162
|
+
other commercial damages or losses), even if such Contributor
|
163
|
+
has been advised of the possibility of such damages.
|
164
|
+
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
168
|
+
or other liability obligations and/or rights consistent with this
|
169
|
+
License. However, in accepting such obligations, You may act only
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
174
|
+
of your accepting any such warranty or additional liability.
|
175
|
+
|
176
|
+
END OF TERMS AND CONDITIONS
|
177
|
+
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
179
|
+
|
180
|
+
To apply the Apache License to your work, attach the following
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "{}"
|
182
|
+
replaced with your own identifying information. (Don't include
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
184
|
+
comment syntax for the file format. We also recommend that a
|
185
|
+
file or class name and description of purpose be included on the
|
186
|
+
same "printed page" as the copyright notice for easier
|
187
|
+
identification within third-party archives.
|
188
|
+
|
189
|
+
Copyright {yyyy} {name of copyright owner}
|
190
|
+
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
192
|
+
you may not use this file except in compliance with the License.
|
193
|
+
You may obtain a copy of the License at
|
194
|
+
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
196
|
+
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
200
|
+
See the License for the specific language governing permissions and
|
201
|
+
limitations under the License.
|
data/README.md
ADDED
@@ -0,0 +1,354 @@
|
|
1
|
+
# Rangefinder
|
2
|
+
Predicts downstream impact of breaking file changes
|
3
|
+
|
4
|
+
## Overview
|
5
|
+
|
6
|
+
Rangefinder provides a command that can infer what a file defines and then tell
|
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 it.
|
9
|
+
|
10
|
+
It will separate output by the modules that we *know* will be impacted and those
|
11
|
+
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`.
|
14
|
+
|
15
|
+
This currently knows how to interpret and look up:
|
16
|
+
|
17
|
+
* Puppet 3.x functions
|
18
|
+
* Puppet 4.x functions
|
19
|
+
* Puppet language functions
|
20
|
+
* Classes
|
21
|
+
* Defined types
|
22
|
+
* Puppet resource types
|
23
|
+
|
24
|
+
|
25
|
+
## Configuration
|
26
|
+
|
27
|
+
You must configure BigQuery credentials in the `~/.rangefinder.conf` file.
|
28
|
+
|
29
|
+
Example configuration:
|
30
|
+
|
31
|
+
```
|
32
|
+
---
|
33
|
+
:gcloud:
|
34
|
+
:dataset: <dataset>
|
35
|
+
:project: <project>
|
36
|
+
:keyfile: ~/.rangefinder/credentials.json
|
37
|
+
```
|
38
|
+
|
39
|
+
Contact [me](mailto:ben.ford@puppet.com) for credentials.
|
40
|
+
|
41
|
+
|
42
|
+
## Running
|
43
|
+
|
44
|
+
Just run the `rangefinder` command with a list of files in a Puppet module. If
|
45
|
+
it knows what the file is, then it will print out a list of Forge modules that
|
46
|
+
use the thing defined by that file.
|
47
|
+
|
48
|
+
You can also `--render-as` either `json` or `yaml`.
|
49
|
+
|
50
|
+
Example:
|
51
|
+
|
52
|
+
```
|
53
|
+
$ rangefinder lib/puppet/functions/mysql/password.rb \
|
54
|
+
lib/puppet/parser/functions/mysql_password.rb \
|
55
|
+
lib/puppet/parser/functions/mysql_strip_hash.rb \
|
56
|
+
lib/puppet/type/mysql_user.rb \
|
57
|
+
manifests/db.pp \
|
58
|
+
manifests/server.pp
|
59
|
+
[mysql::password] is a _function_
|
60
|
+
==================================
|
61
|
+
Breaking changes to this file WILL impact these modules:
|
62
|
+
* edestecd-mariadb (https://github.com/edestecd/puppet-mariadb.git)
|
63
|
+
|
64
|
+
[mysql_password] is a _function_
|
65
|
+
==================================
|
66
|
+
Breaking changes to this file MAY impact these modules:
|
67
|
+
* eshamow-pe_cert_auth (UNKNOWN)
|
68
|
+
* narasimhasv-glance (git or puppet install)
|
69
|
+
* vshn-uhosting (https://github.com/vshn/uhosting)
|
70
|
+
* hfm-mha (git@github.com:hfm/puppet-mha.git)
|
71
|
+
* ULHPC-mysql (https://github.com/ULHPC/puppet-mysql)
|
72
|
+
* ULHPC-slurm (https://github.com/ULHPC/puppet-slurm)
|
73
|
+
* dmexe-rails (http://github.com/dima-exe/puppet-rails)
|
74
|
+
* dmexe-deploy (http://github.com/dima-exe/puppet-deploy)
|
75
|
+
* fraenki-galera (https://github.com/fraenki/puppet-galera)
|
76
|
+
* vStone-percona (https://github.com/vStone/puppet-percona)
|
77
|
+
* openstack-aodh (git://github.com/openstack/puppet-aodh.git)
|
78
|
+
* openstack-heat (git://github.com/openstack/puppet-heat.git)
|
79
|
+
* stackforge-heat (git://github.com/openstack/puppet-heat.git)
|
80
|
+
* openstack-nova (git://github.com/openstack/puppet-nova.git)
|
81
|
+
* stackforge-nova (git://github.com/openstack/puppet-nova.git)
|
82
|
+
* hunner-wordpress (https://github.com/hunner/puppet-wordpress)
|
83
|
+
* johanek-redmine (https://github.com/johanek/johanek-redmine)
|
84
|
+
* midonet-neutron (git://github.com/midonet/puppet-neutron.git)
|
85
|
+
* openstack-trove (git://github.com/openstack/puppet-trove.git)
|
86
|
+
* maxadamo-galera_maxscale (https://github.com/maxadamo/galera_maxscale)
|
87
|
+
* maxadamo-galera_proxysql (https://github.com/maxadamo/galera_proxysql)
|
88
|
+
* mmitchell-puppetlabs_ironic (https://github.com/stackforge/puppet-ironic)
|
89
|
+
* tscopp-jss (https://github.com/tscopp/puppet-jss/issues)
|
90
|
+
* gousto-mysql (git://github.com/Gousto/puppetlabs-mysql.git)
|
91
|
+
* stackforge-cinder (git://github.com/openstack/puppet-cinder.git)
|
92
|
+
* openstack-cinder (git://github.com/openstack/puppet-cinder.git)
|
93
|
+
* openstack-glance (git://github.com/openstack/puppet-glance.git)
|
94
|
+
* stackforge-glance (git://github.com/openstack/puppet-glance.git)
|
95
|
+
* openstack-ironic (git://github.com/openstack/puppet-ironic.git)
|
96
|
+
* openstack-manila (git://github.com/openstack/puppet-manila.git)
|
97
|
+
* openstack-murano (git://github.com/openstack/puppet-murano.git)
|
98
|
+
* openstack-sahara (git://github.com/openstack/puppet-sahara.git)
|
99
|
+
* openstack-tuskar (git://github.com/openstack/puppet-tuskar.git)
|
100
|
+
* devopera-domysqldb (https://github.com/devopera/puppet-domysqldb)
|
101
|
+
* openstack-gnocchi (git://github.com/openstack/puppet-gnocchi.git)
|
102
|
+
* stackforge-neutron (git://github.com/openstack/puppet-neutron.git)
|
103
|
+
* openstack-neutron (git://github.com/openstack/puppet-neutron.git)
|
104
|
+
* lcgdm-voms (https://github.com/cern-it-sdc-id/puppet-voms)
|
105
|
+
* infnpd-creamce (https://github.com/italiangrid/puppet-creamce)
|
106
|
+
* jtopjian-cubbystack (https://github.com/jtopjian/puppet-cubbystack)
|
107
|
+
* openstack-keystone (git://github.com/openstack/puppet-keystone.git)
|
108
|
+
* stackforge-keystone (git://github.com/openstack/puppet-keystone.git)
|
109
|
+
* lcgdm-lcgdm (https://github.com/cern-it-sdc-id/puppet-lcgdm)
|
110
|
+
* wdijkerman-zabbix (https://github.com/dj-wasabi/puppet-zabbix.git)
|
111
|
+
* edestecd-mariadb (https://github.com/edestecd/puppet-mariadb.git)
|
112
|
+
* puppet-zabbix (https://github.com/voxpupuli/puppet-zabbix.git)
|
113
|
+
* openstack-designate (git://github.com/openstack/puppet-designate.git)
|
114
|
+
* brainfinger-dukesbank (git://github.com/teyo/brainfinger-dukesbank.git)
|
115
|
+
* lcgdm-dmlite (https://github.com/cern-it-sdc-id/puppet-dmlite)
|
116
|
+
* neillturner-wordpress (https://github.com/neillturner/puppet-wordpress)
|
117
|
+
* openstack-ceilometer (git://github.com/openstack/puppet-ceilometer.git)
|
118
|
+
* stackforge-ceilometer (git://github.com/openstack/puppet-ceilometer.git)
|
119
|
+
* alanpetersen-moodle (https://github.com/alanpetersen/puppet-moodle.git)
|
120
|
+
* eNovance-cloud (https://github.com/enovance/puppet-openstack-cloud)
|
121
|
+
* reidmv-pe_console (https://github.com/reidmv/puppet-module-pe_console)
|
122
|
+
* Aethylred-puppetdashboard (https://github.com/Aethylred/puppet-puppetdashboard)
|
123
|
+
* mikegleasonjr-wordpress (https://github.com/mikegleasonjr/puppet-wordpress.git)
|
124
|
+
* ploperations-puppet (https://github.com/puppetlabs-operations/puppet-puppet)
|
125
|
+
* puppetlabs-wordpress_app (https://github.com/puppetlabs/puppetlabs-wordpress_app)
|
126
|
+
* nubevps-wordpress (https://forge.puppetlabs.com/nubevps-wordpress/nubevps-wordpress)
|
127
|
+
|
128
|
+
[mysql_strip_hash] is a _function_
|
129
|
+
==================================
|
130
|
+
with no external impact.
|
131
|
+
|
132
|
+
[mysql_user] is a _type_
|
133
|
+
==================================
|
134
|
+
Breaking changes to this file MAY impact these modules:
|
135
|
+
* vshn-uhosting (https://github.com/vshn/uhosting)
|
136
|
+
* hfm-mha (git@github.com:hfm/puppet-mha.git)
|
137
|
+
* ULHPC-slurm (https://github.com/ULHPC/puppet-slurm)
|
138
|
+
* kritz-vagrantlamp (https://github.com/kritznl/vagrantlamp)
|
139
|
+
* fraenki-galera (https://github.com/fraenki/puppet-galera)
|
140
|
+
* vStone-percona (https://github.com/vStone/puppet-percona)
|
141
|
+
* tedivm-hieratic (https://github.com/tedivm/puppet-hieratic)
|
142
|
+
* hunner-wordpress (https://github.com/hunner/puppet-wordpress)
|
143
|
+
* johanek-redmine (https://github.com/johanek/johanek-redmine)
|
144
|
+
* maxadamo-galera_maxscale (https://github.com/maxadamo/galera_maxscale)
|
145
|
+
* maxadamo-galera_proxysql (https://github.com/maxadamo/galera_proxysql)
|
146
|
+
* gousto-mysql (git://github.com/Gousto/puppetlabs-mysql.git)
|
147
|
+
* devopera-domysqldb (https://github.com/devopera/puppet-domysqldb)
|
148
|
+
* infnpd-creamce (https://github.com/italiangrid/puppet-creamce)
|
149
|
+
* jtopjian-cubbystack (https://github.com/jtopjian/puppet-cubbystack)
|
150
|
+
* lcgdm-lcgdm (https://github.com/cern-it-sdc-id/puppet-lcgdm)
|
151
|
+
* wdijkerman-zabbix (https://github.com/dj-wasabi/puppet-zabbix.git)
|
152
|
+
* edestecd-mariadb (https://github.com/edestecd/puppet-mariadb.git)
|
153
|
+
* puppet-zabbix (https://github.com/voxpupuli/puppet-zabbix.git)
|
154
|
+
* lcgdm-dmlite (https://github.com/cern-it-sdc-id/puppet-dmlite)
|
155
|
+
* neillturner-wordpress (https://github.com/neillturner/puppet-wordpress)
|
156
|
+
* puppetlabs-mysql (git://github.com/puppetlabs/puppetlabs-mysql.git)
|
157
|
+
* alanpetersen-moodle (https://github.com/alanpetersen/puppet-moodle.git)
|
158
|
+
* openstack-openstacklib (git://github.com/openstack/puppet-openstacklib.git)
|
159
|
+
* stackforge-openstacklib (git://github.com/openstack/puppet-openstacklib.git)
|
160
|
+
* eNovance-cloud (https://github.com/enovance/puppet-openstack-cloud)
|
161
|
+
* Aethylred-puppetdashboard (https://github.com/Aethylred/puppet-puppetdashboard)
|
162
|
+
* mikegleasonjr-wordpress (https://github.com/mikegleasonjr/puppet-wordpress.git)
|
163
|
+
* puppetlabs-wordpress_app (https://github.com/puppetlabs/puppetlabs-wordpress_app)
|
164
|
+
|
165
|
+
[mysql::db] is a _type_
|
166
|
+
==================================
|
167
|
+
Breaking changes to this file WILL impact these modules:
|
168
|
+
* leonardothibes-usvn (git://github.com/leonardothibes/puppet-usvn.git)
|
169
|
+
* puppetlabs-bacula (http://github.com/puppetlabs/puppetlabs-bacula)
|
170
|
+
* factorit-jasperreports_server (https://github.com/jbbrunsveld/jasperreports_server)
|
171
|
+
* hexmode-mediawiki (git@github.com:hexmode/puppet-mediawiki.git)
|
172
|
+
* cirrax-roundcube (https://github.com/cirrax/puppet-roundcube)
|
173
|
+
* gerardkok-ejbca (https://github.com/gerardkok/puppet-ejbca.git)
|
174
|
+
* dmcnicks-sympa (https://github.com/dmcnicks/dmcnicks-sympa.git)
|
175
|
+
* ccaum-autoami (git://github.com/ccaum/puppet-autoami)
|
176
|
+
* bramwelt-patchwork (https://github.com/bramwelt/puppet-patchwork)
|
177
|
+
* cnwr-cacti (https://github.com/cnwrinc/cnwr-cacti)
|
178
|
+
* sgnl05-racktables (git://github.com/sgnl05/sgnl05-racktables.git)
|
179
|
+
* dsestero-sonarqube (https://github.com/dsestero/sonarqube.git)
|
180
|
+
* desalvo-bacula (https://github.com/desalvo/puppet-bacula)
|
181
|
+
* bodgit-wordpress (https://github.com/bodgit/puppet-wordpress)
|
182
|
+
* fiddyspence-zabbix (https://github.com/fiddyspence/puppet-zabbix)
|
183
|
+
* eelcomaljaars-friendica (https://devtools.maljaars-it.nl/opensource/puppet-friendica.git)
|
184
|
+
* jefferyb-kualicoeus (https://github.com/jefferyb/kualicoeus)
|
185
|
+
* mricon-bugzilla (https://github.com/mricon/puppet-bugzilla)
|
186
|
+
* wyrie-snmptt (https://bitbucket.org/wyrie/puppet-snmptt/src)
|
187
|
+
* stesie-gluon (https://github.com/ffansbach/gluon-puppet)
|
188
|
+
* forj-openfire (https://github.com/forj-oss/puppet-openfire)
|
189
|
+
* jsnshrmn-twlight (https://github.com/WikipediaLibrary/twlight_puppet)
|
190
|
+
* icann-opendnssec (https://github.com/icann-dns/puppet-opendnssec)
|
191
|
+
* shoekstra-owncloud (https://github.com/shoekstra/puppet-owncloud.git)
|
192
|
+
* marcdeop-ratticdb (https://github.com/marcdeop/ratticdb)
|
193
|
+
* samuelson-custom_webapp (https://github.com/samuelson/samuelson-custom_webapp)
|
194
|
+
* hgkamath-owncloud (https://github.com/hgkamath/puppet-owncloud)
|
195
|
+
* wyrie-nagiosql (https://bitbucket.org/wyrie/puppet-nagiosql/src)
|
196
|
+
* tscopp-jss (https://github.com/tscopp/puppet-jss/issues)
|
197
|
+
* treydock-keycloak (git://github.com/treydock/puppet-module-keycloak.git)
|
198
|
+
* cesnet-site_hadoop (https://github.com/MetaCenterCloudPuppet/cesnet-site_hadoop)
|
199
|
+
* alkivi-owncloud (https://github.com/alkivi-sas/puppet-owncloud)
|
200
|
+
* razorsedge-cloudera (https://github.com/razorsedge/puppet-cloudera.git)
|
201
|
+
* SchnWalter-happydev (https://github.com/devgateway/happy-deployer/tree/master/puppet/modules/happydev)
|
202
|
+
* cirrax-postfixadmin (https://github.com/cirrax/puppet-postfixadmin)
|
203
|
+
* martialblog-limesurvey (https://github.com/martialblog/puppet-limesurvey)
|
204
|
+
* binford2k-drupal (https://github.com/binford2k/binford2k-drupal)
|
205
|
+
* lboynton-gitlab (https://github.com/lboynton/puppet-gitlab)
|
206
|
+
* maxadamo-galera_proxysql (https://github.com/maxadamo/galera_proxysql)
|
207
|
+
* mmitchell-puppetlabs_ironic (https://github.com/stackforge/puppet-ironic)
|
208
|
+
* sensson-powerdns (https://github.com/sensson/puppet-powerdns)
|
209
|
+
* ULHPC-slurm (https://github.com/ULHPC/puppet-slurm)
|
210
|
+
* alkivi-zabbix (https://github.com/alkivi-sas/puppet-zabbix)
|
211
|
+
* brucem-ezpublish (git://github.com/brucem/puppet-ezpublish.git)
|
212
|
+
* monkygames-beansbooks (https://bitbucket.org/monkygames/puppet-beansbooks.git)
|
213
|
+
* aimonb-nexusis_gerrit (UNKNOWN)
|
214
|
+
* rharrison-bacula (http://github.com/rharrison10/rharrison-bacula)
|
215
|
+
* gnubilafrance-wisemapping (https://github.com/gnubila-france/puppet-wisemapping)
|
216
|
+
* infnpd-ocpattrauth (https://baltig.infn.it/andreett/puppet-ocp-attribute-authority)
|
217
|
+
* oris-appserver (https://bitbucket.org/oris/env-puppet-module-appserver)
|
218
|
+
* aimonb-nexusis_mediawiki (https://github.com/NexusIS/puppet-mediawiki.git)
|
219
|
+
* martasd-mediawiki (git@github.com:martasd/puppet-mediawiki.git)
|
220
|
+
* firefield-firefield (git@github.com:firefield/basic-rails-server.git)
|
221
|
+
* othalla-nextcloud (https://github.com/othalla/puppet-nextcloud.git)
|
222
|
+
* gnubilafrance-redmine (https://github.com/gnubila-france/puppet-redmine)
|
223
|
+
* wdijkerman-zabbix (https://github.com/dj-wasabi/puppet-zabbix.git)
|
224
|
+
* puppet-zabbix (https://github.com/voxpupuli/puppet-zabbix.git)
|
225
|
+
* geoffwilliams-r_profile (https://github.com/GeoffWilliams/r_profile)
|
226
|
+
|
227
|
+
Breaking changes to this file MAY impact these modules:
|
228
|
+
* abaranov-sqlgrey (https://github.com/spacedog/puppet-sqlgrey)
|
229
|
+
* erwbgy-wso2 (https://github.com/erwbgy/puppet-wso2.git)
|
230
|
+
* theforeman-foreman (git://github.com/theforeman/puppet-foreman)
|
231
|
+
* soli-wrappers (https://github.com/solution-libre/puppet-wrappers)
|
232
|
+
* tykeal-gerrit (https://github.com/tykeal/puppet-gerrit.git)
|
233
|
+
* jtopjian-cubbystack (https://github.com/jtopjian/puppet-cubbystack)
|
234
|
+
* lcgdm-lcgdm (https://github.com/cern-it-sdc-id/puppet-lcgdm)
|
235
|
+
* lcgdm-dmlite (https://github.com/cern-it-sdc-id/puppet-dmlite)
|
236
|
+
* devopera-domysqldb (https://github.com/devopera/puppet-domysqldb)
|
237
|
+
* theforeman-foreman_proxy (git://github.com/theforeman/puppet-foreman_proxy)
|
238
|
+
* rspiak-racktables (https://github.com/sgnl05/sgnl05-racktables)
|
239
|
+
* echoes-wrappers (https://github.com/echoes-tech/puppet-wrappers)
|
240
|
+
* mwils-complete_wordpress (UNKNOWN)
|
241
|
+
* halyard-boxen (https://github.com/halyard/puppet-boxen)
|
242
|
+
|
243
|
+
[mysql::server] is a _class_
|
244
|
+
==================================
|
245
|
+
Breaking changes to this file WILL impact these modules:
|
246
|
+
* martialblog-limesurvey (https://github.com/martialblog/puppet-limesurvey)
|
247
|
+
* infnpd-creamce (https://github.com/italiangrid/puppet-creamce)
|
248
|
+
* puppetlabs-awsdemo_profiles (https://github.com/puppetlabs/puppetlabs-awsdemo_profiles)
|
249
|
+
* openstack-openstacklib (git://github.com/openstack/puppet-openstacklib.git)
|
250
|
+
* samuelson-custom_webapp (https://github.com/samuelson/samuelson-custom_webapp)
|
251
|
+
* kritz-vagrantlamp (https://github.com/kritznl/vagrantlamp)
|
252
|
+
* infnpd-ocpattrauth (https://baltig.infn.it/andreett/puppet-ocp-attribute-authority)
|
253
|
+
* alexggolovin-lamp (https://github.com/alexggolovin/alexggolovin-lamp)
|
254
|
+
* aimonb-nexusis_mediawiki (https://github.com/NexusIS/puppet-mediawiki.git)
|
255
|
+
* edestecd-mariadb (https://github.com/edestecd/puppet-mariadb.git)
|
256
|
+
* puppetlabs-openstack (https://github.com/puppetlabs/puppetlabs-openstack.git)
|
257
|
+
* gajdaw-symfony (https://github.com/puppet-by-examples/puppet-symfony)
|
258
|
+
* fraenki-galera (https://github.com/fraenki/puppet-galera)
|
259
|
+
* othalla-nextcloud (https://github.com/othalla/puppet-nextcloud.git)
|
260
|
+
* thbe-bareos (https://github.com/thbe/puppet-bareos.git)
|
261
|
+
* oris-appserver (https://bitbucket.org/oris/env-puppet-module-appserver)
|
262
|
+
* ULHPC-slurm (https://github.com/ULHPC/puppet-slurm)
|
263
|
+
* binford2k-drupal (https://github.com/binford2k/binford2k-drupal)
|
264
|
+
* jefferyb-kualicoeus (https://github.com/jefferyb/kualicoeus)
|
265
|
+
* fiddyspence-zabbix (https://github.com/fiddyspence/puppet-zabbix)
|
266
|
+
* desalvo-bacula (https://github.com/desalvo/puppet-bacula)
|
267
|
+
* jsnshrmn-twlight (https://github.com/WikipediaLibrary/twlight_puppet)
|
268
|
+
* forj-openfire (https://github.com/forj-oss/puppet-openfire)
|
269
|
+
* firefield-firefield (git@github.com:firefield/basic-rails-server.git)
|
270
|
+
* bflad-piwik (git://github.com/bflad/puppet-piwik.git)
|
271
|
+
* mricon-bugzilla (https://github.com/mricon/puppet-bugzilla)
|
272
|
+
* garystafford-sakila_mysql_db (https://github.com/garystafford/garystafford-sakila_mysql_db)
|
273
|
+
* gajdaw-phpmyadmin (https://github.com/puppet-by-examples/puppet-phpmyadmin)
|
274
|
+
* leonardothibes-phpmyadmin (git://github.com/leonardothibes/puppet-phpmyadmin.git)
|
275
|
+
* gnubilafrance-wisemapping (https://github.com/gnubila-france/puppet-wisemapping)
|
276
|
+
* cnwr-cacti (https://github.com/cnwrinc/cnwr-cacti)
|
277
|
+
* cesnet-site_hadoop (https://github.com/MetaCenterCloudPuppet/cesnet-site_hadoop)
|
278
|
+
* geoffwilliams-r_profile (https://github.com/GeoffWilliams/r_profile)
|
279
|
+
* eelcomaljaars-friendica (https://devtools.maljaars-it.nl/opensource/puppet-friendica.git)
|
280
|
+
* garethr-wackopicko (git://github.com/garethr/garethr-wackopicko.git)
|
281
|
+
* thbe-bacula (https://github.com/thbe/puppet-bacula.git)
|
282
|
+
* sartiran-dpm (UNKNOWN)
|
283
|
+
* lboynton-gitlab (https://github.com/lboynton/puppet-gitlab)
|
284
|
+
* nubevps-wordpress (https://forge.puppetlabs.com/nubevps-wordpress/nubevps-wordpress)
|
285
|
+
* monkygames-beansbooks (https://bitbucket.org/monkygames/puppet-beansbooks.git)
|
286
|
+
* aimonb-nexusis_gerrit (UNKNOWN)
|
287
|
+
* bramwelt-patchwork (https://github.com/bramwelt/puppet-patchwork)
|
288
|
+
* factorit-jasperreports_server (https://github.com/jbbrunsveld/jasperreports_server)
|
289
|
+
* puppetlabs-wordpress_app (https://github.com/puppetlabs/puppetlabs-wordpress_app)
|
290
|
+
* wyrie-nagiosql (https://bitbucket.org/wyrie/puppet-nagiosql/src)
|
291
|
+
* gnubilafrance-redmine (https://github.com/gnubila-france/puppet-redmine)
|
292
|
+
* sgnl05-racktables (git://github.com/sgnl05/sgnl05-racktables.git)
|
293
|
+
* glarizza-profiles (https://github.com/glarizza/puppet-profiles)
|
294
|
+
* tscopp-jss (https://github.com/tscopp/puppet-jss/issues)
|
295
|
+
* giavac-homer (https://github.com/giavac/giavac-homer)
|
296
|
+
* sensson-powerdns (https://github.com/sensson/puppet-powerdns)
|
297
|
+
* lyonliang-otrs (https://github.com/ChinaShrimp/puppet-lyonliang-otrs.git)
|
298
|
+
* madhukarn-percona_galera_cluster (https://github.com/madhu2852/Percona-Galera-Cluster.git)
|
299
|
+
* lcgdm-dpm (https://github.com/cern-it-sdc-id/puppet-dpm)
|
300
|
+
* continuent-tungsten (https://github.com/continuent/continuent-tungsten)
|
301
|
+
* dsestero-sonarqube (https://github.com/dsestero/sonarqube.git)
|
302
|
+
* dmcnicks-sympa (https://github.com/dmcnicks/dmcnicks-sympa.git)
|
303
|
+
* brucem-ezpublish (git://github.com/brucem/puppet-ezpublish.git)
|
304
|
+
* firm1-zds (https://github.com/firm1/zds-puppet)
|
305
|
+
* marcdeop-ratticdb (https://github.com/marcdeop/ratticdb)
|
306
|
+
* gerardkok-ejbca (https://github.com/gerardkok/puppet-ejbca.git)
|
307
|
+
* leonardothibes-usvn (git://github.com/leonardothibes/puppet-usvn.git)
|
308
|
+
* hexmode-mediawiki (git@github.com:hexmode/puppet-mediawiki.git)
|
309
|
+
* johanek-redmine (https://github.com/johanek/johanek-redmine)
|
310
|
+
* SchnWalter-happydev (https://github.com/devgateway/happy-deployer/tree/master/puppet/modules/happydev)
|
311
|
+
* martasd-mediawiki (git@github.com:martasd/puppet-mediawiki.git)
|
312
|
+
|
313
|
+
Breaking changes to this file MAY impact these modules:
|
314
|
+
* pltraining-dockeragent (https://github.com/puppetlabs/pltraining-dockeragent)
|
315
|
+
* suvarnagodri-mediawiki (master)
|
316
|
+
* narasimhasv-openstack (Install puppet module)
|
317
|
+
* pbhutani-mediawiki (test)
|
318
|
+
* erwbgy-wso2 (https://github.com/erwbgy/puppet-wso2.git)
|
319
|
+
* karume-openstack (https://github.com/karume/puppetlabs-openstack.git)
|
320
|
+
* reidmv-pe_console (https://github.com/reidmv/puppet-module-pe_console)
|
321
|
+
* willdurand-bazinga (UNKNOWN)
|
322
|
+
* camptocamp-pacemaker (https://github.com/camptocamp/puppet-pacemaker)
|
323
|
+
* rocha-dpm (git://github.com/rochaporto/puppet-dpm)
|
324
|
+
* rspiak-racktables (https://github.com/sgnl05/sgnl05-racktables)
|
325
|
+
* dbsrinivasulu-mediawiki (abcd)
|
326
|
+
* vshn-uhosting (https://github.com/vshn/uhosting)
|
327
|
+
* lcgdm-lcgdm (https://github.com/cern-it-sdc-id/puppet-lcgdm)
|
328
|
+
* eshamow-pe_cert_auth (UNKNOWN)
|
329
|
+
* gerapeldoorn-nagiosxi (https://github.com/gerapeldoorn/puppet-nagiosxi)
|
330
|
+
* jtopjian-havana (https://github.com/jtopjian/puppet-havana)
|
331
|
+
* theforeman-foreman_proxy (git://github.com/theforeman/puppet-foreman_proxy)
|
332
|
+
* eNovance-cloud (https://github.com/enovance/puppet-openstack-cloud)
|
333
|
+
* gururaj-mediawiki (mediawiki)
|
334
|
+
* dmexe-deploy (http://github.com/dima-exe/puppet-deploy)
|
335
|
+
* theforeman-foreman (git://github.com/theforeman/puppet-foreman)
|
336
|
+
* abaranov-sqlgrey (https://github.com/spacedog/puppet-sqlgrey)
|
337
|
+
* byjupv-mediakwiki (mediakwiki)
|
338
|
+
* devopera-domysqldb (https://github.com/devopera/puppet-domysqldb)
|
339
|
+
```
|
340
|
+
|
341
|
+
|
342
|
+
## Limitations
|
343
|
+
|
344
|
+
This is super early in development and has not yet been battle tested.
|
345
|
+
|
346
|
+
## Disclaimer
|
347
|
+
|
348
|
+
I take no liability for the use of this tool.
|
349
|
+
|
350
|
+
Contact
|
351
|
+
-------
|
352
|
+
|
353
|
+
binford2k@gmail.com
|
354
|
+
|
data/bin/rangefinder
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
|
3
|
+
|
4
|
+
require 'logger'
|
5
|
+
require 'optparse'
|
6
|
+
require 'rangefinder'
|
7
|
+
|
8
|
+
loglevel = Logger::WARN
|
9
|
+
options = YAML.load_file(File.expand_path('~/.rangefinder.conf')) rescue {}
|
10
|
+
OptionParser.new do |opts|
|
11
|
+
opts.banner = "Usage: rangefinder <paths>
|
12
|
+
|
13
|
+
Run this command with a space separated list of file paths in a module and it
|
14
|
+
will infer what each file defines and then tell you what Forge modules use it.
|
15
|
+
|
16
|
+
It will separate output by the modules that we KNOW will be impacted and those
|
17
|
+
which we can only GUESS that will be impacted. We can tell the difference based
|
18
|
+
on whether the impacted module has properly described dependencies in their
|
19
|
+
`metadata.json`.
|
20
|
+
|
21
|
+
"
|
22
|
+
|
23
|
+
opts.on('-r', '--render-as FORMAT', 'Render the output as human, json, or yaml') do |val|
|
24
|
+
val = val.downcase.to_sym
|
25
|
+
fail "Unknown output type (#{val})" unless [:human, :json, :yaml].include? val
|
26
|
+
options[:render] = val
|
27
|
+
end
|
28
|
+
|
29
|
+
opts.on('-v', '--verbose', 'Show verbose output') do
|
30
|
+
loglevel = Logger::INFO
|
31
|
+
end
|
32
|
+
|
33
|
+
opts.on('-d', '--debug', 'Show debugging messages') do
|
34
|
+
loglevel = Logger::DEBUG
|
35
|
+
end
|
36
|
+
|
37
|
+
opts.on('--shell', 'Open a pry shell for debugging (must have Pry installed)') do
|
38
|
+
options[:shell] = true
|
39
|
+
end
|
40
|
+
|
41
|
+
opts.on('--version', 'Show version number') do
|
42
|
+
puts Rangefinder::VERSION
|
43
|
+
exit
|
44
|
+
end
|
45
|
+
|
46
|
+
end.parse!
|
47
|
+
options[:filenames] = ARGV.map {|f| File.expand_path f} unless ARGV.empty?
|
48
|
+
options[:filenames] ||= ['manifests/init.pp']
|
49
|
+
options[:render] ||= :human
|
50
|
+
|
51
|
+
$logger = Logger.new($stderr)
|
52
|
+
$logger.level = loglevel
|
53
|
+
$logger.formatter = proc { |severity,datetime,progname,msg| "#{severity}: #{msg}\n" }
|
54
|
+
|
55
|
+
if options[:shell]
|
56
|
+
require 'pry'
|
57
|
+
binding.pry
|
58
|
+
exit 0
|
59
|
+
end
|
60
|
+
|
61
|
+
Rangefinder.new(options).render!
|
data/lib/rangefinder.rb
ADDED
@@ -0,0 +1,96 @@
|
|
1
|
+
class Rangefinder
|
2
|
+
require 'json'
|
3
|
+
require 'pathname'
|
4
|
+
require 'rangefinder/bigquery'
|
5
|
+
require 'rangefinder/parser'
|
6
|
+
require 'rangefinder/version'
|
7
|
+
|
8
|
+
def initialize(options)
|
9
|
+
@options = options
|
10
|
+
@bigquery = Rangefinder::Bigquery.new(options)
|
11
|
+
|
12
|
+
if options[:filenames].size == 1 and File.directory?(options[:filenames].first)
|
13
|
+
options[:filenames] = Dir.glob("#{options[:filenames].first}/*")
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def render!
|
18
|
+
@options[:filenames].each do |filename|
|
19
|
+
case File.extname(filename).downcase
|
20
|
+
when '.pp'
|
21
|
+
kind, name = Rangefinder::Parser::Puppet.new(filename).evaluate!
|
22
|
+
when '.rb'
|
23
|
+
kind, name = Rangefinder::Parser::Ruby.new(filename).evaluate!
|
24
|
+
else
|
25
|
+
$logger.info "Unknown file type: #{filename}"
|
26
|
+
next
|
27
|
+
end
|
28
|
+
|
29
|
+
if kind.nil? or name.nil?
|
30
|
+
$logger.info "Skipping #{filename}"
|
31
|
+
next
|
32
|
+
end
|
33
|
+
|
34
|
+
results = @bigquery.find(namespace(filename), kind, name)
|
35
|
+
|
36
|
+
case @options[:render]
|
37
|
+
when :human
|
38
|
+
puts pretty_print(results)
|
39
|
+
when :json
|
40
|
+
puts JSON.pretty_generate(results)
|
41
|
+
when :yaml
|
42
|
+
require 'yaml'
|
43
|
+
puts results.to_yaml
|
44
|
+
else
|
45
|
+
raise "Invalid render type (#{@options[:render]})."
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
# get the namespace of the module this file is located in.
|
51
|
+
# doing it inside the loop is slower, but it means that we can check
|
52
|
+
# files from multiple modules at once.
|
53
|
+
def namespace(path)
|
54
|
+
segments = Pathname(File.expand_path(path)).each_filename.to_a
|
55
|
+
index = segments.rindex {|item| ['lib','manifests'].include? item}
|
56
|
+
|
57
|
+
return nil if index.nil?
|
58
|
+
|
59
|
+
modroot = segments[0...index]
|
60
|
+
pathname = File.join([File::SEPARATOR, modroot, 'metadata.json'].flatten)
|
61
|
+
metadata = JSON.parse(File.read(pathname)) rescue {}
|
62
|
+
metadata['name']
|
63
|
+
end
|
64
|
+
|
65
|
+
def pretty_print(results)
|
66
|
+
output = "[#{results[:name]}] is a _#{results[:kind]}_\n"
|
67
|
+
output << "==================================\n"
|
68
|
+
|
69
|
+
if results[:exact].empty? and results[:near].empty?
|
70
|
+
output << "with no external impact.\n\n"
|
71
|
+
end
|
72
|
+
|
73
|
+
unless results[:exact].empty?
|
74
|
+
output << "Breaking changes to this file WILL impact these modules:\n"
|
75
|
+
results[:exact].each do |row|
|
76
|
+
output << " * #{row[:module]} (#{row[:repo]})\n"
|
77
|
+
end
|
78
|
+
output << "\n"
|
79
|
+
end
|
80
|
+
|
81
|
+
unless results[:near].empty?
|
82
|
+
output << "Breaking changes to this file MAY impact these modules:\n"
|
83
|
+
results[:near].each do |row|
|
84
|
+
output << " * #{row[:module]} (#{row[:repo]})\n"
|
85
|
+
end
|
86
|
+
output << "\n"
|
87
|
+
end
|
88
|
+
|
89
|
+
output
|
90
|
+
end
|
91
|
+
|
92
|
+
def debug
|
93
|
+
require 'pry'
|
94
|
+
binding.pry
|
95
|
+
end
|
96
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require "google/cloud/bigquery"
|
2
|
+
|
3
|
+
class Rangefinder::Bigquery
|
4
|
+
def initialize(options)
|
5
|
+
$logger.info "Starting Bigquery connection"
|
6
|
+
gcloud = options[:gcloud]
|
7
|
+
|
8
|
+
raise "Required gCloud configuration missing" unless gcloud
|
9
|
+
|
10
|
+
gcloud[:keyfile] = File.expand_path(gcloud[:keyfile])
|
11
|
+
@bigquery = Google::Cloud::Bigquery.new(
|
12
|
+
:project_id => gcloud[:project],
|
13
|
+
:credentials => Google::Cloud::Bigquery::Credentials.new(gcloud[:keyfile]),
|
14
|
+
)
|
15
|
+
@dataset = @bigquery.dataset(gcloud[:dataset])
|
16
|
+
raise "\nThere is a problem with the gCloud configuration: \n #{JSON.pretty_generate(options)}" if @dataset.nil?
|
17
|
+
end
|
18
|
+
|
19
|
+
def find(namespace, kind, name)
|
20
|
+
sql = "SELECT module, i.source, m.source AS repo
|
21
|
+
FROM `bto-dataops-datalake-prod.community.forge_itemized` AS i
|
22
|
+
JOIN `bto-dataops-datalake-prod.community.forge_modules` AS m
|
23
|
+
ON m.slug = i.module
|
24
|
+
WHERE kind = @kind AND element = @name"
|
25
|
+
|
26
|
+
data = @dataset.query(sql, params: {kind: kind.to_s, name: name})
|
27
|
+
|
28
|
+
{
|
29
|
+
:kind => kind,
|
30
|
+
:name => name,
|
31
|
+
:exact => data.select {|row| row[:source] == namespace},
|
32
|
+
:near => data.reject {|row| row[:source]},
|
33
|
+
}
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'puppet'
|
2
|
+
require 'puppet/parser'
|
3
|
+
|
4
|
+
class Rangefinder::Parser::Puppet
|
5
|
+
def initialize(filename)
|
6
|
+
@filename = filename
|
7
|
+
@parser = Puppet::Pops::Parser::EvaluatingParser.new
|
8
|
+
end
|
9
|
+
|
10
|
+
def evaluate!
|
11
|
+
source = Puppet::FileSystem.read(@filename)
|
12
|
+
result = @parser.parse_string(source, @filename).definitions
|
13
|
+
element = result.first
|
14
|
+
|
15
|
+
$logger.error "The manifest contains multiple definitions; ignoring extras." unless result.size == 1
|
16
|
+
|
17
|
+
[simpletype(element), element.name]
|
18
|
+
end
|
19
|
+
|
20
|
+
def simpletype(element)
|
21
|
+
case element
|
22
|
+
when Puppet::Pops::Model::HostClassDefinition
|
23
|
+
:class
|
24
|
+
when Puppet::Pops::Model::ResourceTypeDefinition
|
25
|
+
:type
|
26
|
+
when Puppet::Pops::Model::FunctionDefinition
|
27
|
+
:function
|
28
|
+
else
|
29
|
+
$logger.info "Unknown element definition: #{element.class}"
|
30
|
+
nil
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'pathname'
|
2
|
+
|
3
|
+
class Rangefinder::Parser::Ruby
|
4
|
+
def initialize(filename)
|
5
|
+
@filename = filename
|
6
|
+
end
|
7
|
+
|
8
|
+
def evaluate!
|
9
|
+
case @filename
|
10
|
+
when %r{lib/puppet/parser/functions/(\w+).rb}
|
11
|
+
[:function, $1]
|
12
|
+
when %r{lib/puppet/type/(\w+).rb}
|
13
|
+
[:type, $1]
|
14
|
+
when %r{lib/puppet/functions/(.*/)?(\w+).rb}
|
15
|
+
function = $2
|
16
|
+
namespace = $1.gsub('/', '::') rescue nil
|
17
|
+
[:function, "#{namespace}#{function}"]
|
18
|
+
else
|
19
|
+
$logger.info "Unknown file path: #{@filename}"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
metadata
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: puppet-community-rangefinder
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ben Ford
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-10-30 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: puppet
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '5.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '5.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: google-cloud-bigquery
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.0'
|
41
|
+
description: |2
|
42
|
+
Run this command with a space separated list of file paths in a module and it
|
43
|
+
will infer what each file defines and then tell you what Forge modules use it.
|
44
|
+
|
45
|
+
******************************************************************************
|
46
|
+
* Note that this is only useful by members of the Puppet Ecosystem team *
|
47
|
+
* because it uses BigQuery data that's not available publicly. *
|
48
|
+
******************************************************************************
|
49
|
+
|
50
|
+
Run `rangefinder --help` to get started.
|
51
|
+
email: ben.ford@puppet.com
|
52
|
+
executables:
|
53
|
+
- rangefinder
|
54
|
+
extensions: []
|
55
|
+
extra_rdoc_files: []
|
56
|
+
files:
|
57
|
+
- CHANGELOG.md
|
58
|
+
- LICENSE
|
59
|
+
- README.md
|
60
|
+
- bin/rangefinder
|
61
|
+
- lib/rangefinder.rb
|
62
|
+
- lib/rangefinder/bigquery.rb
|
63
|
+
- lib/rangefinder/parser.rb
|
64
|
+
- lib/rangefinder/parser/puppet.rb
|
65
|
+
- lib/rangefinder/parser/ruby.rb
|
66
|
+
- lib/rangefinder/version.rb
|
67
|
+
homepage:
|
68
|
+
licenses:
|
69
|
+
- Apache-2.0
|
70
|
+
metadata: {}
|
71
|
+
post_install_message:
|
72
|
+
rdoc_options: []
|
73
|
+
require_paths:
|
74
|
+
- lib
|
75
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
76
|
+
requirements:
|
77
|
+
- - ">="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0'
|
80
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '0'
|
85
|
+
requirements: []
|
86
|
+
rubyforge_project:
|
87
|
+
rubygems_version: 2.7.7
|
88
|
+
signing_key:
|
89
|
+
specification_version: 4
|
90
|
+
summary: Predicts downstream impact of breaking file changes.
|
91
|
+
test_files: []
|