Documentation
¶
Index ¶
- Constants
- Variables
- type ChainFilter
- type ChainRun
- type Config
- type GitOpsFinalizeInput
- type GitOpsFinalizeResult
- type GitOpsFinalizer
- type ListResult
- type Service
- func (svc *Service) CallWorkflowChainTool(ctx context.Context, name string, arguments json.RawMessage) (any, error)
- func (svc *Service) Get(ctx context.Context, projectID, chainRunID string) (ChainRun, error)
- func (svc *Service) HandleWorkPlanStatusChanged(ctx context.Context, change projectworkplan.WorkPlanStatusChange) error
- func (svc *Service) List(ctx context.Context, filter ChainFilter) (ListResult, error)
- func (svc *Service) RetryGitOps(ctx context.Context, projectID, chainRunID string) (ChainRun, error)
- func (svc *Service) SetGitOpsFinalizer(finalizer GitOpsFinalizer)
- func (svc *Service) Start(ctx context.Context, input StartInput) (StartResult, error)
- type StageConfig
- type StageRun
- type StartInput
- type StartResult
- type Store
- type WorkPlanAPI
- type WorkflowAPI
Constants ¶
View Source
const ( ChainStatusPlanned = "planned" ChainStatusQueued = "queued" ChainStatusCompleted = "completed" ChainStatusPostValidationPassed = "post_validation_passed" ChainStatusBlocked = "blocked" )
View Source
const ( StageStatusPlanned = "planned" StageStatusQueued = "queued" StageStatusCompleted = "completed" StageStatusBlocked = "blocked" )
View Source
const ( InputKindJiraIssueKey = "jira_issue_key" InputKindSafeRef = "safe_ref" ContextProviderJira = "jira" ContextProviderConfluence = "confluence" ContextProviderIndexedRepo = "indexed_repo" ContextModeLocalIngested = "local_ingested" ContextModeIndexed = "indexed" TriggerOnChainStart = "on_chain_start" TriggerAfterStageReviewPassed = "after_stage_review_passed" GitOpsModeDraftPRAfterValidation = "draft_pr_after_post_validation" )
Variables ¶
View Source
var ErrInvalidInput = errors.New("invalid project workflow chain input")
Functions ¶
This section is empty.
Types ¶
type ChainFilter ¶
type ChainRun ¶
type ChainRun struct {
ID string `json:"chain_run_id"`
ProjectID string `json:"project_id"`
ChainRef string `json:"chain_ref"`
InputRef string `json:"input_ref"`
Status string `json:"status"`
ContextRefs []string `json:"context_refs,omitempty"`
StageRuns []StageRun `json:"stage_runs,omitempty"`
WorkPlanIDs []string `json:"work_plan_ids,omitempty"`
AutomationIDs []string `json:"automation_ids,omitempty"`
CreatedByRunID string `json:"created_by_run_id,omitempty"`
TraceID string `json:"trace_id,omitempty"`
GitOpsReady bool `json:"gitops_ready,omitempty"`
PullRequestRef string `json:"pull_request_ref,omitempty"`
NextAction string `json:"next_action,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type Config ¶
type Config struct {
ProjectID string `json:"project_id"`
ChainRef string `json:"chain_ref"`
Enabled bool `json:"enabled"`
InputKind string `json:"input_kind,omitempty"`
InputPattern string `json:"input_pattern,omitempty"`
ContextProvider string `json:"context_provider,omitempty"`
ContextMode string `json:"context_mode,omitempty"`
DefaultTitleTemplate string `json:"default_title_template,omitempty"`
GitOpsMode string `json:"gitops_mode,omitempty"`
GitOpsEnabled bool `json:"gitops_enabled,omitempty"`
Stages []StageConfig `json:"stages,omitempty"`
}
type GitOpsFinalizeInput ¶
type GitOpsFinalizeResult ¶
type GitOpsFinalizer ¶
type GitOpsFinalizer interface {
FinalizeWorkflowChain(context.Context, GitOpsFinalizeInput) (GitOpsFinalizeResult, error)
}
type ListResult ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func New ¶
func New(store Store, workflows WorkflowAPI, workPlans WorkPlanAPI, configs []Config) *Service
func (*Service) CallWorkflowChainTool ¶
func (*Service) HandleWorkPlanStatusChanged ¶
func (svc *Service) HandleWorkPlanStatusChanged(ctx context.Context, change projectworkplan.WorkPlanStatusChange) error
func (*Service) List ¶
func (svc *Service) List(ctx context.Context, filter ChainFilter) (ListResult, error)
func (*Service) RetryGitOps ¶
func (*Service) SetGitOpsFinalizer ¶
func (svc *Service) SetGitOpsFinalizer(finalizer GitOpsFinalizer)
func (*Service) Start ¶
func (svc *Service) Start(ctx context.Context, input StartInput) (StartResult, error)
type StageConfig ¶
type StageConfig struct {
StageRef string `json:"stage_ref"`
WorkflowRef string `json:"workflow_ref"`
Trigger string `json:"trigger,omitempty"`
DependsOn []string `json:"depends_on,omitempty"`
AutomationRefTemplate string `json:"automation_ref_template,omitempty"`
RequiredStatusBeforeNext string `json:"required_status_before_next,omitempty"`
}
type StageRun ¶
type StageRun struct {
StageRef string `json:"stage_ref"`
WorkflowRef string `json:"workflow_ref"`
WorkflowID string `json:"workflow_id,omitempty"`
Status string `json:"status"`
WorkPlanID string `json:"work_plan_id,omitempty"`
WorkTaskIDs []string `json:"work_task_ids,omitempty"`
AutomationIDs []string `json:"automation_ids,omitempty"`
StartedAt time.Time `json:"started_at,omitempty"`
CompletedAt time.Time `json:"completed_at,omitempty"`
BlockedReason string `json:"blocked_reason,omitempty"`
}
type StartInput ¶
type StartResult ¶
type StartResult struct {
ProjectID string `json:"project_id"`
ChainRef string `json:"chain_ref"`
InputRef string `json:"input_ref"`
Status string `json:"status"`
ChainRunID string `json:"chain_run_id,omitempty"`
StageRuns []StageRun `json:"stage_runs,omitempty"`
WorkPlanIDs []string `json:"work_plan_ids,omitempty"`
AutomationIDs []string `json:"automation_ids,omitempty"`
DryRun bool `json:"dry_run,omitempty"`
NextAction string `json:"next_action"`
PullRequestRef string `json:"pull_request_ref,omitempty"`
}
type Store ¶
type Store interface {
CreateChainRun(context.Context, ChainRun) (ChainRun, error)
GetChainRun(context.Context, string, string) (ChainRun, error)
ListChainRuns(context.Context, ChainFilter) ([]ChainRun, error)
UpdateChainRun(context.Context, ChainRun) (ChainRun, error)
FindChainRunByWorkPlan(context.Context, string, string) (ChainRun, error)
}
type WorkPlanAPI ¶
type WorkPlanAPI interface {
GetWorkPlan(context.Context, string, string) (projectworkplan.WorkPlan, error)
ListOpenWorkTasks(context.Context, projectworkplan.WorkTaskFilter) ([]projectworkplan.WorkTask, error)
UpdateWorkPlanStatus(context.Context, projectworkplan.UpdateWorkPlanStatusInput) (projectworkplan.WorkPlan, error)
UpdateWorkTaskStatus(context.Context, projectworkplan.UpdateWorkTaskStatusInput) (projectworkplan.WorkTask, error)
}
type WorkflowAPI ¶
type WorkflowAPI interface {
ListWorkflows(context.Context, projectworkflow.WorkflowFilter) ([]projectworkflow.WorkflowDefinition, error)
CompileWorkflow(context.Context, projectworkflow.WorkflowCompileInput) (projectworkflow.WorkflowCompileResult, error)
}
Click to show internal directories.
Click to hide internal directories.