Skip to main content

A Framework for Tracking Configuration Dependencies Across a Software Project

Project description

CfgNet

CfgNet 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.

Installation

CfgNet is a package on PyPI. You can install it with the following command:

pip install cfgnet

You can also build it locally with poetry. Please refer to the documentation of poetry for further details.

Basic Usage

CfgNet provides a method-based command line interface with the commands init, validate, export, analyze, and extract. Each method requires the project_root as 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 the init command.

cfgnet init <project_root>

To detect dependency conflicts against the initialized reference network, you need to call the validate command. Detected dependency conflicts will be displayed on screen.

cfgnet validate <project_root>

To export the reference network for visualization, use the export command. The export command additionally requires a output and format option. While the former specifies the name of the output file the latter defines which format the configuration network should be converted to. Available formats are json and dot. By default, the export includes only linked value nodes. To export all nodes from the configuration network, you have te set the option include-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 the export command with the -visualize-dot option. The visualization of the configuration network is stored in .cfgnet/export using the png format by default. However, the format can be changed to either pdf or png using 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 option include-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>

The analyze command 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 the extract command. The extract command additionally requires an output options, which specifies the directory where the key-value pairs are stored using the JSON format.

cfgnet extract <project_root> --output=<output>

The commands init and analyze can 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-files can be specified multiple times. The config-file option can also be used to configure the extract command.

For a documentation of further options run

cfgnet --help

Documentation

You can build the documentation with

make docs

The HTML version of the documentation will be in docs/_build/html.

Contributing

To contribute to this project feel free to create pull requests. Please read our guidelines and instructions for development first.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cfgnet-1.0.5.tar.gz (58.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cfgnet-1.0.5-py3-none-any.whl (109.5 kB view details)

Uploaded Python 3

File details

Details for the file cfgnet-1.0.5.tar.gz.

File metadata

  • Download URL: cfgnet-1.0.5.tar.gz
  • Upload date:
  • Size: 58.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.11.3 Linux/6.8.0-1021-azure

File hashes

Hashes for cfgnet-1.0.5.tar.gz
Algorithm Hash digest
SHA256 bfb715dffcf9c5a76673254950a6eec6dfafec8e9ebb36a3a8ce46a5c7972505
MD5 a982be25dff8f2c7c3dd5624b5f07bed
BLAKE2b-256 b829f03de5bb900bf4ca1c820b75949a0a152118a90fe2e381cf1c89daa8a647

See more details on using hashes here.

File details

Details for the file cfgnet-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: cfgnet-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 109.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.11.3 Linux/6.8.0-1021-azure

File hashes

Hashes for cfgnet-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 9a53c495aa1f5ba769117c832e16962fe15c7f7e9aabf6584be5f252fcb8406a
MD5 79ac95e8728ec926ea2f7ef5beb2d740
BLAKE2b-256 f9c18d0bc49ab30fcfe3f47be0565fefe6ba309e481be378f99d5a6c79e8bac5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page