governor-core
Core domain library for cargo-governor, providing fundamental entities and traits for release automation.
Overview
This library contains the pure domain layer and core abstractions used throughout the cargo-governor ecosystem. It follows Domain-Driven Design (DDD) principles with Clean Architecture.
Features
- Domain Entities: Pure data structures for Version, Commit, Release, Crate, Workspace, etc.
- Core Traits: Abstractions for SourceControl, VersionStrategy, WorkflowStep, CheckpointStore
- Zero Unsafe Code: Entirely safe Rust with
forbid(unsafe_code) - Semantic Versioning: Full support for semantic version parsing and bumping
- Conventional Commits: Parse and analyze conventional commit messages
Modules
Domain (domain)
Core domain entities following DDD principles:
- [
version] - Semantic versioning with bump types (major, minor, patch, none) - [
commit] - Git commit with conventional commit parsing - [
changelog] - Changelog generation and management - [
release] - Release planning and execution - [
crate_entity] - Crate metadata and dependencies - [
workspace] - Workspace metadata and status - [
dependency] - Dependency information
Traits (traits)
Core abstractions for infrastructure implementations:
- [
version_strategy] - Strategy pattern for version analysis - [
source_control] - Git/VCS operations abstraction - [
workflow_step] - Workflow execution step abstraction - [
checkpoint_store] - State persistence for resume capability - [
reversible_operation] - Operations with rollback support
Usage
use ;
// Parse a version
let version = parse.unwrap;
let new_version = version.bump;
// Create a commit
let commit = new;
// Analyze commits for version bump
let strategy = new;
let recommendation = strategy.analyze.await?;
Design Principles
- Pure Domain: Domain entities have no external dependencies
- Trait-Based Abstractions: All external interactions through traits
- Serialization Support: All entities support serde serialization
- Error Handling: Comprehensive error types with thiserror
License
MIT OR Apache-2.0