puppet-strings 3.0.1 → 4.0.0.rc.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -88
- data/LICENSE +174 -10
- data/README.md +1 -1
- data/lib/puppet/face/strings.rb +3 -3
- data/lib/puppet-strings/describe.rb +7 -11
- data/lib/puppet-strings/markdown/base.rb +6 -4
- data/lib/puppet-strings/markdown/data_type.rb +3 -4
- data/lib/puppet-strings/markdown/function.rb +5 -5
- data/lib/puppet-strings/markdown/resource_type.rb +1 -1
- data/lib/puppet-strings/markdown/templates/classes_and_defines.erb +4 -0
- data/lib/puppet-strings/markdown/templates/data_type.erb +4 -0
- data/lib/puppet-strings/markdown/templates/function.erb +4 -0
- data/lib/puppet-strings/markdown/templates/resource_type.erb +4 -0
- data/lib/puppet-strings/markdown.rb +9 -11
- data/lib/puppet-strings/tasks/generate.rb +5 -3
- data/lib/puppet-strings/tasks/gh_pages.rb +6 -6
- data/lib/puppet-strings/tasks/validate.rb +3 -3
- data/lib/puppet-strings/tasks.rb +3 -3
- data/lib/puppet-strings/version.rb +1 -1
- data/lib/puppet-strings/yard/code_objects/base.rb +2 -2
- data/lib/puppet-strings/yard/code_objects/class.rb +1 -2
- data/lib/puppet-strings/yard/code_objects/data_type.rb +2 -2
- data/lib/puppet-strings/yard/code_objects/defined_type.rb +1 -2
- data/lib/puppet-strings/yard/code_objects/function.rb +6 -6
- data/lib/puppet-strings/yard/code_objects/plan.rb +1 -2
- data/lib/puppet-strings/yard/code_objects/type.rb +6 -6
- data/lib/puppet-strings/yard/handlers/helpers.rb +1 -0
- data/lib/puppet-strings/yard/handlers/json/task_handler.rb +1 -0
- data/lib/puppet-strings/yard/handlers/puppet/base.rb +3 -3
- data/lib/puppet-strings/yard/handlers/ruby/base.rb +2 -2
- data/lib/puppet-strings/yard/handlers/ruby/data_type_handler.rb +5 -9
- data/lib/puppet-strings/yard/handlers/ruby/function_handler.rb +33 -32
- data/lib/puppet-strings/yard/handlers/ruby/provider_handler.rb +1 -1
- data/lib/puppet-strings/yard/handlers/ruby/rsapi_handler.rb +4 -4
- data/lib/puppet-strings/yard/handlers/ruby/type_base.rb +3 -0
- data/lib/puppet-strings/yard/handlers/ruby/type_handler.rb +6 -5
- data/lib/puppet-strings/yard/parsers/json/parser.rb +1 -1
- data/lib/puppet-strings/yard/parsers/puppet/parser.rb +0 -6
- data/lib/puppet-strings/yard/parsers/puppet/statement.rb +12 -20
- data/lib/puppet-strings/yard/tags/overload_tag.rb +4 -4
- data/lib/puppet-strings/yard/tags/parameter_directive.rb +1 -1
- data/lib/puppet-strings/yard/tags/property_directive.rb +1 -1
- data/lib/puppet-strings/yard/templates/default/fulldoc/html/setup.rb +11 -9
- data/lib/puppet-strings/yard/templates/default/layout/html/setup.rb +16 -14
- data/lib/puppet-strings/yard/templates/default/puppet_class/html/deprecated.erb +6 -0
- data/lib/puppet-strings/yard/templates/default/puppet_class/html/setup.rb +5 -3
- data/lib/puppet-strings/yard/templates/default/puppet_data_type/html/deprecated.erb +6 -0
- data/lib/puppet-strings/yard/templates/default/puppet_data_type/html/setup.rb +4 -2
- data/lib/puppet-strings/yard/templates/default/puppet_data_type_alias/html/deprecated.erb +6 -0
- data/lib/puppet-strings/yard/templates/default/puppet_data_type_alias/html/setup.rb +5 -3
- data/lib/puppet-strings/yard/templates/default/puppet_defined_type/html/deprecated.erb +6 -0
- data/lib/puppet-strings/yard/templates/default/puppet_defined_type/html/setup.rb +3 -1
- data/lib/puppet-strings/yard/templates/default/puppet_function/html/deprecated.erb +6 -0
- data/lib/puppet-strings/yard/templates/default/puppet_function/html/setup.rb +3 -1
- data/lib/puppet-strings/yard/templates/default/puppet_plan/html/deprecated.erb +6 -0
- data/lib/puppet-strings/yard/templates/default/puppet_plan/html/setup.rb +3 -1
- data/lib/puppet-strings/yard/templates/default/puppet_provider/html/setup.rb +2 -0
- data/lib/puppet-strings/yard/templates/default/puppet_task/html/setup.rb +2 -0
- data/lib/puppet-strings/yard/templates/default/puppet_type/html/deprecated.erb +6 -0
- data/lib/puppet-strings/yard/templates/default/puppet_type/html/setup.rb +5 -3
- data/lib/puppet-strings/yard/templates/default/tags/setup.rb +3 -1
- data/lib/puppet-strings/yard/util.rb +3 -5
- data/lib/puppet-strings/yard.rb +1 -1
- data/lib/puppet-strings.rb +3 -8
- metadata +18 -13
- data/COMMITTERS.md +0 -185
@@ -1,5 +1,7 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Initializes the template.
|
2
4
|
# @return [void]
|
3
5
|
def init
|
4
|
-
sections :header, :box_info, :summary, :overview, :note, :todo, T('tags'), :source
|
6
|
+
sections :header, :box_info, :summary, :overview, :note, :todo, :deprecated, T('tags'), :source
|
5
7
|
end
|
@@ -1,5 +1,7 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Initializes the template.
|
2
4
|
# @return [void]
|
3
5
|
def init
|
4
|
-
sections :header, :box_info, :summary, :overview, [:note, :todo, T('tags'), :source]
|
6
|
+
sections :header, :box_info, :summary, :overview, [:note, :todo, :deprecated, T('tags'), :source]
|
5
7
|
end
|
@@ -1,7 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Initializes the template.
|
2
4
|
# @return [void]
|
3
5
|
def init
|
4
|
-
sections :header, :box_info, :summary, :overview, :note, :todo, T('tags'), :source
|
6
|
+
sections :header, :box_info, :summary, :overview, :note, :todo, :deprecated, T('tags'), :source
|
5
7
|
end
|
6
8
|
|
7
9
|
# Renders the box_info section.
|
@@ -1,7 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Initializes the template.
|
2
4
|
# @return [void]
|
3
5
|
def init
|
4
|
-
sections :header, :box_info, :summary, :overview, :note, :todo, T('tags'), :properties, :parameters, :features
|
6
|
+
sections :header, :box_info, :summary, :overview, :note, :todo, :deprecated, T('tags'), :properties, :parameters, :features
|
5
7
|
end
|
6
8
|
|
7
9
|
# Renders the box_info section.
|
@@ -19,7 +21,7 @@ def properties
|
|
19
21
|
#
|
20
22
|
# "checks" such as "creates" and "onlyif" are another type of property
|
21
23
|
@parameters = (object.properties || []) + (object.checks || [])
|
22
|
-
@parameters.sort_by!
|
24
|
+
@parameters.sort_by!(&:name)
|
23
25
|
@tag_title = 'Properties'
|
24
26
|
erb(:parameters)
|
25
27
|
end
|
@@ -28,7 +30,7 @@ end
|
|
28
30
|
# @return [String] Returns the rendered section.
|
29
31
|
def parameters
|
30
32
|
@parameters = object.parameters || []
|
31
|
-
@parameters.sort_by!
|
33
|
+
@parameters.sort_by!(&:name)
|
32
34
|
@tag_title = 'Parameters'
|
33
35
|
erb(:parameters)
|
34
36
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Called to return parameter tags.
|
2
4
|
# @return [Array<YARD::Tag>] Returns the parameter tags if the object should have parameters.
|
3
5
|
def param
|
@@ -14,7 +16,7 @@ end
|
|
14
16
|
# Renders the overload section.
|
15
17
|
# @return [String] Returns the rendered section.
|
16
18
|
def overload
|
17
|
-
erb(
|
19
|
+
erb(object.type == :puppet_function ? :puppet_overload : :overload)
|
18
20
|
end
|
19
21
|
|
20
22
|
# Renders the enum section.
|
@@ -9,10 +9,8 @@ module PuppetStrings::Yard::Util
|
|
9
9
|
# @param [String] str The string to scrub.
|
10
10
|
# @return [String] A scrubbed string.
|
11
11
|
def self.scrub_string(str)
|
12
|
-
match = str.match(
|
13
|
-
if match
|
14
|
-
return Puppet::Util::Docs.scrub(match[1])
|
15
|
-
end
|
12
|
+
match = str.match(/^%[Qq]{(.*)}$/m)
|
13
|
+
return Puppet::Util::Docs.scrub(match[1]) if match
|
16
14
|
|
17
15
|
Puppet::Util::Docs.scrub(str)
|
18
16
|
end
|
@@ -25,7 +23,7 @@ module PuppetStrings::Yard::Util
|
|
25
23
|
# @param [String] data HTML document to convert
|
26
24
|
# @return [String] HTML document with links converted
|
27
25
|
def self.github_to_yard_links(data)
|
28
|
-
data.scan(
|
26
|
+
data.scan(/href="\#(.+)"/).each do |bad_link|
|
29
27
|
data = data.gsub("=\"##{bad_link.first}\"", "=\"#label-#{bad_link.first.capitalize.tr('-', '+')}\"")
|
30
28
|
end
|
31
29
|
|
data/lib/puppet-strings/yard.rb
CHANGED
data/lib/puppet-strings.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
# rubocop:disable Naming/FileName
|
2
|
-
|
3
1
|
# frozen_string_literal: true
|
4
2
|
|
5
3
|
# The root module for Puppet Strings.
|
@@ -50,16 +48,13 @@ module PuppetStrings
|
|
50
48
|
YARD::CLI::Yardoc.run(*args)
|
51
49
|
|
52
50
|
# If outputting JSON, render the output
|
53
|
-
if options[:json] && !options[:describe]
|
54
|
-
render_json(file)
|
55
|
-
end
|
51
|
+
render_json(file) if options[:json] && !options[:describe]
|
56
52
|
|
57
53
|
# If outputting Markdown, render the output
|
58
|
-
if options[:markdown]
|
59
|
-
render_markdown(file)
|
60
|
-
end
|
54
|
+
render_markdown(file) if options[:markdown]
|
61
55
|
|
62
56
|
return unless options[:describe]
|
57
|
+
|
63
58
|
render_describe(options[:describe_types], options[:describe_list], options[:providers])
|
64
59
|
end
|
65
60
|
|
metadata
CHANGED
@@ -1,56 +1,54 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet-strings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0.rc.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: rgen
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.9
|
19
|
+
version: '0.9'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.9
|
26
|
+
version: '0.9'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: yard
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.9
|
33
|
+
version: '0.9'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.9
|
40
|
+
version: '0.9'
|
41
41
|
description:
|
42
42
|
email: info@puppet.com
|
43
43
|
executables: []
|
44
44
|
extensions: []
|
45
45
|
extra_rdoc_files:
|
46
46
|
- CHANGELOG.md
|
47
|
-
- COMMITTERS.md
|
48
47
|
- CONTRIBUTING.md
|
49
48
|
- LICENSE
|
50
49
|
- README.md
|
51
50
|
files:
|
52
51
|
- CHANGELOG.md
|
53
|
-
- COMMITTERS.md
|
54
52
|
- CONTRIBUTING.md
|
55
53
|
- LICENSE
|
56
54
|
- README.md
|
@@ -137,6 +135,7 @@ files:
|
|
137
135
|
- lib/puppet-strings/yard/templates/default/layout/html/objects.erb
|
138
136
|
- lib/puppet-strings/yard/templates/default/layout/html/setup.rb
|
139
137
|
- lib/puppet-strings/yard/templates/default/puppet_class/html/box_info.erb
|
138
|
+
- lib/puppet-strings/yard/templates/default/puppet_class/html/deprecated.erb
|
140
139
|
- lib/puppet-strings/yard/templates/default/puppet_class/html/header.erb
|
141
140
|
- lib/puppet-strings/yard/templates/default/puppet_class/html/note.erb
|
142
141
|
- lib/puppet-strings/yard/templates/default/puppet_class/html/overview.erb
|
@@ -145,6 +144,7 @@ files:
|
|
145
144
|
- lib/puppet-strings/yard/templates/default/puppet_class/html/summary.erb
|
146
145
|
- lib/puppet-strings/yard/templates/default/puppet_class/html/todo.erb
|
147
146
|
- lib/puppet-strings/yard/templates/default/puppet_data_type/html/box_info.erb
|
147
|
+
- lib/puppet-strings/yard/templates/default/puppet_data_type/html/deprecated.erb
|
148
148
|
- lib/puppet-strings/yard/templates/default/puppet_data_type/html/header.erb
|
149
149
|
- lib/puppet-strings/yard/templates/default/puppet_data_type/html/method_details_list.erb
|
150
150
|
- lib/puppet-strings/yard/templates/default/puppet_data_type/html/note.erb
|
@@ -155,6 +155,7 @@ files:
|
|
155
155
|
- lib/puppet-strings/yard/templates/default/puppet_data_type/html/todo.erb
|
156
156
|
- lib/puppet-strings/yard/templates/default/puppet_data_type_alias/html/alias_of.erb
|
157
157
|
- lib/puppet-strings/yard/templates/default/puppet_data_type_alias/html/box_info.erb
|
158
|
+
- lib/puppet-strings/yard/templates/default/puppet_data_type_alias/html/deprecated.erb
|
158
159
|
- lib/puppet-strings/yard/templates/default/puppet_data_type_alias/html/header.erb
|
159
160
|
- lib/puppet-strings/yard/templates/default/puppet_data_type_alias/html/note.erb
|
160
161
|
- lib/puppet-strings/yard/templates/default/puppet_data_type_alias/html/overview.erb
|
@@ -163,6 +164,7 @@ files:
|
|
163
164
|
- lib/puppet-strings/yard/templates/default/puppet_data_type_alias/html/summary.erb
|
164
165
|
- lib/puppet-strings/yard/templates/default/puppet_data_type_alias/html/todo.erb
|
165
166
|
- lib/puppet-strings/yard/templates/default/puppet_defined_type/html/box_info.erb
|
167
|
+
- lib/puppet-strings/yard/templates/default/puppet_defined_type/html/deprecated.erb
|
166
168
|
- lib/puppet-strings/yard/templates/default/puppet_defined_type/html/header.erb
|
167
169
|
- lib/puppet-strings/yard/templates/default/puppet_defined_type/html/note.erb
|
168
170
|
- lib/puppet-strings/yard/templates/default/puppet_defined_type/html/overview.erb
|
@@ -171,6 +173,7 @@ files:
|
|
171
173
|
- lib/puppet-strings/yard/templates/default/puppet_defined_type/html/summary.erb
|
172
174
|
- lib/puppet-strings/yard/templates/default/puppet_defined_type/html/todo.erb
|
173
175
|
- lib/puppet-strings/yard/templates/default/puppet_function/html/box_info.erb
|
176
|
+
- lib/puppet-strings/yard/templates/default/puppet_function/html/deprecated.erb
|
174
177
|
- lib/puppet-strings/yard/templates/default/puppet_function/html/header.erb
|
175
178
|
- lib/puppet-strings/yard/templates/default/puppet_function/html/note.erb
|
176
179
|
- lib/puppet-strings/yard/templates/default/puppet_function/html/overview.erb
|
@@ -179,6 +182,7 @@ files:
|
|
179
182
|
- lib/puppet-strings/yard/templates/default/puppet_function/html/summary.erb
|
180
183
|
- lib/puppet-strings/yard/templates/default/puppet_function/html/todo.erb
|
181
184
|
- lib/puppet-strings/yard/templates/default/puppet_plan/html/box_info.erb
|
185
|
+
- lib/puppet-strings/yard/templates/default/puppet_plan/html/deprecated.erb
|
182
186
|
- lib/puppet-strings/yard/templates/default/puppet_plan/html/header.erb
|
183
187
|
- lib/puppet-strings/yard/templates/default/puppet_plan/html/note.erb
|
184
188
|
- lib/puppet-strings/yard/templates/default/puppet_plan/html/overview.erb
|
@@ -201,6 +205,7 @@ files:
|
|
201
205
|
- lib/puppet-strings/yard/templates/default/puppet_task/html/setup.rb
|
202
206
|
- lib/puppet-strings/yard/templates/default/puppet_task/html/supports_noop.erb
|
203
207
|
- lib/puppet-strings/yard/templates/default/puppet_type/html/box_info.erb
|
208
|
+
- lib/puppet-strings/yard/templates/default/puppet_type/html/deprecated.erb
|
204
209
|
- lib/puppet-strings/yard/templates/default/puppet_type/html/features.erb
|
205
210
|
- lib/puppet-strings/yard/templates/default/puppet_type/html/header.erb
|
206
211
|
- lib/puppet-strings/yard/templates/default/puppet_type/html/note.erb
|
@@ -232,11 +237,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
232
237
|
version: 2.7.0
|
233
238
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
234
239
|
requirements:
|
235
|
-
- - "
|
240
|
+
- - ">"
|
236
241
|
- !ruby/object:Gem::Version
|
237
|
-
version:
|
242
|
+
version: 1.3.1
|
238
243
|
requirements:
|
239
|
-
- puppet, >=
|
244
|
+
- puppet, >= 7.0.0
|
240
245
|
rubygems_version: 3.1.6
|
241
246
|
signing_key:
|
242
247
|
specification_version: 4
|
data/COMMITTERS.md
DELETED
@@ -1,185 +0,0 @@
|
|
1
|
-
Committing changes to Strings
|
2
|
-
====
|
3
|
-
|
4
|
-
We would like to make it easier for community members to contribute to strings
|
5
|
-
using pull requests, even if it makes the task of reviewing and committing
|
6
|
-
these changes a little harder. Pull requests are only ever based on a single
|
7
|
-
branch. As a result contributors should target their changes at the main branch.
|
8
|
-
This makes the process of contributing a little easier for the contributor since
|
9
|
-
they don't need to concern themselves with the question, "What branch do I base my changes
|
10
|
-
on?" This is already called out in the [CONTRIBUTING.md](http://goo.gl/XRH2J).
|
11
|
-
|
12
|
-
Therefore, it is the responsibility of the committer to re-base the change set
|
13
|
-
on the appropriate branch which should receive the contribution.
|
14
|
-
|
15
|
-
It is also the responsibility of the committer to review the change set in an
|
16
|
-
effort to make sure the end users must opt-in to new behavior that is
|
17
|
-
incompatible with previous behavior. We employ the use of [feature
|
18
|
-
flags](http://stackoverflow.com/questions/7707383/what-is-a-feature-flag) as
|
19
|
-
the primary way to achieve this user opt-in behavior. Finally, it is the
|
20
|
-
responsibility of the committer to make sure the `main` branch
|
21
|
-
is clean and working at all times. Clean means that dead code is not
|
22
|
-
allowed, everything needs to be usable in some manner at all points in time.
|
23
|
-
|
24
|
-
The rest of this document addresses the concerns of the committer. This
|
25
|
-
document will help guide the committer decide which branch to base, or re-base
|
26
|
-
a contribution on top of. This document also describes our branch management
|
27
|
-
strategy, which is closely related to the decision of what branch to commit
|
28
|
-
changes into.
|
29
|
-
|
30
|
-
Terminology
|
31
|
-
====
|
32
|
-
|
33
|
-
Many of these terms have more than one meaning. For the purposes of this
|
34
|
-
document, the following terms refer to specific things.
|
35
|
-
|
36
|
-
**contributor** - A person who makes a change to strings and submits a change
|
37
|
-
set in the form of a pull request.
|
38
|
-
|
39
|
-
**change set** - A set of discrete patches which combined together form a
|
40
|
-
contribution. A change set takes the form of Git commits and is submitted to
|
41
|
-
strings in the form of a pull request.
|
42
|
-
|
43
|
-
**committer** - A person responsible for reviewing a pull request and then
|
44
|
-
making the decision what base branch to merge the change set into.
|
45
|
-
|
46
|
-
**base branch** - A branch in Git that contains an active history of changes
|
47
|
-
and will eventually be released using semantic version guidelines. The branch
|
48
|
-
named `main` will always exist as a base branch.
|
49
|
-
|
50
|
-
**main branch** - The branch where new functionality that and bug fixes are
|
51
|
-
merged.
|
52
|
-
|
53
|
-
**security** - Where critical security fixes are merged. These change sets
|
54
|
-
will then be merged into release branches independently from one another. (i.e.
|
55
|
-
no merging up). Please do not submit pull requests against the security branch
|
56
|
-
and instead report all security related issues to security@puppet.com as
|
57
|
-
per our security policy published at
|
58
|
-
[https://puppet.com/security/](https://puppet.com/security/).
|
59
|
-
|
60
|
-
Committer Guide
|
61
|
-
====
|
62
|
-
|
63
|
-
This section provides a guide to follow while committing change sets to strings
|
64
|
-
base branches.
|
65
|
-
|
66
|
-
How to decide what release(s) should be patched
|
67
|
-
---
|
68
|
-
|
69
|
-
This section provides a guide to help a committer decide the specific base
|
70
|
-
branch that a change set should be merged into.
|
71
|
-
|
72
|
-
The latest minor release of a major release is the only base branch that should
|
73
|
-
be patched. These patches will be merged into `main` if they contain new
|
74
|
-
functionality and if they fix a critical bug. Older minor releases in a major release
|
75
|
-
do not get patched.
|
76
|
-
|
77
|
-
Before the switch to [semantic versions](http://semver.org/) committers did not
|
78
|
-
have to think about the difference between minor and major releases.
|
79
|
-
Committing to the latest minor release of a major release is a policy intended
|
80
|
-
to limit the number of active base branches that must be managed.
|
81
|
-
|
82
|
-
Security patches are handled as a special case. Security patches may be
|
83
|
-
applied to earlier minor releases of a major release, but the patches should
|
84
|
-
first be merged into the `security` branch. Security patches should be merged
|
85
|
-
by Puppet Labs staff members. Pull requests should not be submitted with the
|
86
|
-
security branch as the base branch. Please send all security related
|
87
|
-
information or patches to security@puppet.com as per our [Security
|
88
|
-
Policy](https://puppet.com/security/).
|
89
|
-
|
90
|
-
The CI systems are configured to run against `main`. Over time, this branch
|
91
|
-
will refer to different versions, but its name will remain fixed to avoid having
|
92
|
-
to update CI jobs and tasks as new versions are released.
|
93
|
-
|
94
|
-
Code review checklist
|
95
|
-
---
|
96
|
-
|
97
|
-
This section aims to provide a checklist of things to look for when reviewing a
|
98
|
-
pull request and determining if the change set should be merged into a base
|
99
|
-
branch:
|
100
|
-
|
101
|
-
* All tests pass
|
102
|
-
* Are there any platform gotchas? (Does a change make an assumption about
|
103
|
-
platform specific behavior that is incompatible with other platforms? e.g.
|
104
|
-
Windows paths vs. POSIX paths.)
|
105
|
-
* Is the change backwards compatible? (It should be)
|
106
|
-
* Are there YARD docs for API changes?
|
107
|
-
* Does the change set also require documentation changes? If so is the
|
108
|
-
documentation being kept up to date?
|
109
|
-
* Does the change set include clean code? (software code that is formatted
|
110
|
-
correctly and in an organized manner so that another coder can easily read
|
111
|
-
or modify it.) HINT: `git diff main --check`
|
112
|
-
* Does the change set conform to the contributing guide?
|
113
|
-
|
114
|
-
Commit citizen guidelines:
|
115
|
-
---
|
116
|
-
|
117
|
-
This section aims to provide guidelines for being a good commit citizen by
|
118
|
-
paying attention to our automated build tools.
|
119
|
-
|
120
|
-
* Don’t push on a broken build. (A broken build is defined as a failing job
|
121
|
-
in [Puppet Strings](https://travis-ci.com/github/puppetlabs/puppet-strings)
|
122
|
-
page.)
|
123
|
-
* Watch the build until your changes have gone through green
|
124
|
-
* Update the ticket status and target version. The target version field in
|
125
|
-
our issue tracker should be updated to be the next release of Puppet. For
|
126
|
-
example, if the most recent release of Puppet is 3.1.1 and you merge a
|
127
|
-
backwards compatible change set into main, then the target version should
|
128
|
-
be 3.2.0 in the issue tracker.)
|
129
|
-
* Ensure the pull request is closed (Hint: amend your merge commit to contain
|
130
|
-
the string `closes #123` where 123 is the pull request number and github
|
131
|
-
will automatically close the pull request when the branch is pushed.)
|
132
|
-
|
133
|
-
Example Procedure
|
134
|
-
====
|
135
|
-
|
136
|
-
This section helps a committer rebase and merge a contribution into the base branch.
|
137
|
-
|
138
|
-
Suppose a contributor submits a pull request based on main. The change set
|
139
|
-
fixes a bug reported against strings 0.1.0 which is the most recently released
|
140
|
-
version of strings.
|
141
|
-
|
142
|
-
First, the committer pulls down the branch using the `hub` gem. This tool
|
143
|
-
automates the process of adding the remote repository and creating a local
|
144
|
-
branch to track the remote branch.
|
145
|
-
|
146
|
-
$ hub checkout https://github.com/puppetlabs/puppet-strings/pull/123
|
147
|
-
Branch jeffmccune-pdoc-34_fix_foo_error set up to track remote branch pdoc-34-fix_foo_error from jeffmccune.
|
148
|
-
Switched to a new branch 'jeffmccune-pdoc-34_fix_foo_error'
|
149
|
-
|
150
|
-
It's possible that more changes have been merged into main since the pull
|
151
|
-
request was submitted. In this case it may be necessary to rebase the branch
|
152
|
-
that contains the changes:
|
153
|
-
|
154
|
-
$ git rebase upstream/main
|
155
|
-
|
156
|
-
After the branch has been checked out and rebased, the committer should ensure that
|
157
|
-
the code review check list has been completed.
|
158
|
-
|
159
|
-
Now that we have a topic branch containing the change set based on the most recent
|
160
|
-
`main` branch, the committer merges in:
|
161
|
-
|
162
|
-
$ git checkout main
|
163
|
-
Switched to branch 'main'
|
164
|
-
$ git merge --no-ff --log jeffmccune-pdoc-34_fix_foo_error
|
165
|
-
Merge made by the 'recursive' strategy.
|
166
|
-
foo | 0
|
167
|
-
1 file changed, 0 insertions(+), 0 deletions(-)
|
168
|
-
create mode 100644 foo
|
169
|
-
|
170
|
-
Once the change set has been merged into one base branch, the change set should
|
171
|
-
not be modified in order to keep the history clean, avoid "double" commits, and
|
172
|
-
preserve the usefulness of `git branch --contains`. If there are any merge
|
173
|
-
conflicts, they are to be resolved in the merge commit itself and not by
|
174
|
-
re-writing (rebasing) the patches for one base branch, but not another.
|
175
|
-
|
176
|
-
Once the change set has been merged into `main`, the committer pushes.
|
177
|
-
Please note, the checklist should be complete at this point. It's helpful to make
|
178
|
-
sure your local branches are up to date to avoid one of the branches failing to fast
|
179
|
-
forward while the other succeeds.
|
180
|
-
|
181
|
-
$ git push origin main:main
|
182
|
-
|
183
|
-
That's it! The committer then updates the pull request, updates the issue in
|
184
|
-
our issue tracker, and keeps an eye on the [build
|
185
|
-
status](http://jenkins.puppetlabs.com).
|