settings

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TriggerTransitionWhoParent is used to indicate that the transition should be applied to the parent issue.
	TriggerTransitionWhoParent = "parent"
	// TriggerTransitionWhoChildren is used to indicate that the transition should be applied to children issues.
	TriggerTransitionWhoChildren = "children"
)
View Source
const ContextAffectedFiles = "affected-files"

ContextAffectedFiles provides all files that were touched in children and siblings branches.

View Source
const ContextChildren = "children"

ContextChildren matches the children

View Source
const ContextComments = "comments"

ContextComments matches comments

View Source
const ContextFifeComment = "last-5-comments"

ContextFifeComment matches the last fife comment

View Source
const ContextFourComment = "last-4-comments"

ContextFourComment matches the last four comment

View Source
const ContextIssueTypes = "issue_types"

ContextIssueTypes explains what each issue represents

View Source
const ContextLastComment = "last-comment"

ContextLastComment matches the last comment

View Source
const ContextParent = "parent"

ContextParent matches the parent

View Source
const ContextParentComments = "parent-comments"

ContextParentComments matches the parent comments

View Source
const ContextParents = "parents"

ContextParents matches the parents

View Source
const ContextProject = "project"

ContextProject matches the project

View Source
const ContextProjectWiki = "wiki"

ContextProjectWiki matches the project wiki

View Source
const ContextSiblings = "siblings"

ContextSiblings matches the siblings

View Source
const ContextSiblingsComments = "siblings-comments"

ContextSiblingsComments matches the siblings comments

View Source
const ContextThreeComment = "last-3-comments"

ContextThreeComment matches the last three comment

View Source
const ContextTicket = "ticket"

ContextTicket matches the ticket

View Source
const ContextTwoComment = "last-2-comments"

ContextTwoComment matches the last two comment

View Source
const LlmModelNormal = "normal"

LlmModelNormal is the name of the normal model

Variables

This section is empty.

Functions

This section is empty.

Types

type Aider

type Aider struct {
	Timeout           time.Duration `yaml:"timeout"`
	Config            string        `yaml:"config"`
	ConfigFallback    string        `yaml:"config_fallback"`
	MapTokens         int           `yaml:"map_tokens"`
	ModelMetadataFile string        `yaml:"model_metadata_file"`
	TaskSummaryPrompt string        `yaml:"task_summary_prompt"`
}

type CodingAgents added in v0.9.1

type CodingAgents struct {
	Aider Aider `yaml:"aider"`
}

type Config

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

func NewConfig

func NewConfig(basePath string) *Config

func (*Config) Load

func (c *Config) Load() (*Settings, error)

type Contexts

type Contexts []string

func (*Contexts) Has

func (c *Contexts) Has(name string) bool

type IssueType

type IssueType struct {
	Name        IssueTypeName `yaml:"-"` // Exclude from YAML unmarshalling
	Jobs        Jobs          `yaml:"jobs"`
	Description string        `yaml:"description"`
}

type IssueTypeName

type IssueTypeName string

type IssueTypes

type IssueTypes map[IssueTypeName]IssueType

func (*IssueTypes) Get

func (s *IssueTypes) Get(name IssueTypeName) IssueType

type Job

type Job struct {
	Steps Steps `yaml:"steps"`
}

type Jobs

type Jobs map[StateName]Job

func (*Jobs) Get

func (j *Jobs) Get(name StateName) Job

type LlmModel

type LlmModel struct {
	Name        string   `yaml:"name"`
	Model       string   `yaml:"model"`
	Provider    string   `yaml:"provider"`
	APIKey      string   `yaml:"api_key"`
	Temperature float64  `yaml:"temperature"`
	BaseURL     string   `yaml:"base_url"`
	MaxTokens   int      `yaml:"max_tokens"`
	MaxRetries  int      `yaml:"max_retries"`
	Commands    []string `yaml:"commands"`
}

type LlmModels

type LlmModels []LlmModel

func (LlmModels) ForCommand

func (m LlmModels) ForCommand(name, command string) LlmModel

func (LlmModels) Get

func (m LlmModels) Get(name string) LlmModel

type NextTransition

type NextTransition struct {
	Valid   bool
	Single  bool
	Success Transition
	Failure Transition
}

func (*NextTransition) GetTarget

func (n *NextTransition) GetTarget(success bool) StateName

func (*NextTransition) LogPrint

func (n *NextTransition) LogPrint()

type Priorities

type Priorities []Priority

type Priority

type Priority struct {
	Type  IssueTypeName `yaml:"type"`
	State StateName     `yaml:"state"`
}

type Project

type Project struct {
	Identifier             string          `yaml:"identifier"`
	Name                   string          `yaml:"name"`
	Description            string          `yaml:"description"`
	GitPath                string          `yaml:"git_path"`
	LocalGitPath           string          `yaml:"git_local_dir"`
	FinalBranch            string          `yaml:"final_branch"`
	DeleteBranchAfterMerge bool            `yaml:"delete_branch_after_merge"` // will delete source (child) branch after merge into parent
	Wiki                   string          `yaml:"wiki"`
	Commands               ProjectCommands `yaml:"commands"`
}

type ProjectCommand

type ProjectCommand struct {
	Name                   string   `yaml:"name"`
	Command                []string `yaml:"command"`
	IgnoreError            bool     `yaml:"ignore_err"`
	IgnoreStdOutIfNoStdErr bool     `yaml:"ignore_stdout_if_no_stderr"`
	SuccessIfNoOutput      bool     `yaml:"success_if_no_output"`
}

type ProjectCommands

type ProjectCommands []ProjectCommand

func (ProjectCommands) Find

func (p ProjectCommands) Find(identifier string) (ProjectCommand, error)

type Projects

type Projects []Project

func (Projects) Find

func (p Projects) Find(identifier string) Project

type Settings

type Settings struct {
	Workflow     Workflow     `yaml:"workflow"`
	Projects     Projects     `yaml:"projects"`
	LlmModels    LlmModels    `yaml:"llm_models"`
	CodingAgents CodingAgents `yaml:"coding_agents"`
}

func (*Settings) Validate

func (s *Settings) Validate() error

type State

type State struct {
	Name        StateName `yaml:"-"` // Exclude from YAML unmarshalling
	Description string    `yaml:"description"`
	UseAI       UseAI     `yaml:"ai"`
	Prompt      string    `yaml:"prompt,omitempty"`
	IsDefault   bool      `yaml:"is_default"`
	IsFirst     bool      `yaml:"is_first"`
	IsClosed    bool      `yaml:"is_closed"`
}

State represents a single state within the workflow.

type StateName

type StateName string

StateName : Initial, Backlog, In Progress, etc

type States

type States map[StateName]State

func (*States) Get

func (s *States) Get(name StateName) State

func (*States) GetClosed

func (s *States) GetClosed() State

func (*States) GetFirst

func (s *States) GetFirst() State

type Step

type Step struct {
	Command        string     `yaml:"command"`
	Action         string     `yaml:"action"`
	Comment        bool       `yaml:"comment"`
	Remember       bool       `yaml:"remember"`
	Context        Contexts   `yaml:"context"`
	Prompt         StepPrompt `yaml:"prompt"`
	Summarize      bool       `yaml:"summarize"`
	CommentSummary bool       `yaml:"comment-summary"`
	History        []string
	ContextFiles   []string
}

func (*Step) String added in v0.9.1

func (s *Step) String(prefixMessage string) string

type StepPrompt

type StepPrompt string

func (*StepPrompt) ForCli

func (p *StepPrompt) ForCli() string

type Steps

type Steps []Step

type Transition

type Transition struct {
	Source  StateName `yaml:"source"`  // Initial, Backlog, In Progress, etc
	Target  StateName `yaml:"target"`  // Initial, Testing, etc
	Success bool      `yaml:"success"` // Transition on success if multiple transitions available
	Fail    bool      `yaml:"fail"`    // Transition on fail if multiple transitions available
}

func (*Transition) GetIDs

func (t *Transition) GetIDs(statuses []redmine.IssueStatus) (from int, to int)

type Transitions

type Transitions []Transition

func (*Transitions) FailTransition

func (t *Transitions) FailTransition() (transition Transition)

func (*Transitions) GetNextTransition

func (t *Transitions) GetNextTransition(source StateName) NextTransition

func (*Transitions) GetTransitions

func (t *Transitions) GetTransitions(source StateName) (transitions Transitions)

func (*Transitions) SuccessTransition

func (t *Transitions) SuccessTransition() (transition Transition)

type Trigger

type Trigger struct {
	IssueType IssueTypeName `yaml:"issue_type"`
	TriggerIf []TriggerIf   `yaml:"if"`
}

func (Trigger) GetTriggerIf

func (t Trigger) GetTriggerIf(movedTo StateName) *TriggerIf

type TriggerIf

type TriggerIf struct {
	MovedTo           StateName         `yaml:"moved_to"`
	AllSiblingsStatus StateName         `yaml:"all_siblings_status"`
	TriggerTransition TriggerTransition `yaml:"transition"`
}

func (TriggerIf) AllSiblingsCheck

func (t TriggerIf) AllSiblingsCheck(siblingStatuses []StateName) bool

type TriggerTransition

type TriggerTransition struct {
	Who string    `yaml:"who"`
	To  StateName `yaml:"to"`
}

type Triggers

type Triggers []Trigger

func (Triggers) GetTriggers

func (t Triggers) GetTriggers(issueType IssueTypeName) []Trigger

type UseAI

type UseAI []IssueTypeName

func (*UseAI) Yes

func (a *UseAI) Yes(name IssueTypeName) bool

type Workflow

type Workflow struct {
	States      States      `yaml:"states"`
	IssueTypes  IssueTypes  `yaml:"issue_types"`
	Transitions Transitions `yaml:"transitions"`
	Priorities  Priorities  `yaml:"priorities"`
	Triggers    Triggers    `yaml:"triggers"`
	LlmModels   LlmModels   `yaml:"llm_models"`
	Aider       Aider       `yaml:"aider"`
}

Workflow represents

func (*Workflow) UnmarshalYAML

func (w *Workflow) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements custom unmarshalling for the Workflow struct.

Jump to

Keyboard shortcuts

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