Generate impact analysis reports
Impact analysis reports show you the potential impact and risk of proposed code changes, so you can decide how, and if, you want to handle those potential changes. You can generate reports on demand or add impact analysis tasks to your pipelines to generate impact analysis reports for every change submitted to your repos. Impact analysis reports are generated by diffing the deployment's current catalog against a newly-generated catalog for your specified deployment conditions.
$environment
variable in your Puppet
manifest. Instead, use Hiera and class parameters.Impact analysis workflow
development
) and a specific version of code, identified by a Git commit SHA. Using the designated environment and
SHA, Continuous Delivery for PE does the following during an impact analysis run:- Create a temporary branch in the control repo using the naming scheme
<BRANCH>_cdpe_ia_<TIMESTAMP>
. If analyzing a module repo, temporary branches are created in the module repo and in the control repo that is associated with the module repo. The temporary branch serves as temporary environment in which to deploy your new code and detect possible changes. - Deploy code associated with the targeted commit SHA in the temporary branch.
- Calculate module version changes by comparing module deployment data from the target environment and the temporary environment.
- Calculate changes to Hiera parameters. If Hiera regex is configured, Continuous Delivery for PE uses the regex to locate Hiera files. Otherwise, it looks for changes
in Hiera files ending with
.yaml
in thedata
orhieradata
directories. - Calculate impacted nodes:
- Query PuppetDB for nodes that contain resources where the file parameter matches one of the modified module versions or Hiera files. Module versions are queried as a file path to the module.
- Query PuppetDB for catalog input data matching modified Hiera parameters.
- Calculate impacted node resources:
- Query PuppetDB to get the current catalog for each impacted node.
- Use the code deployed to the temporary environment to compile a new catalog for each impacted node.
- For each impacted node, compare the new (temporary environment) catalog to the current (live environment) catalog.
- Build the impact analysis report based on the discovered differenced between the catalogs.
- Report the impacted nodes and resources.
Add impact analysis to a control repo pipeline
If you add an impact analysis task to your control repo pipeline, an impact analysis report is automatically generated each time the pipeline runs and your specified conditions are met.
- Configure impact analysis.
- Construct a pipeline for your module that includes at least one deployment.
Each pipeline can have unlimited impact analysis tasks, but each stage in a pipeline can have only one impact analysis task. Additionally, an impact analysis task cannot be in the same stage as a deployment task.
This section explains how to add an impact analysis step to a pipeline constructed in the web UI. If you manage your pipelines with code, go to .cd4pe.yaml file structure for guidance on adding impact analysis steps to your pipelines.
Add impact analysis to a module pipeline
If you add an impact analysis task to your module pipeline, an impact analysis report is automatically generated each time the pipeline runs and your specified conditions are met.
- Configure impact analysis.
- Construct a pipeline for your module that includes at least one deployment.
Each pipeline can have unlimited impact analysis tasks, but each stage in a pipeline can have only one impact analysis task. Additionally, an impact analysis task cannot be in the same stage as a deployment task.
This section explains how to add an impact analysis step to a pipeline constructed in the web UI. If you manage your pipelines with code, go to .cd4pe.yaml file structure for guidance on adding impact analysis steps to your pipelines.
Generate an impact analysis report on demand
Without triggering a pipeline, you can generate an impact analysis report for any commit made to a control repo or module that Continuous Delivery for Puppet Enterprise (PE) monitors.