project

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrProjectNotFound = errors.New("project not found")
	ErrDuplicatePath   = errors.New("project with this repository path already exists")
)

Functions

This section is empty.

Types

type FilterRegistry

type FilterRegistry struct {
	Filters map[string]*SavedFilter `json:"filters"`
}

func LoadFilterRegistry

func LoadFilterRegistry() (*FilterRegistry, error)

func (*FilterRegistry) Add

func (r *FilterRegistry) Add(f *SavedFilter) error

func (*FilterRegistry) Delete

func (r *FilterRegistry) Delete(id string) error

func (*FilterRegistry) Get

func (r *FilterRegistry) Get(id string) *SavedFilter

func (*FilterRegistry) GetDefault

func (r *FilterRegistry) GetDefault() *SavedFilter

func (*FilterRegistry) List

func (r *FilterRegistry) List() []*SavedFilter

func (*FilterRegistry) Save

func (r *FilterRegistry) Save() error

type GlobalTicketStore

type GlobalTicketStore struct {
	// contains filtered or unexported fields
}

GlobalTicketStore aggregates tickets from all projects

func LoadGlobalTicketStore

func LoadGlobalTicketStore(registry *ProjectRegistry) (*GlobalTicketStore, error)

func NewGlobalTicketStore

func NewGlobalTicketStore(registry *ProjectRegistry) *GlobalTicketStore

func (*GlobalTicketStore) Add

func (g *GlobalTicketStore) Add(ticket *board.Ticket) error

func (*GlobalTicketStore) AddProject

func (g *GlobalTicketStore) AddProject(p *Project)

func (*GlobalTicketStore) All

func (g *GlobalTicketStore) All() []*board.Ticket

func (*GlobalTicketStore) Count

func (g *GlobalTicketStore) Count() int

func (*GlobalTicketStore) Delete

func (g *GlobalTicketStore) Delete(id board.TicketID) error

func (*GlobalTicketStore) Get

func (*GlobalTicketStore) GetBlockedBy added in v0.0.17

func (g *GlobalTicketStore) GetBlockedBy(ticketID board.TicketID) []*board.Ticket

func (*GlobalTicketStore) GetBlocks added in v0.0.17

func (g *GlobalTicketStore) GetBlocks(ticketID board.TicketID) []*board.Ticket

func (*GlobalTicketStore) GetByStatus

func (g *GlobalTicketStore) GetByStatus(status board.TicketStatus) []*board.Ticket

func (*GlobalTicketStore) GetProject

func (g *GlobalTicketStore) GetProject(id string) *Project

func (*GlobalTicketStore) GetProjectForTicket

func (g *GlobalTicketStore) GetProjectForTicket(ticket *board.Ticket) *Project

func (*GlobalTicketStore) GetStoreForTicket

func (g *GlobalTicketStore) GetStoreForTicket(ticket *board.Ticket) *TicketStore

func (*GlobalTicketStore) HasProjects

func (g *GlobalTicketStore) HasProjects() bool

func (*GlobalTicketStore) Move

func (g *GlobalTicketStore) Move(id board.TicketID, newStatus board.TicketStatus) error

func (*GlobalTicketStore) Projects

func (g *GlobalTicketStore) Projects() []*Project

func (*GlobalTicketStore) RemoveBlockerReferences added in v0.0.17

func (g *GlobalTicketStore) RemoveBlockerReferences(ticketID board.TicketID)

func (*GlobalTicketStore) RemoveProject

func (g *GlobalTicketStore) RemoveProject(id string) error

func (*GlobalTicketStore) Save

func (g *GlobalTicketStore) Save(ticket *board.Ticket) error

func (*GlobalTicketStore) SaveAll

func (g *GlobalTicketStore) SaveAll() error

type Project

type Project struct {
	ID          string    `json:"id"`
	Name        string    `json:"name"`
	RepoPath    string    `json:"repo_path"`    // Absolute path to git repo root
	WorktreeDir string    `json:"worktree_dir"` // Where worktrees go (default: {repo}-worktrees)
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`

	// Project-specific settings (overrides global defaults)
	Settings ProjectSettings `json:"settings"`
}

Project represents a git repository registered with OpenKanban. Each git repo is exactly one Project - this is the fundamental unit of organization.

func NewProject

func NewProject(name, repoPath string) *Project

NewProject creates a new project for a repository

func (*Project) GetBranchPrefix

func (p *Project) GetBranchPrefix() string

GetBranchPrefix returns the branch prefix, using default if not set

func (*Project) GetBranchTemplate

func (p *Project) GetBranchTemplate() string

GetBranchTemplate returns the branch template, using default if not set

func (*Project) GetSlugMaxLength

func (p *Project) GetSlugMaxLength() int

GetSlugMaxLength returns the slug max length, using default if not set

func (*Project) GetWorktreeDir

func (p *Project) GetWorktreeDir() string

GetWorktreeDir returns the worktree directory, using default if not set

func (*Project) Touch

func (p *Project) Touch()

Touch updates the UpdatedAt timestamp

type ProjectRegistry

type ProjectRegistry struct {
	Projects map[string]*Project `json:"projects"`
}

func LoadRegistry

func LoadRegistry() (*ProjectRegistry, error)

func (*ProjectRegistry) Add

func (r *ProjectRegistry) Add(p *Project) error

func (*ProjectRegistry) Delete

func (r *ProjectRegistry) Delete(id string) error

func (*ProjectRegistry) FindByPath

func (r *ProjectRegistry) FindByPath(repoPath string) (*Project, error)

func (*ProjectRegistry) Get

func (r *ProjectRegistry) Get(id string) (*Project, error)

func (*ProjectRegistry) List

func (r *ProjectRegistry) List() []*Project

func (*ProjectRegistry) Save

func (r *ProjectRegistry) Save() error

func (*ProjectRegistry) Update

func (r *ProjectRegistry) Update(p *Project) error

type ProjectSettings

type ProjectSettings struct {
	AutoSpawnAgent   bool   `json:"auto_spawn_agent"`
	AutoCreateBranch bool   `json:"auto_create_branch"`
	BranchPrefix     string `json:"branch_prefix,omitempty"`
	BranchNaming     string `json:"branch_naming,omitempty"`   // "template" | "ai" | "prompt"
	BranchTemplate   string `json:"branch_template,omitempty"` // e.g., "{prefix}{slug}"
	SlugMaxLength    int    `json:"slug_max_length,omitempty"` // default: 40
}

ProjectSettings contains project-specific configuration. These override global defaults from config.Config.

type SavedFilter

type SavedFilter struct {
	ID         string   `json:"id"`
	Name       string   `json:"name"`
	ProjectIDs []string `json:"project_ids,omitempty"`
	Statuses   []string `json:"statuses,omitempty"`
	Labels     []string `json:"labels,omitempty"`
	IsDefault  bool     `json:"is_default"`
}

func NewFilter

func NewFilter(name string) *SavedFilter

func (*SavedFilter) Matches

func (f *SavedFilter) Matches(ticket *board.Ticket) bool

type TicketStore

type TicketStore struct {
	ProjectID string                           `json:"project_id"`
	Tickets   map[board.TicketID]*board.Ticket `json:"tickets"`
	UpdatedAt time.Time                        `json:"updated_at"`
	// contains filtered or unexported fields
}

func LoadTicketStore

func LoadTicketStore(project *Project) (*TicketStore, error)

func NewTicketStore

func NewTicketStore(projectID, repoPath string) *TicketStore

func (*TicketStore) Add

func (s *TicketStore) Add(ticket *board.Ticket)

func (*TicketStore) All

func (s *TicketStore) All() []*board.Ticket

func (*TicketStore) Count

func (s *TicketStore) Count() int

func (*TicketStore) CountByStatus

func (s *TicketStore) CountByStatus(status board.TicketStatus) int

func (*TicketStore) Delete

func (s *TicketStore) Delete(id board.TicketID) error

func (*TicketStore) Get

func (s *TicketStore) Get(id board.TicketID) (*board.Ticket, error)

func (*TicketStore) GetByStatus

func (s *TicketStore) GetByStatus(status board.TicketStatus) []*board.Ticket

func (*TicketStore) Move

func (s *TicketStore) Move(id board.TicketID, newStatus board.TicketStatus) error

func (*TicketStore) Save

func (s *TicketStore) Save() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL