Skip to content

Commit 06f2162

Browse files
authored
Merge pull request #513 from voxpupuli/modulesync
modulesync 2.12.0 and drop puppet 4
2 parents bd2a571 + 87aad93 commit 06f2162

21 files changed

Lines changed: 246 additions & 343 deletions

.github/CONTRIBUTING.md

Lines changed: 130 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# Contribution guidelines
2+
3+
## Table of contents
4+
5+
* [Contributing](#contributing)
6+
* [Writing proper commits - short version](#writing-proper-commits-short-version)
7+
* [Writing proper commits - long version](#writing-proper-commits-long-version)
8+
* [Dependencies](#dependencies)
9+
* [Note for OS X users](#note-for-os-x-users)
10+
* [The test matrix](#the-test-matrix)
11+
* [Syntax and style](#syntax-and-style)
12+
* [Running the unit tests](#running-the-unit-tests)
13+
* [Unit tests in docker](#unit-tests-in-docker)
14+
* [Integration tests](#integration-tests)
15+
116
This module has grown over time based on a range of contributions from
217
people using it. If you follow these contributing guidelines your patch
318
will likely make it into a release a little more quickly.
@@ -8,29 +23,92 @@ Please note that this project is released with a Contributor Code of Conduct.
823
By participating in this project you agree to abide by its terms.
924
[Contributor Code of Conduct](https://voxpupuli.org/coc/).
1025

11-
1. Fork the repo.
12-
13-
1. Create a separate branch for your change.
14-
15-
1. We only take pull requests with passing tests, and documentation. [travis-ci](http://travis-ci.org)
16-
runs the tests for us. You can also execute them locally. This is explained
17-
in a later section.
18-
19-
1. Checkout [our docs](https://voxpupuli.org/docs/#reviewing-a-module-pr) we
20-
use to review a module and the [official styleguide](https://puppet.com/docs/puppet/6.0/style_guide.html).
21-
They provide some guidance for new code that might help you before you submit a pull request.
22-
23-
1. Add a test for your change. Only refactoring and documentation
24-
changes require no new tests. If you are adding functionality
25-
or fixing a bug, please add a test.
26-
27-
1. Squash your commits down into logical components. Make sure to rebase
28-
against our current master.
29-
30-
1. Push the branch to your fork and submit a pull request.
31-
32-
Please be prepared to repeat some of these steps as our contributors review
33-
your code.
26+
* Fork the repo.
27+
* Create a separate branch for your change.
28+
* We only take pull requests with passing tests, and documentation. [travis-ci](http://travis-ci.org) runs the tests for us. You can also execute them locally. This is explained [in a later section](#the-test-matrix).
29+
* Checkout [our docs](https://voxpupuli.org/docs/reviewing_pr/) we use to review a module and the [official styleguide](https://puppet.com/docs/puppet/6.0/style_guide.html). They provide some guidance for new code that might help you before you submit a pull request.
30+
* Add a test for your change. Only refactoring and documentation changes require no new tests. If you are adding functionality or fixing a bug, please add a test.
31+
* Squash your commits down into logical components. Make sure to rebase against our current master.
32+
* Push the branch to your fork and submit a pull request.
33+
34+
Please be prepared to repeat some of these steps as our contributors review your code.
35+
36+
## Writing proper commits - short version
37+
38+
* Make commits of logical units.
39+
* Check for unnecessary whitespace with "git diff --check" before committing.
40+
* Commit using Unix line endings (check the settings around "crlf" in git-config(1)).
41+
* Do not check in commented out code or unneeded files.
42+
* The first line of the commit message should be a short description (50 characters is the soft limit, excluding ticket number(s)), and should skip the full stop.
43+
* Associate the issue in the message. The first line should include the issue number in the form "(#XXXX) Rest of message".
44+
* The body should provide a meaningful commit message, which:
45+
*uses the imperative, present tense: `change`, not `changed` or `changes`.
46+
* includes motivation for the change, and contrasts its implementation with the previous behavior.
47+
* Make sure that you have tests for the bug you are fixing, or feature you are adding.
48+
* Make sure the test suites passes after your commit:
49+
* When introducing a new feature, make sure it is properly documented in the README.md
50+
51+
## Writing proper commits - long version
52+
53+
1. Make separate commits for logically separate changes.
54+
55+
Please break your commits down into logically consistent units
56+
which include new or changed tests relevant to the rest of the
57+
change. The goal of doing this is to make the diff easier to
58+
read for whoever is reviewing your code. In general, the easier
59+
your diff is to read, the more likely someone will be happy to
60+
review it and get it into the code base.
61+
62+
If you are going to refactor a piece of code, please do so as a
63+
separate commit from your feature or bug fix changes.
64+
65+
We also really appreciate changes that include tests to make
66+
sure the bug is not re-introduced, and that the feature is not
67+
accidentally broken.
68+
69+
Describe the technical detail of the change(s). If your
70+
description starts to get too long, that is a good sign that you
71+
probably need to split up your commit into more finely grained
72+
pieces.
73+
74+
Commits which plainly describe the things which help
75+
reviewers check the patch and future developers understand the
76+
code are much more likely to be merged in with a minimum of
77+
bike-shedding or requested changes. Ideally, the commit message
78+
would include information, and be in a form suitable for
79+
inclusion in the release notes for the version of Puppet that
80+
includes them.
81+
82+
Please also check that you are not introducing any trailing
83+
whitespace or other "whitespace errors". You can do this by
84+
running "git diff --check" on your changes before you commit.
85+
86+
2. Sending your patches
87+
88+
To submit your changes via a GitHub pull request, we _highly_
89+
recommend that you have them on a topic branch, instead of
90+
directly on `master`.
91+
It makes things much easier to keep track of, especially if
92+
you decide to work on another thing before your first change
93+
is merged in.
94+
95+
GitHub has some pretty good
96+
[general documentation](http://help.github.com/) on using
97+
their site. They also have documentation on
98+
[creating pull requests](http://help.github.com/send-pull-requests/).
99+
100+
In general, after pushing your topic branch up to your
101+
repository on GitHub, you can switch to the branch in the
102+
GitHub UI and click "Pull Request" towards the top of the page
103+
in order to open a pull request.
104+
105+
106+
3. Update the related GitHub issue.
107+
108+
If there is a GitHub issue associated with the change you
109+
submitted, then you should update the ticket to include the
110+
location of your branch, along with any other commentary you
111+
may wish to make.
34112

35113
## Dependencies
36114

@@ -51,22 +129,39 @@ You can install all needed gems for spec tests into the modules directory by
51129
running:
52130

53131
```sh
54-
bundle install --path .vendor/ --without development system_tests release
132+
bundle install --path .vendor/ --without development system_tests release --jobs "$(nproc)"
55133
```
56134

57135
If you also want to run acceptance tests:
58136

59137
```sh
60-
bundle install --path .vendor/ --with system_tests --without development release
138+
bundle install --path .vendor/ --with system_tests --without development release --jobs "$(nproc)"
61139
```
62140

63141
Our all in one solution if you don't know if you need to install or update gems:
64142

65143
```sh
66-
bundle install --path .vendor/ --with system_tests --without development release; bundle update; bundle clean
144+
bundle install --path .vendor/ --with system_tests --without development release --jobs "$(nproc)"; bundle update; bundle clean
145+
```
146+
147+
As an alternative to the `--jobs "$(nproc)` parameter, you can set an
148+
environment variable:
149+
150+
```sh
151+
BUNDLE_JOBS="$(nproc)"
67152
```
68153

69-
## Syntax and style
154+
### Note for OS X users
155+
156+
`nproc` isn't a valid command under OS x. As an alternative, you can do:
157+
158+
```sh
159+
--jobs "$(sysctl -n hw.ncpu)"
160+
```
161+
162+
## The test matrix
163+
164+
### Syntax and style
70165

71166
The test suite will run [Puppet Lint](http://puppet-lint.com/) and
72167
[Puppet Syntax](https://github.com/gds-operations/puppet-syntax) to
@@ -84,7 +179,7 @@ against it. You can run those locally ahead of time with:
84179
bundle exec rake rubocop
85180
```
86181

87-
## Running the unit tests
182+
### Running the unit tests
88183

89184
The unit test suite covers most of the code, as mentioned above please
90185
add tests if you're adding new functionality. If you've not used
@@ -109,7 +204,7 @@ To run a specific spec test set the `SPEC` variable:
109204
bundle exec rake spec SPEC=spec/foo_spec.rb
110205
```
111206

112-
### Unit tests in docker
207+
#### Unit tests in docker
113208

114209
Some people don't want to run the dependencies locally or don't want to install
115210
ruby. We ship a Dockerfile that enables you to run all unit tests and linting.
@@ -124,7 +219,7 @@ permission to talk to it. You can specify a remote docker host by setting the
124219
`DOCKER_HOST` environment variable. it will copy the content of the module into
125220
the docker image. So it will not work if a Gemfile.lock exists.
126221

127-
## Integration tests
222+
### Integration tests
128223

129224
The unit tests just check the code runs, not that it does exactly what
130225
we want on a real machine. For that we're using
@@ -160,19 +255,21 @@ created virtual machines will be in `.vagrant/beaker_vagrant_files`.
160255
Beaker also supports docker containers. We also use that in our automated CI
161256
pipeline at [travis-ci](http://travis-ci.org). To use that instead of Vagrant:
162257

163-
```
164-
PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=debian9-64{hypervisor=docker} BEAKER_destroy=yes bundle exec rake beaker
258+
```sh
259+
PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=debian10-64{hypervisor=docker} BEAKER_destroy=yes bundle exec rake beaker
165260
```
166261

167-
You can replace the string `debian9` with any common operating system.
262+
You can replace the string `debian10` with any common operating system.
168263
The following strings are known to work:
169264

170265
* ubuntu1604
171266
* ubuntu1804
172267
* debian8
173268
* debian9
269+
* debian10
174270
* centos6
175271
* centos7
272+
* centos8
176273

177274
The easiest way to debug in a docker container is to open a shell:
178275

.msync.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
modulesync_config_version: '2.5.1'
1+
modulesync_config_version: '2.12.0'

.rubocop.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
require: rubocop-rspec
22
AllCops:
3+
# Puppet Server 5 defaults to jruby 1.7 so TargetRubyVersion must stay at 1.9 until we drop support for puppet 5
34
TargetRubyVersion: 1.9
45
Include:
56
- ./**/*.rb

.sync.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,4 @@
1919
- set: debian9-64
2020
options:
2121
script: 'bundle exec rspec spec/acceptance/php_spec.rb'
22-
- set: debian8-64
23-
options:
24-
script: 'bundle exec rspec spec/acceptance/php_spec.rb'
2522
secure: "GOhttACuJt+3s38m4WnW5RuTgwqaAoeEQnNT+X1Ukn7KdcIk4KV8NzYU/CC0VIm8lUOnBWYJKEC4ixX/J/4Wbxox2RAoKMQrO++L0DB1zTCJnq9SfoUBMaQhXvLu+PbxAR0p3P47ozra0C+pOWDpOaxT9ecufrPQt9W9Z4aY/bs="

0 commit comments

Comments
 (0)