Documentation
¶
Index ¶
- Constants
- Variables
- func DetectCycleWithConfig(ctx context.Context, source *Feature, rel *Relationship, repo Repository, ...) error
- func GetExitCode(err error) int
- func IncrementVersion(current string, format string, increment VersionIncrement) (string, error)
- func IsDuplicateError(err error) bool
- func IsMergeConflictError(err error) bool
- func IsMergeInProgressError(err error) bool
- func IsNoMergeInProgressError(err error) bool
- func IsNotFound(err error) bool
- func IsValidCycleDetectionMode(mode string) bool
- func IsValidationError(err error) bool
- func SortFeatures(features []*Feature, filter *Filter)
- type AndExpr
- type CompareOp
- type Config
- type DuplicateError
- type ExitCodeError
- type Feature
- func (f *Feature) AddFile(filepath string)
- func (f *Feature) AddRelationship(rel Relationship) error
- func (f *Feature) AddTag(tag string)
- func (f *Feature) DeriveState() State
- func (f *Feature) GetCategory() string
- func (f *Feature) GetClosedAt() *time.Time
- func (f *Feature) GetCreatedAt() time.Time
- func (f *Feature) GetCurrentVersion() *FeatureVersion
- func (f *Feature) GetCurrentVersionKey() string
- func (f *Feature) GetDomain() string
- func (f *Feature) GetEpic() string
- func (f *Feature) GetMetadataString(key string) string
- func (f *Feature) GetModifiedAt() time.Time
- func (f *Feature) GetModule() string
- func (f *Feature) GetPriority() Priority
- func (f *Feature) GetRelationships(relType RelationshipType) []Relationship
- func (f *Feature) GetSortedVersionKeys() []string
- func (f *Feature) GetTeam() string
- func (f *Feature) GetType() string
- func (f *Feature) HasRelationship(relType RelationshipType, targetID string) bool
- func (f *Feature) RemoveFile(filepath string)
- func (f *Feature) RemoveRelationship(relType RelationshipType, targetID string) error
- func (f *Feature) RemoveRelationshipByID(relID string) error
- func (f *Feature) RemoveTag(tag string)
- func (f *Feature) ReopenFeature(currentVersionStr string, newVersionStr string, branch string, notes string) error
- func (f *Feature) SetCategory(c string)
- func (f *Feature) SetDomain(d string)
- func (f *Feature) SetEpic(e string)
- func (f *Feature) SetMetadata(key string, value interface{})
- func (f *Feature) SetModule(m string)
- func (f *Feature) SetPriority(p Priority)
- func (f *Feature) SetTeam(t string)
- func (f *Feature) SetType(t string)
- func (f *Feature) UpdateModifiedAt()
- func (f *Feature) UpdateState(newState State) error
- func (f *Feature) Validate() error
- type FeatureSearchConfig
- type FeatureVersion
- type FieldExpr
- type Filter
- type FilterExpr
- type MergeConflictError
- type MergeInProgressError
- type NoMergeInProgressError
- type NotExpr
- type NotFoundError
- type OrExpr
- type Priority
- type Relationship
- type RelationshipCategory
- type RelationshipSystem
- type RelationshipType
- type RelationshipTypeConfig
- type RelationshipsConfig
- type Repository
- type RepositoryConfig
- type SortField
- type SortOrder
- type State
- type TrueExpr
- type UIConfig
- type ValidationError
- type VersionConstraint
- func (vc *VersionConstraint) GetSemanticVersion() string
- func (vc *VersionConstraint) GetSimpleVersion() int
- func (vc *VersionConstraint) GetVersionString() string
- func (vc *VersionConstraint) IsSatisfiedBy(targetVersionStr string) bool
- func (vc *VersionConstraint) IsSemanticVersion() bool
- func (vc *VersionConstraint) IsSimpleVersion() bool
- func (vc *VersionConstraint) IsValid() error
- type VersionIncrement
- type WorkflowConfig
Constants ¶
const ( CycleDetectionStrict = "strict" // Fail on cycle detection CycleDetectionWarn = "warn" // Log warning but allow CycleDetectionNone = "none" // No cycle detection )
Cycle detection modes for relationship categories
const ( ExitSuccess = 0 // Command completed successfully ExitGeneralError = 1 // Unexpected errors, internal failures ExitInvalidArgs = 2 // Unknown option, invalid syntax, missing required argument ExitNotFound = 3 // Feature ID/name doesn't exist, relationship target not found ExitValidationError = 4 // Invalid YAML, schema violation, broken relationship reference ExitConfigError = 5 // Invalid config.yml, missing required config ExitGitError = 6 // Not a Git repository, Git command failed, hook error ExitConflict = 7 // Relationship would create cycle, duplicate feature name ExitPermissionError = 8 // Read-only filesystem, file access denied ExitMergeConflict = 9 // Git merge conflict detected, requires resolution ExitMergeInProgress = 10 // A merge is already in progress (use --continue or --abort) ExitNoMergeInProgress = 11 // --continue or --abort used but no merge is active )
Exit codes per spec (08-interface.md)
Variables ¶
var ( // Feature errors ErrEmptyName = errors.New("name cannot be empty") ErrInvalidState = errors.New("invalid state: must be one of open, in-progress, closed") ErrInvalidPriority = errors.New("invalid priority: must be one of low, medium, high, critical") ErrFeatureNotFound = errors.New("feature not found") // Relationship errors ErrInvalidRelationshipType = errors.New("invalid relationship type") ErrEmptyTargetID = errors.New("target ID cannot be empty") ErrDuplicateRelationship = errors.New("relationship already exists") ErrRelationshipNotFound = errors.New("relationship not found") // Repository errors ErrRepositoryNotInitialized = errors.New("fogit repository not initialized") ErrFeatureAlreadyExists = errors.New("feature already exists") ErrNotFound = errors.New("not found") )
Domain errors - sentinel errors for backward compatibility
var ( ErrInvalidSortField = errors.New("invalid sort field: must be one of name, priority, created, modified") ErrInvalidSortOrder = errors.New("invalid sort order: must be asc or desc") )
Validation errors for filters.
var ( ErrEmptyExpression = errors.New("empty filter expression") ErrInvalidExpression = errors.New("invalid filter expression") ErrUnmatchedParen = errors.New("unmatched parenthesis") ErrInvalidOperator = errors.New("invalid comparison operator") ErrInvalidField = errors.New("invalid field name") ErrInvalidDateFormat = errors.New("invalid date format (expected YYYY-MM-DD)") ErrMissingOperand = errors.New("missing operand for logical operator") )
Expression errors.
var ValidCycleDetectionModes = []string{CycleDetectionStrict, CycleDetectionWarn, CycleDetectionNone}
ValidCycleDetectionModes contains all valid cycle detection mode values
var ValidOperators = []string{"=", ">", "<", ">=", "<="}
ValidOperators lists all valid version constraint operators
Functions ¶
func DetectCycleWithConfig ¶
func DetectCycleWithConfig(ctx context.Context, source *Feature, rel *Relationship, repo Repository, config *Config) error
DetectCycleWithConfig checks if adding a relationship would create a cycle based on category-specific cycle detection settings
func GetExitCode ¶
GetExitCode determines the appropriate exit code for an error based on the error type. Returns ExitSuccess (0) for nil errors.
func IncrementVersion ¶
func IncrementVersion(current string, format string, increment VersionIncrement) (string, error)
IncrementVersion returns the next version string based on format and increment type Format can be "simple" (1, 2, 3) or "semantic" (1.0.0, 1.1.0, 2.0.0)
func IsDuplicateError ¶
IsDuplicateError checks if an error is a duplicate error
func IsMergeConflictError ¶ added in v1.4.1
IsMergeConflictError checks if an error is a merge conflict error
func IsMergeInProgressError ¶ added in v1.4.1
IsMergeInProgressError checks if an error is a merge in progress error
func IsNoMergeInProgressError ¶ added in v1.4.1
IsNoMergeInProgressError checks if an error is a no merge in progress error
func IsNotFound ¶
IsNotFound checks if an error is a not found error (either sentinel or structured)
func IsValidCycleDetectionMode ¶ added in v1.4.1
IsValidCycleDetectionMode checks if a mode string is valid
func IsValidationError ¶
IsValidationError checks if an error is a validation error
func SortFeatures ¶
SortFeatures sorts a slice of features according to the filter criteria.
Types ¶
type AndExpr ¶
type AndExpr struct {
Left FilterExpr
Right FilterExpr
}
AndExpr represents a logical AND expression.
type Config ¶
type Config struct {
Repository RepositoryConfig `yaml:"repository"`
UI UIConfig `yaml:"ui"`
Workflow WorkflowConfig `yaml:"workflow"`
AutoCommit bool `yaml:"auto_commit"`
CommitTemplate string `yaml:"commit_template"`
AutoPush bool `yaml:"auto_push"`
Relationships RelationshipsConfig `yaml:"relationships"`
FeatureSearch FeatureSearchConfig `yaml:"feature_search"`
DefaultPriority string `yaml:"default_priority,omitempty"` // Optional default priority for new features
}
Config represents the FoGit repository configuration (.fogit/config.yml)
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns a Config with sensible defaults per spec
type DuplicateError ¶
type DuplicateError struct {
Resource string // "feature", "relationship", etc.
Identifier string // ID or name of the duplicate
Message string // Optional additional context
}
DuplicateError indicates an attempt to create something that already exists
func NewDuplicateError ¶
func NewDuplicateError(resource, identifier string) *DuplicateError
NewDuplicateError creates a new DuplicateError
func (*DuplicateError) Error ¶
func (e *DuplicateError) Error() string
func (*DuplicateError) Is ¶
func (e *DuplicateError) Is(target error) bool
Is implements errors.Is for compatibility with sentinel errors
type ExitCodeError ¶
ExitCodeError wraps an error with a specific exit code
func NewExitCodeError ¶
func NewExitCodeError(err error, code int) *ExitCodeError
NewExitCodeError wraps an error with a specific exit code
func (*ExitCodeError) Error ¶
func (e *ExitCodeError) Error() string
func (*ExitCodeError) Unwrap ¶
func (e *ExitCodeError) Unwrap() error
type Feature ¶
type Feature struct {
// Identity - Core fields stored in YAML
ID string `yaml:"id"`
Name string `yaml:"name"`
Description string `yaml:"description,omitempty"`
// Classification - Core field
Tags []string `yaml:"tags,omitempty"`
// Versioning - Core field
// Per spec: timestamps live per-version, state is derived from current version
// Current version = max(versions.keys())
Versions map[string]*FeatureVersion `yaml:"versions,omitempty"`
// Relationships - Core field (embedded with source feature)
Relationships []Relationship `yaml:"relationships,omitempty"`
// Files associated with feature (optional)
Files []string `yaml:"files,omitempty"`
// User-defined fields - All organization fields go here
// Examples: type, priority, category, domain, team, epic, module, jira_ticket, etc.
// FoGit preserves these but does not validate or index them
Metadata map[string]interface{} `yaml:"metadata,omitempty"`
}
Feature represents a trackable item in FoGit Per spec 06-data-model.md (v1.0): - Core fields: id, name, description, tags, versions, relationships - User fields: metadata (organization-specific key-value pairs) - Computed fields (NOT stored): state, creator, contributors, current_version
func NewFeature ¶
NewFeature creates a new feature with a name Per spec 06-data-model.md: Initializes with version 1, timestamps in version
func (*Feature) AddRelationship ¶
func (f *Feature) AddRelationship(rel Relationship) error
AddRelationship adds a relationship if not already present
func (*Feature) DeriveState ¶
DeriveState calculates the feature state from current version timestamps Per spec 06-data-model.md:
current_version = max(versions.keys()) version = versions[current_version] if version.created_at == version.modified_at: state = "open" elif version.closed_at == null: state = "in-progress" else: state = "closed"
func (*Feature) GetCategory ¶
GetCategory returns the category from metadata
func (*Feature) GetClosedAt ¶
GetClosedAt returns the closed timestamp from current version
func (*Feature) GetCreatedAt ¶
GetCreatedAt returns the created timestamp from current version
func (*Feature) GetCurrentVersion ¶
func (f *Feature) GetCurrentVersion() *FeatureVersion
GetCurrentVersion returns the current FeatureVersion (highest version) Per spec 06-data-model.md: current version = versions[max(versions.keys())]
func (*Feature) GetCurrentVersionKey ¶
GetCurrentVersionKey returns the current version key (highest version number) Per spec 06-data-model.md: current_version = max(versions.keys())
func (*Feature) GetMetadataString ¶
GetMetadataString returns a metadata value as string, or empty string if not found
func (*Feature) GetModifiedAt ¶
GetModifiedAt returns the modified timestamp from current version
func (*Feature) GetPriority ¶
GetPriority returns the feature priority from metadata
func (*Feature) GetRelationships ¶
func (f *Feature) GetRelationships(relType RelationshipType) []Relationship
GetRelationships returns relationships filtered by type (empty type returns all)
func (*Feature) GetSortedVersionKeys ¶
GetSortedVersionKeys returns version keys sorted by creation date (ascending). This consolidates the repeated version sorting logic across commands.
func (*Feature) HasRelationship ¶
func (f *Feature) HasRelationship(relType RelationshipType, targetID string) bool
HasRelationship checks if a relationship exists
func (*Feature) RemoveFile ¶
RemoveFile removes a file association
func (*Feature) RemoveRelationship ¶
func (f *Feature) RemoveRelationship(relType RelationshipType, targetID string) error
RemoveRelationship removes a relationship by type and target ID
func (*Feature) RemoveRelationshipByID ¶
RemoveRelationshipByID removes a relationship by its ID
func (*Feature) ReopenFeature ¶
func (f *Feature) ReopenFeature(currentVersionStr string, newVersionStr string, branch string, notes string) error
ReopenFeature reopens a closed feature with a new version Per spec 02-concepts.md and 06-data-model.md: - Closes current version (sets ClosedAt) - Creates new version with the provided version string - New version starts in OPEN state (created_at == modified_at) - Transitions to in-progress after first commit/modification Returns error if feature is not closed
func (*Feature) SetCategory ¶
SetCategory sets the category in metadata
func (*Feature) SetMetadata ¶
SetMetadata sets a metadata value
func (*Feature) SetPriority ¶
SetPriority sets the feature priority in metadata
func (*Feature) UpdateModifiedAt ¶
func (f *Feature) UpdateModifiedAt()
UpdateModifiedAt updates the modified timestamp on current version
func (*Feature) UpdateState ¶
UpdateState updates the feature state by manipulating timestamps Per spec 06-data-model.md, state is derived from current version timestamps:
- To transition to closed: set ClosedAt timestamp on current version
- To transition to in-progress: ensure ModifiedAt > CreatedAt on current version
- To transition to open: clear ClosedAt (only valid for reopening via new version)
type FeatureSearchConfig ¶
type FeatureSearchConfig struct {
FuzzyMatch bool `yaml:"fuzzy_match"`
MinSimilarity float64 `yaml:"min_similarity"` // 0-100
MaxSuggestions int `yaml:"max_suggestions"`
}
FeatureSearchConfig contains fuzzy search configuration
type FeatureVersion ¶
type FeatureVersion struct {
CreatedAt time.Time `yaml:"created_at"` // When this version was started
ModifiedAt time.Time `yaml:"modified_at,omitempty"` // When this version was last modified (for state derivation)
ClosedAt *time.Time `yaml:"closed_at,omitempty"` // When this version was completed (null if open)
Branch string `yaml:"branch,omitempty"` // Git branch name (e.g., feature/login-endpoint-v2)
Authors []string `yaml:"authors,omitempty"` // All unique authors in this version
Notes string `yaml:"notes,omitempty"` // Optional description/rationale for version
}
FeatureVersion represents a single version/iteration of a feature Per spec 06-data-model.md: Each version tracks its own timestamps for state derivation, which branch it was on, who worked on it, and optional notes
type FieldExpr ¶
type FieldExpr struct {
Field string // Field name (e.g., "state", "priority", "metadata.category")
Operator CompareOp // Comparison operator
Value string // Value to compare against
}
FieldExpr represents a field comparison expression.
type Filter ¶
type Filter struct {
// State filters
State State // Filter by state (empty means all states)
// Priority filters
Priority Priority // Filter by priority (empty means all priorities)
// Type filter
Type string // Filter by type (empty means all types)
// Organization filters
Category string // Filter by category
Domain string // Filter by domain
Team string // Filter by team
Epic string // Filter by epic
// Hierarchy filters
Parent string // Filter by parent feature ID
// Tags filter (AND logic)
Tags []string // Filter by tags (all tags must match)
// Contributor filter
Contributor string // Filter by contributor email (matches any version author)
// Search filter
Search string // Search in name and description (case-insensitive)
// Sorting
SortBy SortField // Field to sort by
SortOrder SortOrder // Sort order (ascending/descending)
}
Filter represents filtering criteria for listing features.
type FilterExpr ¶
type FilterExpr interface {
// Matches checks if a feature matches this expression.
Matches(f *Feature) bool
// String returns a string representation of the expression.
String() string
}
FilterExpr represents a parsed filter expression.
func ParseFilterExpr ¶
func ParseFilterExpr(expr string) (FilterExpr, error)
ParseFilterExpr parses a filter expression string into a FilterExpr.
type MergeConflictError ¶ added in v1.4.1
type MergeConflictError struct {
ConflictFiles []string // Files with conflicts
Message string // Additional context
}
MergeConflictError indicates a git merge conflict that requires manual resolution
func NewMergeConflictError ¶ added in v1.4.1
func NewMergeConflictError(conflictFiles []string) *MergeConflictError
NewMergeConflictError creates a new MergeConflictError
func (*MergeConflictError) Error ¶ added in v1.4.1
func (e *MergeConflictError) Error() string
type MergeInProgressError ¶ added in v1.4.1
type MergeInProgressError struct {
Message string
}
MergeInProgressError indicates a merge is already in progress
func NewMergeInProgressError ¶ added in v1.4.1
func NewMergeInProgressError() *MergeInProgressError
NewMergeInProgressError creates a new MergeInProgressError
func (*MergeInProgressError) Error ¶ added in v1.4.1
func (e *MergeInProgressError) Error() string
type NoMergeInProgressError ¶ added in v1.4.1
type NoMergeInProgressError struct {
Message string
}
NoMergeInProgressError indicates --continue or --abort used but no merge is active
func NewNoMergeInProgressError ¶ added in v1.4.1
func NewNoMergeInProgressError() *NoMergeInProgressError
NewNoMergeInProgressError creates a new NoMergeInProgressError
func (*NoMergeInProgressError) Error ¶ added in v1.4.1
func (e *NoMergeInProgressError) Error() string
type NotFoundError ¶
type NotFoundError struct {
Resource string // "feature", "relationship", "version", etc.
Identifier string // ID, name, or other identifier used in lookup
Message string // Optional additional context
}
NotFoundError provides detailed context for not found errors
func NewNotFoundError ¶
func NewNotFoundError(resource, identifier string) *NotFoundError
NewNotFoundError creates a new NotFoundError
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
func (*NotFoundError) Is ¶
func (e *NotFoundError) Is(target error) bool
Is implements errors.Is for compatibility with sentinel errors
type OrExpr ¶
type OrExpr struct {
Left FilterExpr
Right FilterExpr
}
OrExpr represents a logical OR expression.
type Relationship ¶
type Relationship struct {
ID string `yaml:"id"`
Type RelationshipType `yaml:"type"`
TargetID string `yaml:"target_id"`
TargetName string `yaml:"target_name"`
Description string `yaml:"description,omitempty"`
CreatedAt time.Time `yaml:"created_at"`
VersionConstraint *VersionConstraint `yaml:"version_constraint,omitempty"`
}
Relationship represents a link between features
func NewRelationship ¶
func NewRelationship(relType RelationshipType, targetID, targetName string) Relationship
NewRelationship creates a new relationship
func (*Relationship) GetCategory ¶
func (r *Relationship) GetCategory(config *Config) string
GetCategory returns the category of this relationship based on config. Returns empty string if the relationship type is not defined.
func (*Relationship) ValidateWithConfig ¶
func (r *Relationship) ValidateWithConfig(config *Config) error
ValidateWithConfig checks if the relationship is valid against the provided config
type RelationshipCategory ¶
type RelationshipCategory struct {
Description string `yaml:"description"`
AllowCycles bool `yaml:"allow_cycles"`
CycleDetection string `yaml:"cycle_detection"` // "strict", "warn", "none"
IncludeInImpact bool `yaml:"include_in_impact"`
Metadata map[string]interface{} `yaml:"metadata,omitempty"`
}
RelationshipCategory defines a category of relationships with validation rules Per spec, relationship history is tracked via Git (git log -p .fogit/features/)
type RelationshipSystem ¶
type RelationshipSystem struct {
AllowCustomTypes bool `yaml:"allow_custom_types"`
AllowCustomCategories bool `yaml:"allow_custom_categories"`
AutoCreateInverse bool `yaml:"auto_create_inverse"`
}
RelationshipSystem contains system-wide relationship settings
type RelationshipType ¶
type RelationshipType string
RelationshipType represents the type of relationship (dynamic, configured via config)
type RelationshipTypeConfig ¶
type RelationshipTypeConfig struct {
Category string `yaml:"category"`
Inverse string `yaml:"inverse,omitempty"`
Bidirectional bool `yaml:"bidirectional"`
Description string `yaml:"description,omitempty"`
Aliases []string `yaml:"aliases,omitempty"`
}
RelationshipTypeConfig defines a relationship type configuration
type RelationshipsConfig ¶
type RelationshipsConfig struct {
System RelationshipSystem `yaml:"system"`
Categories map[string]RelationshipCategory `yaml:"categories"`
Types map[string]RelationshipTypeConfig `yaml:"types"`
}
RelationshipsConfig contains relationship system configuration
type Repository ¶
type Repository interface {
// Create creates a new feature in the repository
Create(ctx context.Context, feature *Feature) error
// Get retrieves a feature by ID
Get(ctx context.Context, id string) (*Feature, error)
// List retrieves features matching the given filter
List(ctx context.Context, filter *Filter) ([]*Feature, error)
// Update updates an existing feature
Update(ctx context.Context, feature *Feature) error
// Delete removes a feature from the repository
Delete(ctx context.Context, id string) error
}
Repository defines the interface for feature storage operations
type RepositoryConfig ¶
type RepositoryConfig struct {
Name string `yaml:"name"`
InitializedAt time.Time `yaml:"initialized_at"`
Version string `yaml:"version"`
}
RepositoryConfig contains repository metadata
type State ¶
type State string
State represents the feature state Per spec 02-concepts.md and 06-data-model.md, state is DERIVED from timestamps: - open: closed_at == null AND created_at == modified_at (no changes since creation) - in-progress: closed_at == null AND created_at < modified_at (has been modified) - closed: closed_at != null (feature complete, merged) The State field is kept for backward compatibility but should match DeriveState()
func (State) CanTransitionTo ¶
CanTransitionTo checks if state transition is allowed Per spec 02-concepts.md: open -> in-progress -> closed (and closed -> open for reopen)
type UIConfig ¶
type UIConfig struct {
DefaultGroupBy string `yaml:"default_group_by"`
DefaultLayout string `yaml:"default_layout"`
}
UIConfig contains user interface defaults
type ValidationError ¶
type ValidationError struct {
Field string // Field that failed validation
Value string // The invalid value (if safe to include)
Message string // Description of the validation failure
}
ValidationError provides context for validation failures
func NewValidationError ¶
func NewValidationError(field, value, message string) *ValidationError
NewValidationError creates a new ValidationError
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
func (*ValidationError) Is ¶
func (e *ValidationError) Is(target error) bool
Is implements errors.Is for compatibility with sentinel errors
type VersionConstraint ¶
type VersionConstraint struct {
Operator string `yaml:"operator"` // One of: =, >, <, >=, <=
Version interface{} `yaml:"version"` // int for simple, string for semantic versioning
Note string `yaml:"note,omitempty"` // Optional explanation
}
VersionConstraint specifies a version requirement for a relationship target Per spec 06-data-model.md (commit 0a355fc): version can be either: - Simple versioning: positive integer (1, 2, 3) - Semantic versioning: semver string ("1.0.0", "1.1.0")
func (*VersionConstraint) GetSemanticVersion ¶
func (vc *VersionConstraint) GetSemanticVersion() string
GetSemanticVersion returns the semver string, or empty if not applicable
func (*VersionConstraint) GetSimpleVersion ¶
func (vc *VersionConstraint) GetSimpleVersion() int
GetSimpleVersion returns the integer version value, or 0 if not applicable
func (*VersionConstraint) GetVersionString ¶
func (vc *VersionConstraint) GetVersionString() string
GetVersionString returns a string representation of the version for display
func (*VersionConstraint) IsSatisfiedBy ¶
func (vc *VersionConstraint) IsSatisfiedBy(targetVersionStr string) bool
IsSatisfiedBy checks if the given target version satisfies this constraint Per spec 06-data-model.md: - Simple versioning: integer comparison - Semantic versioning: semver ordering (MAJOR.MINOR.PATCH)
func (*VersionConstraint) IsSemanticVersion ¶
func (vc *VersionConstraint) IsSemanticVersion() bool
IsSemanticVersion returns true if this constraint uses semantic versioning
func (*VersionConstraint) IsSimpleVersion ¶
func (vc *VersionConstraint) IsSimpleVersion() bool
IsSimpleVersion returns true if this constraint uses simple (integer) versioning
func (*VersionConstraint) IsValid ¶
func (vc *VersionConstraint) IsValid() error
IsValid checks if the version constraint is valid
type VersionIncrement ¶
type VersionIncrement string
VersionIncrement represents how to increment a version
const ( VersionIncrementPatch VersionIncrement = "patch" // 1.0.0 -> 1.0.1 (semantic only) VersionIncrementMinor VersionIncrement = "minor" // 1.0.0 -> 1.1.0 or 1 -> 2 VersionIncrementMajor VersionIncrement = "major" // 1.0.0 -> 2.0.0 or 1 -> 2 )
type WorkflowConfig ¶
type WorkflowConfig struct {
Mode string `yaml:"mode"` // "branch-per-feature" or "trunk-based"
BaseBranch string `yaml:"base_branch"` // Trunk branch name (default: "main")
CreateBranchFrom string `yaml:"create_branch_from"` // Where to create feature branches from: "trunk", "warn", "current"
VersionFormat string `yaml:"version_format"` // "simple" (1, 2, 3) or "semantic" (1.0.0, 1.1.0, 2.0.0)
}
WorkflowConfig contains Git workflow settings