Skip to content

Commit d03cc80

Browse files
authored
Merge branch 'master' into glob_modulepath_support
2 parents e95d6f5 + 86db6e4 commit d03cc80

File tree

6 files changed

+172
-12
lines changed

6 files changed

+172
-12
lines changed

.dockerignore

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
*.rbc
2+
/.config
3+
/coverage/
4+
/InstalledFiles
5+
/pkg/
6+
/spec/reports/
7+
/spec/examples.txt
8+
/test/tmp/
9+
/test/version_tmp/
10+
/tmp/
11+
12+
# Used by dotenv library to load environment variables.
13+
# .env
14+
15+
## Specific to RubyMotion:
16+
.dat*
17+
.repl_history
18+
build/
19+
*.bridgesupport
20+
build-iPhoneOS/
21+
build-iPhoneSimulator/
22+
23+
## Specific to RubyMotion (use of CocoaPods):
24+
#
25+
# We recommend against adding the Pods directory to your .gitignore. However
26+
# you should judge for yourself, the pros and cons are mentioned at:
27+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
28+
#
29+
# vendor/Pods/
30+
31+
## Documentation cache and generated files:
32+
/.yardoc/
33+
/_yardoc/
34+
/rdoc/
35+
36+
## Environment normalization:
37+
/.bundle/
38+
/vendor/bundle
39+
/lib/bundler/man/
40+
41+
# for a library or gem, you might want to ignore these files since the code is
42+
# intended to run in multiple environments; otherwise, check them in:
43+
# Gemfile.lock
44+
# .ruby-version
45+
# .ruby-gemset
46+
47+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
48+
.rvmrc
49+
50+
# Specifics for octocatalog-diff
51+
bin/bundler
52+
bin/facter
53+
bin/hiera
54+
bin/htmldiff
55+
bin/httparty
56+
bin/ldiff
57+
bin/parallel_cucumber
58+
bin/parallel_rspec
59+
bin/parallel_spinach
60+
bin/parallel_test
61+
bin/puppet
62+
bin/rake
63+
bin/rspec
64+
bin/rubocop
65+
bin/ruby-parse
66+
bin/ruby-rewrite
67+
bin/safe_yaml
68+
69+
# Ignore config created during testing
70+
.puppet_version
71+
.parallel_runtime_rspec.log
72+
.parallel_runtime_integration.log
73+
.parallel_runtime_tests.log
74+
.rspec_parallel
75+
76+
# Packaged gem
77+
/pkg/
78+
Gemfile.lock
79+
80+
.git

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ We will handle updating the version, tagging the release, and releasing the gem.
2222

2323
Here are a few things you can do that will increase the likelihood of your pull request being accepted:
2424

25-
- Make sure your contribution is consistent with our [roadmap](roadmap.md).
25+
- Make sure your contribution is consistent with our [roadmap](/doc/roadmap.md).
2626

2727
- Follow the [style guide](https://github.com/bbatsov/ruby-style-guide).
2828

.github/workflows/main.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: CI
2+
on: [push]
3+
jobs:
4+
puppet-3-8-7:
5+
env:
6+
PUPPET_VERSIONS: "3.8.7"
7+
PUPPET_VERSION: "3.8.7"
8+
RUBOCOP_TEST: false
9+
RSPEC_TEST: true
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
ruby-version: ["2.0", "2.1"]
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v1
17+
- name: Build container
18+
run: docker build . --file Dockerfile --tag octocatalog-diff:ruby${{matrix.ruby-version}} --build-arg RUBY_VERSION=${{matrix.ruby-version}}
19+
- name: Tests
20+
run: docker run -e PUPPET_VERSION -e PUPPET_VERSIONS -e RSPEC_TEST -e RUBOCOP_TEST -e ENFORCE_COVERAGE octocatalog-diff:ruby${{matrix.ruby-version}} /app/script/cibuild
21+
22+
puppet-4-10-10:
23+
env:
24+
PUPPET_VERSIONS: "4.10.10"
25+
PUPPET_VERSION: "4.10.10"
26+
RUBOCOP_TEST: false
27+
RSPEC_TEST: true
28+
runs-on: ubuntu-latest
29+
strategy:
30+
matrix:
31+
ruby-version: ["2.1", "2.2", "2.3"]
32+
steps:
33+
- name: Checkout code
34+
uses: actions/checkout@v1
35+
- name: Build container
36+
run: docker build . --file Dockerfile --tag octocatalog-diff:ruby${{matrix.ruby-version}} --build-arg RUBY_VERSION=${{matrix.ruby-version}}
37+
- name: Tests
38+
run: docker run -e PUPPET_VERSION -e PUPPET_VERSIONS -e RSPEC_TEST -e RUBOCOP_TEST -e ENFORCE_COVERAGE octocatalog-diff:ruby${{matrix.ruby-version}} /app/script/cibuild
39+
40+
puppet-5-5-8:
41+
env:
42+
PUPPET_VERSIONS: "5.5.8"
43+
PUPPET_VERSION: "5.5.8"
44+
RUBOCOP_TEST: false
45+
RSPEC_TEST: true
46+
runs-on: ubuntu-latest
47+
strategy:
48+
matrix:
49+
ruby-version: ["2.4", "2.5", "2.6"]
50+
steps:
51+
- name: Checkout code
52+
uses: actions/checkout@v1
53+
- name: Build container
54+
run: docker build . --file Dockerfile --tag octocatalog-diff:ruby${{matrix.ruby-version}} --build-arg RUBY_VERSION=${{matrix.ruby-version}}-stretch
55+
- name: Tests
56+
run: docker run -e PUPPET_VERSION -e PUPPET_VERSIONS -e RSPEC_TEST -e RUBOCOP_TEST -e ENFORCE_COVERAGE octocatalog-diff:ruby${{matrix.ruby-version}} /app/script/cibuild
57+
- name: Rubocop and Coverage
58+
run: docker run -e PUPPET_VERSION -e PUPPET_VERSIONS -e RSPEC_TEST -e RUBOCOP_TEST -e ENFORCE_COVERAGE octocatalog-diff:ruby${{matrix.ruby-version}} /app/script/cibuild
59+
if: matrix.ruby-version == '2.6'
60+
env:
61+
RUBOCOP_TEST: true
62+
ENFORCE_COVERAGE: true

Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
ARG RUBY_VERSION="2.6"
2+
FROM ruby:${RUBY_VERSION} as ruby
3+
ARG RUBY_VERSION
4+
ENV RUBY_VERSION="${RUBY_VERSION}"
5+
RUN rm -rf $GEM_HOME $BUNDLE_PATH $BUNDLE_BIN $BUNDLE_APP_CONFIG
6+
RUN apt-get update && apt-get install -y cmake openssl libssl-dev
7+
RUN sed -i'' -e 's/CipherString = DEFAULT@SECLEVEL=2/CipherString = DEFAULT@SECLEVEL=1/g' /etc/ssl/openssl.cnf
8+
RUN sed -i'' -e 's/MinProtocol = TLSv1.2/MinProtocol = TLSv1/g' /etc/ssl/openssl.cnf
9+
10+
FROM scratch AS app
11+
COPY --from=ruby / /
12+
WORKDIR /app
13+
ENV LANG="C.UTF-8"
14+
COPY . .
15+
#RUN gem install bundler -v 1.17.2
16+
RUN script/bootstrap
17+
18+
CMD ["/app/script/cibuild"]

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,6 @@ If you have a problem or suggestion, please [open an issue](https://github.com/g
8181

8282
It requires 3rd party ruby gems found [here](/vendor/cache). It also includes portions of other open source projects [here](/lib/octocatalog-diff/external/pson), [here](/spec/octocatalog-diff/fixtures/repos/default/modules/stdlib), [here](/spec/octocatalog-diff/support/httparty) and [here](/spec/octocatalog-diff/tests/external/pson). All 3rd party code and required gems are licensed either as MIT or Apache 2.0.
8383

84-
## Authors
84+
## Authors / Owners
8585

86-
`octocatalog-diff` was designed and authored by [Kevin Paulisse](https://github.com/kpaulisse) and is now maintained, reviewed, and tested by Kevin and the rest of the Site Reliability Engineering team at GitHub.
86+
`octocatalog-diff` was originally designed and authored by [Kevin Paulisse](https://github.com/kpaulisse), and is now maintained by the Site Reliability Engineering team at GitHub.

doc/limitations.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22

33
Testing of Puppet catalogs is faster than running the agent, but you need to be careful of the following limitations:
44

5-
0. Facts are not taken from a live agent run
5+
1. Facts are not taken from a live agent run
66

7-
octocatalog-diff by default uses the facts reported from a node's more recent Puppet run. If you have made changes to custom facts, catalog testing will **NOT** be an adequate test of whether your custom facts worked. (You can still use octocatalog-diff to help predict changes to nodes based on changes to facts, by overriding facts on the command line.)
7+
octocatalog-diff by default uses the facts reported from a node's more recent Puppet run. If you have made changes to custom facts, catalog testing will **NOT** be an adequate test of whether your custom facts worked. (You can still use octocatalog-diff to help predict changes to nodes based on changes to facts, by overriding facts on the command line.)
88

9-
0. Agents handle depenency ordering and implementation details
9+
1. Agents handle depenency ordering and implementation details
1010

11-
The catalog defines the state of the system, but it's up to the agent to determine how to bring the system to a point that matches the catalog. The agent is responsible for order of operations and actually making the change.
11+
The catalog defines the state of the system, but it's up to the agent to determine how to bring the system to a point that matches the catalog. The agent is responsible for order of operations and actually making the change.
1212

13-
Two specific situations that catalog testing does **NOT** detect are:
13+
Two specific situations that catalog testing does **NOT** detect are:
1414

15-
- Dependency loops (e.g., you have made A require B, B require C, and C require A).
15+
- Dependency loops (e.g., you have made A require B, B require C, and C require A).
1616

17-
- Operations not supported by the provider. For example, assume that in your current Puppet manifests, you set the size of a file system to 100 GB. You change this in your new branch to 50 GB. octocatalog-diff will dutifully report this change to you. However, the agent will fail to make the change, because it is not possible to shrink a file system from 100 GB to 50 GB.
17+
- Operations not supported by the provider. For example, assume that in your current Puppet manifests, you set the size of a file system to 100 GB. You change this in your new branch to 50 GB. octocatalog-diff will dutifully report this change to you. However, the agent will fail to make the change, because it is not possible to shrink a file system from 100 GB to 50 GB.
1818

19-
0. Changes in underlying providers may not be noticed
19+
1. Changes in underlying providers may not be noticed
2020

21-
Consider that you are using a Puppet module that creates a file system. The current implementation of that module checks to see if *any* file system is present on the device, and creates a new file system there if no file system was present. You upgrade the module, and the new version checks to see if *the specified* file system is present on the device, and reformats the device with the specified file system (regardless of whether there was no file system or if there was an existing file system of a different type). There would be no catalog changes (hence octocatalog-diff would report nothing) because the catalog simply instructs the agent to create a file system of the specified type at the defined location. However, the actual implementation of those instructions has changed dramatically.
21+
Consider that you are using a Puppet module that creates a file system. The current implementation of that module checks to see if *any* file system is present on the device, and creates a new file system there if no file system was present. You upgrade the module, and the new version checks to see if *the specified* file system is present on the device, and reformats the device with the specified file system (regardless of whether there was no file system or if there was an existing file system of a different type). There would be no catalog changes (hence octocatalog-diff would report nothing) because the catalog simply instructs the agent to create a file system of the specified type at the defined location. However, the actual implementation of those instructions has changed dramatically.
2222

2323
In general catalog testing is great for:
2424

0 commit comments

Comments
 (0)