ticket

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PickupDiagnosisStateRunnable    = domain.PickupDiagnosisStateRunnable
	PickupDiagnosisStateWaiting     = domain.PickupDiagnosisStateWaiting
	PickupDiagnosisStateBlocked     = domain.PickupDiagnosisStateBlocked
	PickupDiagnosisStateRunning     = domain.PickupDiagnosisStateRunning
	PickupDiagnosisStateCompleted   = domain.PickupDiagnosisStateCompleted
	PickupDiagnosisStateUnavailable = domain.PickupDiagnosisStateUnavailable
)
View Source
const (
	PickupDiagnosisReasonReadyForPickup            = domain.PickupDiagnosisReasonReadyForPickup
	PickupDiagnosisReasonCompleted                 = domain.PickupDiagnosisReasonCompleted
	PickupDiagnosisReasonRunningCurrentRun         = domain.PickupDiagnosisReasonRunningCurrentRun
	PickupDiagnosisReasonRetryBackoff              = domain.PickupDiagnosisReasonRetryBackoff
	PickupDiagnosisReasonRetryPausedRepeatedStalls = domain.PickupDiagnosisReasonRetryPausedRepeatedStalls
	PickupDiagnosisReasonRetryPausedBudget         = domain.PickupDiagnosisReasonRetryPausedBudget
	PickupDiagnosisReasonRetryPausedInterrupted    = domain.PickupDiagnosisReasonRetryPausedInterrupted
	PickupDiagnosisReasonRetryPausedUser           = domain.PickupDiagnosisReasonRetryPausedUser
	PickupDiagnosisReasonBlockedDependency         = domain.PickupDiagnosisReasonBlockedDependency
	PickupDiagnosisReasonNoMatchingActiveWorkflow  = domain.PickupDiagnosisReasonNoMatchingActiveWorkflow
	PickupDiagnosisReasonWorkflowInactive          = domain.PickupDiagnosisReasonWorkflowInactive
	PickupDiagnosisReasonWorkflowMissingAgent      = domain.PickupDiagnosisReasonWorkflowMissingAgent
	PickupDiagnosisReasonAgentMissing              = domain.PickupDiagnosisReasonAgentMissing
	PickupDiagnosisReasonAgentInterruptRequested   = domain.PickupDiagnosisReasonAgentInterruptRequested
	PickupDiagnosisReasonAgentPaused               = domain.PickupDiagnosisReasonAgentPaused
	PickupDiagnosisReasonAgentPauseRequested       = domain.PickupDiagnosisReasonAgentPauseRequested
	PickupDiagnosisReasonProviderMissing           = domain.PickupDiagnosisReasonProviderMissing
	PickupDiagnosisReasonMachineMissing            = domain.PickupDiagnosisReasonMachineMissing
	PickupDiagnosisReasonMachineOffline            = domain.PickupDiagnosisReasonMachineOffline
	PickupDiagnosisReasonProviderUnknown           = domain.PickupDiagnosisReasonProviderUnknown
	PickupDiagnosisReasonProviderStale             = domain.PickupDiagnosisReasonProviderStale
	PickupDiagnosisReasonProviderUnavailable       = domain.PickupDiagnosisReasonProviderUnavailable
	PickupDiagnosisReasonWorkflowConcurrencyFull   = domain.PickupDiagnosisReasonWorkflowConcurrencyFull
	PickupDiagnosisReasonProjectConcurrencyFull    = domain.PickupDiagnosisReasonProjectConcurrencyFull
	PickupDiagnosisReasonProviderConcurrencyFull   = domain.PickupDiagnosisReasonProviderConcurrencyFull
	PickupDiagnosisReasonStatusCapacityFull        = domain.PickupDiagnosisReasonStatusCapacityFull
	PickupDiagnosisReasonSchedulerUnavailable      = domain.PickupDiagnosisReasonSchedulerUnavailable
)
View Source
const (
	PickupDiagnosisReasonSeverityInfo    = domain.PickupDiagnosisReasonSeverityInfo
	PickupDiagnosisReasonSeverityWarning = domain.PickupDiagnosisReasonSeverityWarning
	PickupDiagnosisReasonSeverityError   = domain.PickupDiagnosisReasonSeverityError
)
View Source
const (
	DefaultPriority = domain.DefaultPriority
	PriorityUrgent  = domain.PriorityUrgent
	PriorityHigh    = domain.PriorityHigh
	PriorityMedium  = domain.PriorityMedium
	PriorityLow     = domain.PriorityLow
)
View Source
const (
	DefaultType  = domain.DefaultType
	TypeFeature  = domain.TypeFeature
	TypeBugfix   = domain.TypeBugfix
	TypeRefactor = domain.TypeRefactor
	TypeChore    = domain.TypeChore
	TypeEpic     = domain.TypeEpic
)
View Source
const (
	DefaultDependencyType  = domain.DefaultDependencyType
	DependencyTypeBlocks   = domain.DependencyTypeBlocks
	DependencyTypeSubIssue = domain.DependencyTypeSubIssue
)
View Source
const (
	ExternalLinkTypeGithubIssue = domain.ExternalLinkTypeGithubIssue
	ExternalLinkTypeGitlabIssue = domain.ExternalLinkTypeGitlabIssue
	ExternalLinkTypeJiraTicket  = domain.ExternalLinkTypeJiraTicket
	ExternalLinkTypeGithubPR    = domain.ExternalLinkTypeGithubPR
	ExternalLinkTypeGitlabMR    = domain.ExternalLinkTypeGitlabMR
	ExternalLinkTypeCustom      = domain.ExternalLinkTypeCustom
)

Variables

View Source
var (
	ErrProjectNotFound       = domain.ErrProjectNotFound
	ErrProjectRepoNotFound   = domain.ErrProjectRepoNotFound
	ErrRepoScopeRequired     = domain.ErrRepoScopeRequired
	ErrTicketNotFound        = domain.ErrTicketNotFound
	ErrTicketConflict        = domain.ErrTicketConflict
	ErrStatusNotFound        = domain.ErrStatusNotFound
	ErrWorkflowNotFound      = domain.ErrWorkflowNotFound
	ErrStatusNotAllowed      = domain.ErrStatusNotAllowed
	ErrParentTicketNotFound  = domain.ErrParentTicketNotFound
	ErrTargetMachineNotFound = domain.ErrTargetMachineNotFound
	ErrDependencyNotFound    = domain.ErrDependencyNotFound
	ErrDependencyConflict    = domain.ErrDependencyConflict
	ErrCommentNotFound       = domain.ErrCommentNotFound
	ErrExternalLinkNotFound  = domain.ErrExternalLinkNotFound
	ErrExternalLinkConflict  = domain.ErrExternalLinkConflict
	ErrInvalidDependency     = domain.ErrInvalidDependency
	ErrRetryResumeConflict   = domain.ErrRetryResumeConflict
)
View Source
var ErrUnavailable = errors.New("ticket service unavailable")

Functions

func NewRetryToken

func NewRetryToken() string

NewRetryToken returns a new retry-generation token for ticket retry state.

Types

type ActivityRepository added in v0.5.0

type ActivityRepository interface {
	RecordActivityEvent(ctx context.Context, input domain.RecordActivityEventInput) (catalogdomain.ActivityEvent, error)
}

type AddCommentInput

type AddCommentInput = domain.AddCommentInput

type AddDependencyInput

type AddDependencyInput = domain.AddDependencyInput

type AddExternalLinkInput

type AddExternalLinkInput = domain.AddExternalLinkInput

type AppliedUsage

type AppliedUsage = domain.AppliedUsage

type ArchivedListInput

type ArchivedListInput = domain.ArchivedListInput

func ParseArchivedListInput

func ParseArchivedListInput(projectID uuid.UUID, raw ArchivedListRawInput) (ArchivedListInput, error)

type ArchivedListRawInput

type ArchivedListRawInput = domain.ArchivedListRawInput

type ArchivedListResult

type ArchivedListResult = domain.ArchivedListResult

type CommandRepository added in v0.5.0

type CommandRepository interface {
	Create(ctx context.Context, input domain.CreateInput) (domain.Ticket, error)
	Update(ctx context.Context, input domain.UpdateInput) (domain.UpdateResult, error)
	ResumeRetry(ctx context.Context, input domain.ResumeRetryInput) (domain.Ticket, error)
}

type Comment

type Comment = domain.Comment

type CommentRepository added in v0.5.0

type CommentRepository interface {
	ListComments(ctx context.Context, ticketID uuid.UUID) ([]domain.Comment, error)
	ListCommentRevisions(ctx context.Context, ticketID uuid.UUID, commentID uuid.UUID) ([]domain.CommentRevision, error)
	AddComment(ctx context.Context, input domain.AddCommentInput) (domain.Comment, error)
	UpdateComment(ctx context.Context, input domain.UpdateCommentInput) (domain.Comment, error)
	RemoveComment(ctx context.Context, ticketID uuid.UUID, commentID uuid.UUID) (domain.DeleteCommentResult, error)
}

type CommentRevision

type CommentRevision = domain.CommentRevision

type CreateInput

type CreateInput = domain.CreateInput

type CreateRepoScopeInput

type CreateRepoScopeInput = domain.CreateRepoScopeInput

type DeferredLifecycleHook

type DeferredLifecycleHook = domain.DeferredLifecycleHook

type DeleteCommentResult

type DeleteCommentResult = domain.DeleteCommentResult

type DeleteDependencyResult

type DeleteDependencyResult = domain.DeleteDependencyResult

type DeleteExternalLinkResult

type DeleteExternalLinkResult = domain.DeleteExternalLinkResult

type Dependencies added in v0.5.0

type Dependencies struct {
	Activity ActivityRepository
	Query    QueryRepository
	Command  CommandRepository
	Link     LinkRepository
	Comment  CommentRepository
	Usage    UsageRepository
	Runtime  RuntimeRepository
}

type Dependency

type Dependency = domain.Dependency

type DependencyType

type DependencyType = domain.DependencyType

func ParseDependencyType

func ParseDependencyType(raw string) (DependencyType, error)
type ExternalLink = domain.ExternalLink

type ExternalLinkType

type ExternalLinkType = domain.ExternalLinkType

func ParseExternalLinkType

func ParseExternalLinkType(raw string) (ExternalLinkType, error)

type HookWorkspace

type HookWorkspace = domain.HookWorkspace

type LifecycleHookRuntimeData

type LifecycleHookRuntimeData = domain.LifecycleHookRuntimeData

type LinkRepository added in v0.5.0

type LinkRepository interface {
	AddDependency(ctx context.Context, input domain.AddDependencyInput) (domain.Dependency, error)
	RemoveDependency(ctx context.Context, ticketID uuid.UUID, dependencyID uuid.UUID) (domain.DeleteDependencyResult, error)
	AddExternalLink(ctx context.Context, input domain.AddExternalLinkInput) (domain.ExternalLink, error)
	RemoveExternalLink(ctx context.Context, ticketID uuid.UUID, externalLinkID uuid.UUID) (domain.DeleteExternalLinkResult, error)
}

type ListInput

type ListInput = domain.ListInput

type Optional

type Optional[T any] = domain.Optional[T]

func Some

func Some[T any](value T) Optional[T]

type PersistedUsageResult

type PersistedUsageResult = domain.PersistedUsageResult

type PickupDiagnosis

type PickupDiagnosis = domain.PickupDiagnosis

type PickupDiagnosisAgent

type PickupDiagnosisAgent = domain.PickupDiagnosisAgent

type PickupDiagnosisBlockedTicket

type PickupDiagnosisBlockedTicket = domain.PickupDiagnosisBlockedTicket

type PickupDiagnosisCapacity

type PickupDiagnosisCapacity = domain.PickupDiagnosisCapacity

type PickupDiagnosisCapacityBucket

type PickupDiagnosisCapacityBucket = domain.PickupDiagnosisCapacityBucket

type PickupDiagnosisProvider

type PickupDiagnosisProvider = domain.PickupDiagnosisProvider

type PickupDiagnosisReason

type PickupDiagnosisReason = domain.PickupDiagnosisReason

type PickupDiagnosisReasonCode

type PickupDiagnosisReasonCode = domain.PickupDiagnosisReasonCode

type PickupDiagnosisReasonSeverity

type PickupDiagnosisReasonSeverity = domain.PickupDiagnosisReasonSeverity

type PickupDiagnosisRetry

type PickupDiagnosisRetry = domain.PickupDiagnosisRetry

type PickupDiagnosisState

type PickupDiagnosisState = domain.PickupDiagnosisState

type PickupDiagnosisStatusCapacity

type PickupDiagnosisStatusCapacity = domain.PickupDiagnosisStatusCapacity

type PickupDiagnosisWorkflow

type PickupDiagnosisWorkflow = domain.PickupDiagnosisWorkflow

type Priority

type Priority = domain.Priority

func ParsePriority

func ParsePriority(raw string) (Priority, error)

type QueryRepository added in v0.5.0

type QueryRepository interface {
	List(ctx context.Context, input domain.ListInput) ([]domain.Ticket, error)
	ListArchived(ctx context.Context, input domain.ArchivedListInput) (domain.ArchivedListResult, error)
	Get(ctx context.Context, ticketID uuid.UUID) (domain.Ticket, error)
}

type RecordActivityEventInput

type RecordActivityEventInput = domain.RecordActivityEventInput

type RecordUsageInput

type RecordUsageInput = domain.RecordUsageInput

type RecordUsageResult

type RecordUsageResult = domain.RecordUsageResult

type ResumeRetryInput

type ResumeRetryInput = domain.ResumeRetryInput

type RunLifecycleHookInput

type RunLifecycleHookInput struct {
	TicketID   uuid.UUID
	RunID      uuid.UUID
	HookName   infrahook.TicketHookName
	WorkflowID *uuid.UUID
	Blocking   bool
}

type RuntimeRepository added in v0.5.0

type RuntimeRepository interface {
	GetPickupDiagnosis(ctx context.Context, ticketID uuid.UUID) (domain.PickupDiagnosis, error)
	LoadLifecycleHookRuntimeData(ctx context.Context, ticketID uuid.UUID, runID uuid.UUID, workflowID *uuid.UUID) (domain.LifecycleHookRuntimeData, error)
}

type Service

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

func NewService

func NewService(deps Dependencies) *Service

func (*Service) AddComment

func (s *Service) AddComment(ctx context.Context, input AddCommentInput) (Comment, error)

func (*Service) AddDependency

func (s *Service) AddDependency(ctx context.Context, input AddDependencyInput) (Dependency, error)
func (s *Service) AddExternalLink(ctx context.Context, input AddExternalLinkInput) (ExternalLink, error)

func (*Service) ConfigureActivityEmitter added in v0.3.0

func (s *Service) ConfigureActivityEmitter(emitter *activitysvc.Emitter)

func (*Service) ConfigurePlatformEnvironment

func (s *Service) ConfigurePlatformEnvironment(apiURL string, agentPlatform ticketHookAgentPlatform)

func (*Service) ConfigureSSHPool

func (s *Service) ConfigureSSHPool(pool ticketHookSSHPool)

func (*Service) ConfigureTransportResolver

func (s *Service) ConfigureTransportResolver(resolver ticketHookTransportResolver)

func (*Service) Create

func (s *Service) Create(ctx context.Context, input CreateInput) (Ticket, error)

func (*Service) Get

func (s *Service) Get(ctx context.Context, ticketID uuid.UUID) (Ticket, error)

func (*Service) GetPickupDiagnosis

func (s *Service) GetPickupDiagnosis(ctx context.Context, ticketID uuid.UUID) (PickupDiagnosis, error)

func (*Service) List

func (s *Service) List(ctx context.Context, input ListInput) ([]Ticket, error)

func (*Service) ListArchived

func (s *Service) ListArchived(ctx context.Context, input ArchivedListInput) (ArchivedListResult, error)

func (*Service) ListCommentRevisions

func (s *Service) ListCommentRevisions(ctx context.Context, ticketID uuid.UUID, commentID uuid.UUID) ([]CommentRevision, error)

func (*Service) ListComments

func (s *Service) ListComments(ctx context.Context, ticketID uuid.UUID) ([]Comment, error)

func (*Service) RecordActivityEvent

func (s *Service) RecordActivityEvent(ctx context.Context, input RecordActivityEventInput) (catalogdomain.ActivityEvent, error)

func (*Service) RecordUsage

func (s *Service) RecordUsage(
	ctx context.Context,
	input RecordUsageInput,
	metrics provider.MetricsProvider,
) (RecordUsageResult, error)

func (*Service) RemoveComment

func (s *Service) RemoveComment(ctx context.Context, ticketID uuid.UUID, commentID uuid.UUID) (DeleteCommentResult, error)

func (*Service) RemoveDependency

func (s *Service) RemoveDependency(ctx context.Context, ticketID uuid.UUID, dependencyID uuid.UUID) (DeleteDependencyResult, error)
func (s *Service) RemoveExternalLink(ctx context.Context, ticketID uuid.UUID, externalLinkID uuid.UUID) (DeleteExternalLinkResult, error)

func (*Service) ResumeRetry

func (s *Service) ResumeRetry(ctx context.Context, input ResumeRetryInput) (Ticket, error)

func (*Service) RunLifecycleHook

func (s *Service) RunLifecycleHook(ctx context.Context, input RunLifecycleHookInput) error

func (*Service) RunLifecycleHookBestEffort

func (s *Service) RunLifecycleHookBestEffort(ctx context.Context, input RunLifecycleHookInput)

func (*Service) Update

func (s *Service) Update(ctx context.Context, input UpdateInput) (Ticket, error)

func (*Service) UpdateComment

func (s *Service) UpdateComment(ctx context.Context, input UpdateCommentInput) (Comment, error)

type Ticket

type Ticket = domain.Ticket

type TicketReference

type TicketReference = domain.TicketReference

type Type

type Type = domain.Type

func ParseType

func ParseType(raw string) (Type, error)

type UpdateCommentInput

type UpdateCommentInput = domain.UpdateCommentInput

type UpdateInput

type UpdateInput = domain.UpdateInput

type UpdateResult

type UpdateResult = domain.UpdateResult

type UsageMetricsAgent

type UsageMetricsAgent = domain.UsageMetricsAgent

type UsageRepository added in v0.5.0

type UsageRepository interface {
	RecordUsage(ctx context.Context, input domain.RecordUsageInput, usageDelta ticketing.UsageDelta) (domain.PersistedUsageResult, error)
}

Jump to

Keyboard shortcuts

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