Package: cfgnet
CfgNetCfgNet is a plugin-based framework for detecting and tracking dependencies among configuration options across the used technology stack of a software project.
Essentially, CfgNet represents configuration options of configuration artifacts as trees and connects them to build a configuration network, where links between the leaf nodes of a tree correspond to the dependencies between configuration options.
Our idea is to have a framework in which technology plugins analyze different configuration files (e.g., Dockerfiles or build scripts) and create nodes for configuration options with their user-defined values.
Linker plugins then connect the nodes in case a dependency exists using a specific linker heuristic.We envision that CfgNet is used within a Git hook (e.g., pre-commit hook) to prevent dependency conflicts during the development and maintenance of software systems.
That is, whenever changes are made, CfgNet can check the changes before the actual commit gets pushed to the repository and reports a warning if it has detected possible dependency conflicts.
This way, developer can check the changes again and even use the information that CfgNet provides to fix the dependency conflicts.InstallationCfgNet is a package on PyPI. You can install it with the following command:pip install cfgnetYou can also build it locally withpoetry.
Please refer to the documentation of poetry for further details.Basic UsageCfgNet provides a method-based command line interface with the commandsinit,validate,export,analyze, andextract.
Each method requires theproject_rootas option that points towards the root directory of the project on which you want to apply the CfgNet.To initialize a reference configuration network, use theinitcommand.cfgnet init <project_root>To detect dependency conflicts against the initialized reference network, you need to call
thevalidatecommand. Detected dependency conflicts will be displayed on screen.cfgnet validate <project_root>To export the reference network for visualization, use theexportcommand.
Theexportcommand additionally requires aoutputandformatoption.
While the former specifies the name of the output file the latter defines which format the configuration network should be converted to.
Available formats arejsonanddot.
By default, the export includes only linked value nodes.
To export all nodes from the configuration network, you have te set the optioninclude-unlinked.cfgnet export --output=<name> --format=<format> <project_root>
cfgnet export --output=<name> --format=<format> --include-unlinked <project_root>To visualize the reference network immediately without exporting the format, use theexportcommand with the-visualize-dotoption.
The visualization of the configuration network is stored in.cfgnet/exportusing thepngformat by default.
However, the format can be changed to eitherpdforpngusing the format option.
By default, the network visualization includes only linked value nodes.
To visualize the entire configuration network including value nodes that are not linked to other nodes, you have to set the optioninclude-unlinked.cfgnet export --output=<name> --visualize-dot <project_root>
cfgnet export --output=<name> --format=<format> --visualize-dot <project_root>
cfgnet export --output=<name> --format=<format> --include-unlinked --visualize-dot <project_root>Theanalyzecommand is used for analyzing the commit history of software systems in an automated manner.
When the analysis is finished, all detected configuration conflicts will be stored in.cfgnet/analysis.cfgnet analyze <project_root>To extract the key-value pairs of all configuration artifacts within a software project, use theextractcommand. Theextractcommand additionally requires anoutputoptions, which specifies the directory where the key-value pairs are stored using the JSON format.cfgnet extract <project_root> --output=<output>The commandsinitandanalyzecan be further configured with the following options:(1) --enable-static-blacklist
(2) --enable-internal-conflicts
(3) --enable-all-conflicts
(4) --config-files=<absolute_file_path>These options enable (1) blacklisted values, which are taken into account when creating links, (2) the detection of conflicts within the same configuration artifact, (3) the detection of all conflict types, and (4) parsing of specific configuration files (e.g., configuration files of the operating machine that are not in the git repository of the software project), respectively. The option--config-filescan be specified multiple times. Theconfig-fileoption can also be used to configure theextractcommand.For a documentation of further options runcfgnet --helpDocumentationYou can build the documentation withmake docsThe HTML version of the documentation will be indocs/_build/html.ContributingTo contribute to this project feel free to create pull requests.
Please read ourguidelines and instructions for developmentfirst.