ra10ke 1.2.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +14 -8
- data/.github/workflows/release.yml +1 -1
- data/.github/workflows/test.yml +31 -9
- data/.rubocop.yml +5 -0
- data/.rubocop_todo.yml +262 -0
- data/CHANGELOG.md +49 -0
- data/Gemfile +4 -4
- data/README.md +9 -0
- data/Rakefile +12 -6
- data/lib/ra10ke/dependencies.rb +168 -62
- data/lib/ra10ke/duplicates.rb +1 -1
- data/lib/ra10ke/git_repo.rb +25 -14
- data/lib/ra10ke/install.rb +10 -10
- data/lib/ra10ke/monkey_patches.rb +1 -1
- data/lib/ra10ke/puppetfile_parser.rb +73 -73
- data/lib/ra10ke/solve.rb +27 -26
- data/lib/ra10ke/syntax.rb +6 -8
- data/lib/ra10ke/validate.rb +1 -2
- data/lib/ra10ke/version.rb +1 -1
- data/lib/ra10ke.rb +3 -1
- data/ra10ke.gemspec +19 -19
- data/spec/fixtures/Puppetfile_deprecation_issue +78 -0
- data/spec/fixtures/Puppetfile_git_conversion +28 -0
- data/spec/ra10ke/dependencies_spec.rb +54 -19
- data/spec/ra10ke/deprecation_spec.rb +18 -4
- data/spec/ra10ke/git_repo_spec.rb +12 -8
- data/spec/ra10ke/puppetfile_parser_spec.rb +89 -100
- data/spec/ra10ke/validate_spec.rb +8 -6
- data/spec/ra10ke_spec.rb +3 -3
- data/spec/spec_helper.rb +1 -1
- metadata +79 -32
- data/.ruby-version +0 -1
@@ -13,7 +13,7 @@ RSpec.describe 'Ra10ke::Validate::Validation' do
|
|
13
13
|
File.join(fixtures_dir, 'Puppetfile')
|
14
14
|
end
|
15
15
|
|
16
|
-
before
|
16
|
+
before do
|
17
17
|
allow_any_instance_of(Ra10ke::GitRepo).to receive(:valid_ref?).and_return(true)
|
18
18
|
allow_any_instance_of(Ra10ke::GitRepo).to receive(:valid_url?).and_return(true)
|
19
19
|
end
|
@@ -25,7 +25,7 @@ RSpec.describe 'Ra10ke::Validate::Validation' do
|
|
25
25
|
|
26
26
|
it '#data is a hash with values' do
|
27
27
|
keys = instance.all_modules.first.values
|
28
|
-
expect(keys).to eq([
|
28
|
+
expect(keys).to eq(['ntp', 'https://github.com/puppetlabs/puppetlabs-ntp', '81b34c6', true, true, '👍'])
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
@@ -38,7 +38,7 @@ RSpec.describe 'Ra10ke::Validate::Validation' do
|
|
38
38
|
File.join(fixtures_dir, 'Puppetfile_with_bad_refs')
|
39
39
|
end
|
40
40
|
|
41
|
-
before
|
41
|
+
before do
|
42
42
|
working = double('Ra1ke::GitRepo', url: 'https://github.com/vshn/puppet-gitlab')
|
43
43
|
expect(working).to receive(:valid_ref?).with('00397b86dfb3487d9df768cbd3698d362132b5bf').and_return(false)
|
44
44
|
expect(working).to receive(:valid_commit?).with('00397b86dfb3487d9df768cbd3698d362132b5bf').and_return(true)
|
@@ -62,7 +62,7 @@ RSpec.describe 'Ra10ke::Validate::Validation' do
|
|
62
62
|
end
|
63
63
|
|
64
64
|
describe 'control_branch' do
|
65
|
-
before
|
65
|
+
before do
|
66
66
|
ENV.delete 'CONTROL_BRANCH'
|
67
67
|
ENV.delete 'CONTROL_BRANCH_FALLBACK'
|
68
68
|
end
|
@@ -99,7 +99,9 @@ RSpec.describe 'Ra10ke::Validate::Validation' do
|
|
99
99
|
it 'correctly falls back to fallback if no current branch but default branch' do
|
100
100
|
ENV['CONTROL_BRANCH_FALLBACK'] = 'env-control_branch_fallback'
|
101
101
|
allow(Ra10ke::GitRepo).to receive(:current_branch).and_return(nil)
|
102
|
-
expect(instance.all_modules.find
|
102
|
+
expect(instance.all_modules.find do |m|
|
103
|
+
m[:name] == 'hiera_controlwithdefault'
|
104
|
+
end[:ref]).to eq('env-control_branch_fallback')
|
103
105
|
end
|
104
106
|
|
105
107
|
it 'correctly falls back to default_branch if no current branch with override' do
|
@@ -138,6 +140,6 @@ RSpec.describe 'Ra10ke::Validate::Validation' do
|
|
138
140
|
keys = instance.all_modules.first.values
|
139
141
|
|
140
142
|
expect(keys).to eq(['gitlab', 'https://github.com/vshn/puppet-gitlab',
|
141
|
-
'00397b86dfb3487d9df768cbd3698d362132b5bf', true, true, '👍'])
|
143
|
+
'00397b86dfb3487d9df768cbd3698d362132b5bf', true, true, '👍',])
|
142
144
|
end
|
143
145
|
end
|
data/spec/ra10ke_spec.rb
CHANGED
@@ -63,13 +63,13 @@ RSpec.describe 'Ra10ke::RakeTask' do
|
|
63
63
|
File.join(fixtures_dir, 'Puppetfile_with_bad_refs')
|
64
64
|
end
|
65
65
|
|
66
|
-
# I suspect rake is caching something here and the puppetfile is
|
67
|
-
# not being sent correctly as it is not using the file I specify.
|
66
|
+
# I suspect rake is caching something here and the puppetfile is
|
67
|
+
# not being sent correctly as it is not using the file I specify.
|
68
68
|
# The output should be different.
|
69
69
|
# Testing this by itself works
|
70
70
|
it '#run_validate_task' do
|
71
71
|
task2 = instance.define_task_validate(args)
|
72
|
-
expect(task2.invoke).to
|
72
|
+
expect(task2.invoke).to be_nil
|
73
73
|
end
|
74
74
|
end
|
75
75
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ra10ke
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Theo Chatzimichos
|
@@ -9,92 +9,122 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2023-08-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
15
|
+
name: git
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - "
|
18
|
+
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '
|
20
|
+
version: '1.18'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- - "
|
25
|
+
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '
|
27
|
+
version: '1.18'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: puppet_forge
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
+
- - "~>"
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '5.0'
|
32
35
|
- - ">="
|
33
36
|
- !ruby/object:Gem::Version
|
34
|
-
version:
|
37
|
+
version: 5.0.1
|
35
38
|
type: :runtime
|
36
39
|
prerelease: false
|
37
40
|
version_requirements: !ruby/object:Gem::Requirement
|
38
41
|
requirements:
|
42
|
+
- - "~>"
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '5.0'
|
39
45
|
- - ">="
|
40
46
|
- !ruby/object:Gem::Version
|
41
|
-
version:
|
47
|
+
version: 5.0.1
|
42
48
|
- !ruby/object:Gem::Dependency
|
43
49
|
name: r10k
|
44
50
|
requirement: !ruby/object:Gem::Requirement
|
45
51
|
requirements:
|
46
52
|
- - ">="
|
47
53
|
- !ruby/object:Gem::Version
|
48
|
-
version:
|
54
|
+
version: 2.6.5
|
55
|
+
- - "<"
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '5'
|
49
58
|
type: :runtime
|
50
59
|
prerelease: false
|
51
60
|
version_requirements: !ruby/object:Gem::Requirement
|
52
61
|
requirements:
|
53
62
|
- - ">="
|
54
63
|
- !ruby/object:Gem::Version
|
55
|
-
version:
|
64
|
+
version: 2.6.5
|
65
|
+
- - "<"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '5'
|
56
68
|
- !ruby/object:Gem::Dependency
|
57
|
-
name:
|
69
|
+
name: rake
|
58
70
|
requirement: !ruby/object:Gem::Requirement
|
59
71
|
requirements:
|
72
|
+
- - "~>"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '13.0'
|
60
75
|
- - ">="
|
61
76
|
- !ruby/object:Gem::Version
|
62
|
-
version:
|
77
|
+
version: 13.0.6
|
63
78
|
type: :runtime
|
64
79
|
prerelease: false
|
65
80
|
version_requirements: !ruby/object:Gem::Requirement
|
66
81
|
requirements:
|
82
|
+
- - "~>"
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '13.0'
|
67
85
|
- - ">="
|
68
86
|
- !ruby/object:Gem::Version
|
69
|
-
version:
|
87
|
+
version: 13.0.6
|
70
88
|
- !ruby/object:Gem::Dependency
|
71
|
-
name:
|
89
|
+
name: semverse
|
72
90
|
requirement: !ruby/object:Gem::Requirement
|
73
91
|
requirements:
|
74
92
|
- - ">="
|
75
93
|
- !ruby/object:Gem::Version
|
76
|
-
version: '0'
|
94
|
+
version: '2.0'
|
95
|
+
- - "<"
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '4'
|
77
98
|
type: :runtime
|
78
99
|
prerelease: false
|
79
100
|
version_requirements: !ruby/object:Gem::Requirement
|
80
101
|
requirements:
|
81
102
|
- - ">="
|
82
103
|
- !ruby/object:Gem::Version
|
83
|
-
version: '0'
|
104
|
+
version: '2.0'
|
105
|
+
- - "<"
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: '4'
|
84
108
|
- !ruby/object:Gem::Dependency
|
85
|
-
name:
|
109
|
+
name: solve
|
86
110
|
requirement: !ruby/object:Gem::Requirement
|
87
111
|
requirements:
|
112
|
+
- - "~>"
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
version: '4.0'
|
88
115
|
- - ">="
|
89
116
|
- !ruby/object:Gem::Version
|
90
|
-
version:
|
117
|
+
version: 4.0.4
|
91
118
|
type: :runtime
|
92
119
|
prerelease: false
|
93
120
|
version_requirements: !ruby/object:Gem::Requirement
|
94
121
|
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '4.0'
|
95
125
|
- - ">="
|
96
126
|
- !ruby/object:Gem::Version
|
97
|
-
version:
|
127
|
+
version: 4.0.4
|
98
128
|
- !ruby/object:Gem::Dependency
|
99
129
|
name: table_print
|
100
130
|
requirement: !ruby/object:Gem::Requirement
|
@@ -109,6 +139,20 @@ dependencies:
|
|
109
139
|
- - "~>"
|
110
140
|
- !ruby/object:Gem::Version
|
111
141
|
version: 1.5.6
|
142
|
+
- !ruby/object:Gem::Dependency
|
143
|
+
name: pry
|
144
|
+
requirement: !ruby/object:Gem::Requirement
|
145
|
+
requirements:
|
146
|
+
- - "~>"
|
147
|
+
- !ruby/object:Gem::Version
|
148
|
+
version: 0.14.2
|
149
|
+
type: :development
|
150
|
+
prerelease: false
|
151
|
+
version_requirements: !ruby/object:Gem::Requirement
|
152
|
+
requirements:
|
153
|
+
- - "~>"
|
154
|
+
- !ruby/object:Gem::Version
|
155
|
+
version: 0.14.2
|
112
156
|
- !ruby/object:Gem::Dependency
|
113
157
|
name: rspec
|
114
158
|
requirement: !ruby/object:Gem::Requirement
|
@@ -124,33 +168,33 @@ dependencies:
|
|
124
168
|
- !ruby/object:Gem::Version
|
125
169
|
version: '3.6'
|
126
170
|
- !ruby/object:Gem::Dependency
|
127
|
-
name:
|
171
|
+
name: simplecov
|
128
172
|
requirement: !ruby/object:Gem::Requirement
|
129
173
|
requirements:
|
130
|
-
- - "
|
174
|
+
- - "~>"
|
131
175
|
- !ruby/object:Gem::Version
|
132
|
-
version:
|
176
|
+
version: 0.22.0
|
133
177
|
type: :development
|
134
178
|
prerelease: false
|
135
179
|
version_requirements: !ruby/object:Gem::Requirement
|
136
180
|
requirements:
|
137
|
-
- - "
|
181
|
+
- - "~>"
|
138
182
|
- !ruby/object:Gem::Version
|
139
|
-
version:
|
183
|
+
version: 0.22.0
|
140
184
|
- !ruby/object:Gem::Dependency
|
141
|
-
name:
|
185
|
+
name: voxpupuli-rubocop
|
142
186
|
requirement: !ruby/object:Gem::Requirement
|
143
187
|
requirements:
|
144
|
-
- - "
|
188
|
+
- - "~>"
|
145
189
|
- !ruby/object:Gem::Version
|
146
|
-
version:
|
190
|
+
version: 2.0.0
|
147
191
|
type: :development
|
148
192
|
prerelease: false
|
149
193
|
version_requirements: !ruby/object:Gem::Requirement
|
150
194
|
requirements:
|
151
|
-
- - "
|
195
|
+
- - "~>"
|
152
196
|
- !ruby/object:Gem::Version
|
153
|
-
version:
|
197
|
+
version: 2.0.0
|
154
198
|
description: R10K and Puppetfile rake tasks
|
155
199
|
email:
|
156
200
|
- voxpupuli@groups.io
|
@@ -162,7 +206,8 @@ files:
|
|
162
206
|
- ".github/workflows/release.yml"
|
163
207
|
- ".github/workflows/test.yml"
|
164
208
|
- ".gitignore"
|
165
|
-
- ".
|
209
|
+
- ".rubocop.yml"
|
210
|
+
- ".rubocop_todo.yml"
|
166
211
|
- ".travis.yml"
|
167
212
|
- CHANGELOG.md
|
168
213
|
- Gemfile
|
@@ -184,6 +229,8 @@ files:
|
|
184
229
|
- lib/ra10ke/version.rb
|
185
230
|
- ra10ke.gemspec
|
186
231
|
- spec/fixtures/Puppetfile
|
232
|
+
- spec/fixtures/Puppetfile_deprecation_issue
|
233
|
+
- spec/fixtures/Puppetfile_git_conversion
|
187
234
|
- spec/fixtures/Puppetfile_test
|
188
235
|
- spec/fixtures/Puppetfile_with_bad_refs
|
189
236
|
- spec/fixtures/Puppetfile_with_commit
|
@@ -213,7 +260,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
213
260
|
requirements:
|
214
261
|
- - ">="
|
215
262
|
- !ruby/object:Gem::Version
|
216
|
-
version: 2.
|
263
|
+
version: 2.7.0
|
217
264
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
218
265
|
requirements:
|
219
266
|
- - ">="
|
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
2.5.7
|