Skip to content

Commit 93df209

Browse files
authored
Merge pull request #155 from github/kpaulisse-mega-merge
Release 1.5.0
2 parents 4069cb3 + 61cd024 commit 93df209

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1373
-414
lines changed

.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.4.1
1+
1.5.0

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ The example above reflects the changes in the Puppet catalog from switching an u
5353
- [Requirements](/doc/requirements.md)
5454
- [Limitations](/doc/limitations.md)
5555
- [List of all command line options](/doc/optionsref.md)
56+
- [Environment variables](/doc/advanced-environment-variables.md)
5657

5758
### Project
5859

doc/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@
88
</tr>
99
</thead><tbody>
1010
<tr valign=top>
11+
<td>1.5.0</td>
12+
<td>2017-10-18</td>
13+
<td>
14+
<li><a href="https://github.com/github/octocatalog-diff/pull/151">#151</a>: (Enhancement) Support text differences in files where `source` is an array</li>
15+
<li><a href="https://github.com/github/octocatalog-diff/pull/153">#153</a>: (Enhancement) Support for hiera 5</li>
16+
<li><a href="https://github.com/github/octocatalog-diff/pull/152">#152</a>: (Internal) Better temporary directory handling</li>
17+
</td>
18+
</tr>
19+
<tr valign=top>
1120
<td>1.4.1</td>
1221
<td>2017-10-02</td>
1322
<td>
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Environment variables
2+
3+
The following environment variables have special meaning to octocatalog-diff:
4+
5+
### `OCTOCATALOG_DIFF_CONFIG_FILE`
6+
7+
This environment variable is used to locate the configuration file for the CLI. The use of configuration files is described generally in:
8+
9+
- [Configuration](/doc/configuration.md)
10+
11+
### `OCTOCATALOG_DIFF_CUSTOM_VERSION`
12+
13+
When set, the `octocatalog-diff` CLI will display this as the version number within debugging, instead of the version number in the package. This is most useful if you want to use or include a git SHA in the version number.
14+
15+
```
16+
$ export OCTOCATALOG_DIFF_CUSTOM_VERSION="@$(git rev-parse HEAD)"
17+
$ octocatalog-diff -d ...
18+
D, [2017-10-12T08:57:46.454738 #35205] DEBUG -- : Running octocatalog-diff @504d7f3c91267e5193beb103caae5d4d8cebfee3 with ruby 2.3.1
19+
...
20+
```
21+
22+
### `OCTOCATALOG_DIFF_DEVELOPER_PATH`
23+
24+
When set, instead of loading libraries from the system or bundler location, libraries will be loaded from the specified value of this environment variable. This is used internally for development as we point users to unreleased code for debugging or testing.
25+
26+
```
27+
$ export OCTOCATALOG_DIFF_DEVELOPER_PATH=$HOME/git-checkouts/octocatalog-diff
28+
$ octocatalog-diff ...
29+
```
30+
31+
### `OCTOCATALOG_DIFF_TEMPDIR`
32+
33+
When set:
34+
35+
- `octocatalog-diff` will create all of its temporary directories within the specified directory.
36+
- `octocatalog-diff` will not attempt to remove any temporary directories it creates.
37+
38+
This is useful in the following situations:
39+
40+
- You are calling `octocatalog-diff` from within another program which is highly parallelized, and `at_exit` handlers are difficult to implement. Instead of figuring that all out (if it can even be figured out), you create a temporary directory before the parallelized logic, and remove it afterwards.
41+
42+
- You wish to debug intermediate output. For example, you may be instructed to set this variable and send some of the output to the project maintainers if you request assistance.
43+
44+
This variable is used internally for the parallelized logic for catalog compilation, but the value set from the environment will override any internal usage.
45+
46+
### `OCTOCATALOG_DIFF_VERSION`
47+
48+
This variable is used when building the gem, to override the default version. This is used for internal testing of `octocatalog-diff` before public releases. This variable is not useful outside the build context.
49+
50+
### `PUPPETDB_HOST`
51+
52+
This variable specifies the fully qualified domain name or IP address of the PuppetDB server.
53+
54+
Note: If `PUPPETDB_URL` is specified, then `PUPPETDB_HOST` is not consulted.
55+
56+
### `PUPPETDB_PORT`
57+
58+
This variable specifies the port number of the PuppetDB server.
59+
60+
Note: If `PUPPETDB_URL` is specified, then `PUPPETDB_PORT` is not consulted.
61+
62+
### `PUPPETDB_URL`
63+
64+
This variable specifies the URL to the PuppetDB server.
65+
66+
Example: `https://puppetdb.example.net:8081`
67+
68+
### `PUPPET_FACT_DIR`
69+
70+
This variable specifies the directory path where puppet fact files are stored. (Fact files must be named `<fqdn>.yaml` where `<fqdn>` is specified when running `octocatalog-diff`.)

doc/configuration-hiera.md

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
11
# Configuring octocatalog-diff to use Hiera
22

3-
If you are using Hiera with Puppet, then you must already have a [`hiera.yaml`](https://docs.puppet.com/puppet/latest/reference/config_file_hiera.html) file to configure it. These instructions will guide you through pointing octocatalog-diff at that configuration file.
3+
## Hiera 5
4+
5+
Hiera 5 is included with Puppet 4.9 and higher.
6+
7+
If there is a `hiera.yaml` file in the base directory of the environment that is in hiera 5 format, and you are running Puppet 4.9 or higher, then that file will be recognized by Puppet (and therefore, by octocatalog-diff). There is no special configuration for octocatalog-diff needed to make this work. Similarly, there is no command line option or setting to changed this behavior, because there is no corresponding option to change Puppet's behavior.
8+
9+
If you are running Puppet 4.8 or lower, then the `hiera.yaml` file in the base directory of the environment will be ignored (unless you use `--hiera-config` to specify it as your global configuration file).
10+
11+
If you have no global hiera configuration and you wish to rely on a `hiera.yaml` file in the base directory of your environment, make sure that you are *not* using any of the following command line options or [configuration settings](/doc/configuration.md):
12+
13+
- `--hiera-path` or `settings[:hiera_path]`
14+
- `--hiera-path-strip` or `settings[:hiera_path_strip]`
15+
- `--hiera-config` or `settings[:hiera_config]`
16+
17+
There is more information about Hiera 5 in Puppet's documentation:
18+
19+
- [Enable the environment layer for existing Hiera data](https://puppet.com/docs/puppet/5.3/hiera_migrate_environments.html)
20+
21+
## Hiera global configuration
22+
23+
If you are using Hiera 5 with a global configuration, or you are using Hiera 3 or before, then you must already have a [`hiera.yaml`](https://docs.puppet.com/puppet/latest/reference/config_file_hiera.html) file to configure it. These instructions will guide you through pointing octocatalog-diff at that configuration file.
24+
25+
octocatalog-diff will automatically determine the version of your Hiera configuration file and treat it accordingly. (Hiera 5 configuration files are identified as such by a `version: 5` line in the file itself.)
426

527
Before you start, please understand how octocatalog-diff compiles a catalog:
628

@@ -10,9 +32,9 @@ Before you start, please understand how octocatalog-diff compiles a catalog:
1032
- It compiles the catalog, based on the temporary directory, for environment=production
1133
- It removes the temporary directory
1234

13-
## Configuring the location of hiera.yaml
35+
### Configuring the location of global hiera.yaml
1436

15-
The command line option `--hiera-config PATH` allows you to set the path to hiera.yaml.
37+
The command line option `--hiera-config PATH` allows you to set the path to the global hiera.yaml.
1638

1739
You may specify this as either an absolute or a relative path.
1840

@@ -24,12 +46,9 @@ You may specify this as either an absolute or a relative path.
2446
bin/octocatalog-diff --hiera-config hiera.yaml ...
2547
```
2648
27-
The path is relative to a checkout of your Puppet repository. With the setting above, it will use the file named `hiera.yaml` that is at the top level
28-
of your Puppet checkout.
49+
The path is relative to a checkout of your Puppet repository. With the setting above, it will use the file named `hiera.yaml` that is at the top level of your Puppet checkout.
2950
30-
Perhaps your hiera.yaml file is in a subdirectory of your Puppet checkout. In that case, just use the relative directory path. Be sure not to add a leading `/` though,
31-
because you don't want octocatalog-diff to treat it as an absolute path. In the following example, suppose you have a top level directory called `config` and your
32-
`hiera.yaml` file is contained within it. You could then use:
51+
Perhaps your hiera.yaml file is in a subdirectory of your Puppet checkout. In that case, just use the relative directory path. Be sure not to add a leading `/` though, because you don't want octocatalog-diff to treat it as an absolute path. In the following example, suppose you have a top level directory called `config` and your `hiera.yaml` file is contained within it. You could then use:
3352
3453
```
3554
bin/octocatalog-diff --hiera-config config/hiera.yaml ...
@@ -65,7 +84,7 @@ You may specify this as either an absolute or a relative path.
6584
6685
We strongly recommend that you version-control your hiera.yaml file within your Puppet repository, and use the relative path option described above.
6786
68-
## Configuring the directory in your repository in which hiera data files are found
87+
### Configuring the directory in your repository in which hiera data files are found
6988
7089
The command line option `--hiera-path PATH` allows you to set the directory path, relative to the checkout of your Puppet repository, of your Hiera YAML/JSON data files.
7190
@@ -88,7 +107,7 @@ If you are specifying the Hiera data path in the [configuration file](/doc/confi
88107
89108
octocatalog-diff will fail if you specify a path that is not a directory.
90109
91-
## Configuring the prefix path to strip
110+
### Configuring the prefix path to strip
92111
93112
This is a different, and potentially more complex, alternative to `--hiera-path` / `settings[:hiera_path]` described in the prior section. Unless you have a very good reason, you should prefer to use the instructions above.
94113

doc/dev/releasing.md

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,13 @@ The project maintainers are responsible for bumping the version number, regenera
66

77
*This procedure is performed by a GitHubber.*
88

9-
To test the new version of `octocatalog-diff` in the GitHub Puppet repository:
9+
To test the new version of `octocatalog-diff` in the GitHub Puppet repository, check out `github/puppet` and:
1010

11-
0. In a checkout of the GitHub Puppet repository, start a new branch based off master.
12-
0. In the `octocatalog-diff` checkout:
13-
- Ensure that the desired branch is checked out.
14-
- Choose a unique internal version number which has never been used in CI. A good guideline is that if you're planning to release a version `0.6.0` then for these tests, use `0.6.0a`, `0.6.0b`, ...
15-
- Build the gem using your internal version number:
16-
17-
```
18-
OCTOCATALOG_DIFF_VERSION=0.6.0a rake gem:force-build
19-
```
20-
- Run the task to install the gem into your Puppet checkout:
21-
22-
```
23-
OCTOCATALOG_DIFF_VERSION=0.6.0a rake gem:localinstall
24-
```
25-
26-
0. Back in the Puppet checkout, ensure that the changes are as expected (updates to Gemfile / Gemfile.lock, addition of new gem). Push the change and build appropriate CI job(s) to validate the changes.
11+
- Start a new branch based off master
12+
- Run `script/update-octocatalog-diff -r <ocd_branch_name>`
13+
- Confirm and commit the result
14+
- Make sure all CI jobs pass
15+
- Run the `puppet-catalog-diff` CI job and make sure it passes and shows expected results
2716

2817
## Merging one PR
2918

doc/optionsref.md

Lines changed: 92 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,18 @@ Usage: octocatalog-diff [command line options]
4343
--master-cache-branch BRANCH Branch to cache
4444
--safe-to-delete-cached-master-dir PATH
4545
OK to delete cached master directory at this path
46-
--hiera-config PATH Relative path to hiera YAML file
46+
--hiera-config STRING Full or relative path to global Hiera configuration file globally
47+
--to-hiera-config STRING Full or relative path to global Hiera configuration file for the to branch
48+
--from-hiera-config STRING Full or relative path to global Hiera configuration file for the from branch
4749
--no-hiera-config Disable hiera config file installation
48-
--hiera-path PATH Path to hiera data directory, relative to top directory of repository
50+
--hiera-path STRING Path to hiera data directory, relative to top directory of repository globally
51+
--to-hiera-path STRING Path to hiera data directory, relative to top directory of repository for the to branch
52+
--from-hiera-path STRING Path to hiera data directory, relative to top directory of repository for the from branch
4953
--no-hiera-path Do not use any default hiera path settings
50-
--hiera-path-strip PATH Path prefix to strip when munging hiera.yaml
54+
--hiera-path-strip STRING Path prefix to strip when munging hiera.yaml globally
55+
--to-hiera-path-strip STRING Path prefix to strip when munging hiera.yaml for the to branch
56+
--from-hiera-path-strip STRING
57+
Path prefix to strip when munging hiera.yaml for the from branch
5158
--no-hiera-path-strip Do not use any default hiera path strip settings
5259
--ignore-attr "attr1,attr2,..."
5360
Attributes to ignore
@@ -81,10 +88,10 @@ Usage: octocatalog-diff [command line options]
8188
--from-puppet-binary STRING Full path to puppet binary for the from branch
8289
--facts-terminus STRING Facts terminus: one of yaml, facter
8390
--puppetdb-ssl-ca FILENAME CA certificate that signed the PuppetDB certificate
84-
--puppetdb-ssl-client-password PASSWORD
85-
Password for SSL client key to connect to PuppetDB
8691
--puppetdb-ssl-client-cert FILENAME
8792
SSL client certificate to connect to PuppetDB
93+
--puppetdb-ssl-client-password PASSWORD
94+
Password for SSL client key to connect to PuppetDB
8895
--puppetdb-ssl-client-key FILENAME
8996
SSL client key to connect to PuppetDB
9097
--puppetdb-ssl-client-password-file FILENAME
@@ -643,6 +650,43 @@ by permitting a data type specification as well. (<a href="../lib/octocatalog-di
643650
</td>
644651
</tr>
645652

653+
<tr>
654+
<td valign=top>
655+
<pre><code>--from-hiera-config STRING</code></pre>
656+
</td>
657+
<td valign=top>
658+
Full or relative path to global Hiera configuration file for the from branch
659+
</td>
660+
<td valign=top>
661+
Specify a relative path to the Hiera yaml file (<a href="../lib/octocatalog-diff/cli/options/hiera_config.rb">hiera_config.rb</a>)
662+
</td>
663+
</tr>
664+
665+
<tr>
666+
<td valign=top>
667+
<pre><code>--from-hiera-path STRING</code></pre>
668+
</td>
669+
<td valign=top>
670+
Path to hiera data directory, relative to top directory of repository for the from branch
671+
</td>
672+
<td valign=top>
673+
Specify the path to the Hiera data directory (relative to the top level Puppet checkout). For Puppet Enterprise and the
674+
Puppet control repo template, the value of this should be 'hieradata', which is the default. (<a href="../lib/octocatalog-diff/cli/options/hiera_path.rb">hiera_path.rb</a>)
675+
</td>
676+
</tr>
677+
678+
<tr>
679+
<td valign=top>
680+
<pre><code>--from-hiera-path-strip STRING</code></pre>
681+
</td>
682+
<td valign=top>
683+
Path prefix to strip when munging hiera.yaml for the from branch
684+
</td>
685+
<td valign=top>
686+
Specify the path to strip off the datadir to munge hiera.yaml file (<a href="../lib/octocatalog-diff/cli/options/hiera_path_strip.rb">hiera_path_strip.rb</a>)
687+
</td>
688+
</tr>
689+
646690
<tr>
647691
<td valign=top>
648692
<pre><code>--from-puppet-binary STRING</code></pre>
@@ -773,10 +817,10 @@ This timeout is specified in seconds. (<a href="../lib/octocatalog-diff/cli/opti
773817

774818
<tr>
775819
<td valign=top>
776-
<pre><code>--hiera-config PATH</code></pre>
820+
<pre><code>--hiera-config STRING</code></pre>
777821
</td>
778822
<td valign=top>
779-
Relative path to hiera YAML file
823+
Full or relative path to global Hiera configuration file globally
780824
</td>
781825
<td valign=top>
782826
Specify a relative path to the Hiera yaml file (<a href="../lib/octocatalog-diff/cli/options/hiera_config.rb">hiera_config.rb</a>)
@@ -785,10 +829,10 @@ This timeout is specified in seconds. (<a href="../lib/octocatalog-diff/cli/opti
785829

786830
<tr>
787831
<td valign=top>
788-
<pre><code>--hiera-path PATH</code></pre>
832+
<pre><code>--hiera-path STRING</code></pre>
789833
</td>
790834
<td valign=top>
791-
Path to hiera data directory, relative to top directory of repository
835+
Path to hiera data directory, relative to top directory of repository globally
792836
</td>
793837
<td valign=top>
794838
Specify the path to the Hiera data directory (relative to the top level Puppet checkout). For Puppet Enterprise and the
@@ -798,10 +842,10 @@ Puppet control repo template, the value of this should be 'hieradata', which is
798842

799843
<tr>
800844
<td valign=top>
801-
<pre><code>--hiera-path-strip PATH</code></pre>
845+
<pre><code>--hiera-path-strip STRING</code></pre>
802846
</td>
803847
<td valign=top>
804-
Path prefix to strip when munging hiera.yaml
848+
Path prefix to strip when munging hiera.yaml globally
805849
</td>
806850
<td valign=top>
807851
Specify the path to strip off the datadir to munge hiera.yaml file (<a href="../lib/octocatalog-diff/cli/options/hiera_path_strip.rb">hiera_path_strip.rb</a>)
@@ -1541,6 +1585,43 @@ by permitting a data type specification as well. (<a href="../lib/octocatalog-di
15411585
</td>
15421586
</tr>
15431587

1588+
<tr>
1589+
<td valign=top>
1590+
<pre><code>--to-hiera-config STRING</code></pre>
1591+
</td>
1592+
<td valign=top>
1593+
Full or relative path to global Hiera configuration file for the to branch
1594+
</td>
1595+
<td valign=top>
1596+
Specify a relative path to the Hiera yaml file (<a href="../lib/octocatalog-diff/cli/options/hiera_config.rb">hiera_config.rb</a>)
1597+
</td>
1598+
</tr>
1599+
1600+
<tr>
1601+
<td valign=top>
1602+
<pre><code>--to-hiera-path STRING</code></pre>
1603+
</td>
1604+
<td valign=top>
1605+
Path to hiera data directory, relative to top directory of repository for the to branch
1606+
</td>
1607+
<td valign=top>
1608+
Specify the path to the Hiera data directory (relative to the top level Puppet checkout). For Puppet Enterprise and the
1609+
Puppet control repo template, the value of this should be 'hieradata', which is the default. (<a href="../lib/octocatalog-diff/cli/options/hiera_path.rb">hiera_path.rb</a>)
1610+
</td>
1611+
</tr>
1612+
1613+
<tr>
1614+
<td valign=top>
1615+
<pre><code>--to-hiera-path-strip STRING</code></pre>
1616+
</td>
1617+
<td valign=top>
1618+
Path prefix to strip when munging hiera.yaml for the to branch
1619+
</td>
1620+
<td valign=top>
1621+
Specify the path to strip off the datadir to munge hiera.yaml file (<a href="../lib/octocatalog-diff/cli/options/hiera_path_strip.rb">hiera_path_strip.rb</a>)
1622+
</td>
1623+
</tr>
1624+
15441625
<tr>
15451626
<td valign=top>
15461627
<pre><code>--to-puppet-binary STRING</code></pre>

0 commit comments

Comments
 (0)