Synchronizes local koji data expectations with a hub instance
Project description
koji-habitude
koji-habitude is an object management tool for Koji build systems. It provides a declarative approach to managing koji objects through YAML templates and data files.
This project is an offshoot of koji-box, fulfilling the need for populating a boxed koji instance with a bunch of tags and targets. However it is being written such that it can be used with any koji deployment, in the hopes that it may bring joy into the lives of those trying to keep project packagers happy.
Key Features:
- Define koji objects (tags, external repos, users, targets, hosts, groups, channels, permissions, build types, archive types) in YAML
- Use Jinja2 templates for dynamic configuration generation
- Automatically resolve dependencies between objects (tag inheritance)
- Apply changes in the correct order through tiered execution
- Validate configurations offline before deployment
Command-Line Interface
koji-habitude provides a comprehensive CLI built with Click for managing Koji objects. The CLI includes:
- Primary commands:
apply,compare,expand,fetch,dump,list-templates,diff, andedit - Template subcommands: Work with individual templates using
template show,template expand,template compare,template diff,template apply
For detailed CLI documentation with all options, examples, and use cases, see the Command-Line Interface documentation in the full documentation.
YAML Format & Templates
YAML files can be single or multi-document, processed in-order. Each document
has a type key indicating the document type. Core types include template,
tag, target, user, group, host, channel, permission,
content-generator, build-type, archive-type, and external-repo.
Templates define new types based on their name.
Templates use Jinja2 for dynamic content
generation, allowing you to create reusable patterns for koji objects. When
processing data files, objects with type matching a template name trigger
template expansion, creating final koji objects through recursive processing.
For complete YAML format documentation and detailed examples, see the YAML Format Specification in the full documentation.
Architecture
koji-habitude supports all core Koji object types with fully implemented Pydantic models: tags, external repos, users, targets, hosts, groups, channels, permissions, content generators, build types, and archive types.
The system automatically detects dependencies between objects (e.g., tag inheritance) and provides intelligent resolution through tiered execution, ensuring objects are processed in the correct order. The architecture includes:
- Template System: Jinja2-based template expansion with recursive processing
- Dependency Resolution: Automatic detection and tiered execution ordering
- Remote Models: Complete set of remote object models for fetching and comparing
- State Synchronization: State machine-driven processor with multicall integration
- Change Tracking: Detailed tracking of all modifications with explanations
- Dry-Run Support: Preview changes without applying them
- Bidirectional: Fetch remote state to YAML, or dump remote objects by pattern
Data Flow: YAML files → Template expansion → Dependency resolution → Tiered processing → Koji hub
Requirements & Installation
Requirements:
Installation:
pip install -e .
Contact & License
Author: Christopher O'Brien obriencj@gmail.com
Original Git Repository: https://github.com/obriencj/koji-habitude
Documentation: https://obriencj.github.io/koji-habitude
AI Assistance: This project was developed with assistance from Claude (Claude 3.5 and 4.5 Sonnet) via Cursor IDE.
License: GNU General Public License v3 or later. See https://www.gnu.org/licenses/ for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file koji_habitude-0.9.0.tar.gz.
File metadata
- Download URL: koji_habitude-0.9.0.tar.gz
- Upload date:
- Size: 113.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea7eeff80cd43979abeecd1342990f4b9ea84810ebe165bce6ba35bc9ec5e54f
|
|
| MD5 |
aeda8706ad1d38025380318113ba458f
|
|
| BLAKE2b-256 |
c2403a3eca0fd580b99f41a96dadec9d21da2d91524c09a6b22ccefa730a88d6
|
Provenance
The following attestation bundles were made for koji_habitude-0.9.0.tar.gz:
Publisher:
on_release.yml on obriencj/koji-habitude
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
koji_habitude-0.9.0.tar.gz -
Subject digest:
ea7eeff80cd43979abeecd1342990f4b9ea84810ebe165bce6ba35bc9ec5e54f - Sigstore transparency entry: 781483226
- Sigstore integration time:
-
Permalink:
obriencj/koji-habitude@9e30e5248f2355f7b8b3c8cd166b9e548ee59568 -
Branch / Tag:
refs/tags/v0.9.0 - Owner: https://github.com/obriencj
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
on_release.yml@9e30e5248f2355f7b8b3c8cd166b9e548ee59568 -
Trigger Event:
release
-
Statement type:
File details
Details for the file koji_habitude-0.9.0-py3-none-any.whl.
File metadata
- Download URL: koji_habitude-0.9.0-py3-none-any.whl
- Upload date:
- Size: 105.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f20269b4b240b99dd84cb569bb959206c7b9ed0b824c9fb48070949f4cdc184
|
|
| MD5 |
1e78c1542786e4b036aa0addee56019c
|
|
| BLAKE2b-256 |
9a4adac127f37d6de802017bed3b68257056b19f2f262dbdedd556c243d282dc
|
Provenance
The following attestation bundles were made for koji_habitude-0.9.0-py3-none-any.whl:
Publisher:
on_release.yml on obriencj/koji-habitude
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
koji_habitude-0.9.0-py3-none-any.whl -
Subject digest:
6f20269b4b240b99dd84cb569bb959206c7b9ed0b824c9fb48070949f4cdc184 - Sigstore transparency entry: 781483235
- Sigstore integration time:
-
Permalink:
obriencj/koji-habitude@9e30e5248f2355f7b8b3c8cd166b9e548ee59568 -
Branch / Tag:
refs/tags/v0.9.0 - Owner: https://github.com/obriencj
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
on_release.yml@9e30e5248f2355f7b8b3c8cd166b9e548ee59568 -
Trigger Event:
release
-
Statement type: