Help us shape the future of Go! Take the 2026 Go Developer Survey

ai

package
v3.1.61 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2026 License: MIT, MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateOrUpdateErrorPattern

func CreateOrUpdateErrorPattern(ctx context.Context, ep *ErrorPattern) error

CreateOrUpdateErrorPattern creates or updates an error pattern

func GetCompatibilityMatrix

func GetCompatibilityMatrix(ctx context.Context, projectType string) ([]map[string]any, error)

GetCompatibilityMatrix returns what works on which runners

func IncrementSuccessCount

func IncrementSuccessCount(ctx context.Context, id int64) error

IncrementSuccessCount marks a solution as successful

func RecordTelemetry

func RecordTelemetry(ctx context.Context, t *WorkflowTelemetry) error

RecordTelemetry records a workflow run result

func SeedErrorPatternsIfEmpty

func SeedErrorPatternsIfEmpty(ctx context.Context) error

SeedErrorPatternsIfEmpty seeds error patterns from the seed file if the table is empty

Types

type ErrorPattern

type ErrorPattern struct {
	ID              int64              `xorm:"pk autoincr"`
	Pattern         string             `xorm:"VARCHAR(255) NOT NULL INDEX"`
	PatternRegex    string             `xorm:"TEXT"`
	RunnerType      string             `xorm:"VARCHAR(50) INDEX"`
	ProjectType     string             `xorm:"VARCHAR(100) INDEX"`
	Framework       string             `xorm:"VARCHAR(100)"`
	ErrorMessage    string             `xorm:"TEXT"`
	Diagnosis       string             `xorm:"TEXT"`
	Solution        string             `xorm:"TEXT"`
	SolutionDiff    string             `xorm:"TEXT"`
	OccurrenceCount int                `xorm:"DEFAULT 1"`
	SuccessCount    int                `xorm:"DEFAULT 0"`
	CreatedUnix     timeutil.TimeStamp `xorm:"created"`
	UpdatedUnix     timeutil.TimeStamp `xorm:"updated"`
}

ErrorPattern represents a known CI/CD error pattern with its solution

func GetErrorPatternByID

func GetErrorPatternByID(ctx context.Context, id int64) (*ErrorPattern, error)

GetErrorPatternByID returns an error pattern by ID

func GetErrorPatterns

func GetErrorPatterns(ctx context.Context, pattern, runnerType, projectType string) ([]*ErrorPattern, error)

GetErrorPatterns returns matching error patterns

func (ErrorPattern) TableName

func (ErrorPattern) TableName() string

TableName returns the table name for ErrorPattern

type SeedData

type SeedData struct {
	Patterns []struct {
		Pattern      string `json:"pattern"`
		RunnerType   string `json:"runner_type"`
		ProjectType  string `json:"project_type"`
		Framework    string `json:"framework"`
		ErrorMessage string `json:"error_message"`
		Diagnosis    string `json:"diagnosis"`
		Solution     string `json:"solution"`
	} `json:"patterns"`
}

SeedData represents the structure of the seed JSON file

type WorkflowTelemetry

type WorkflowTelemetry struct {
	ID              int64  `xorm:"pk autoincr"`
	RunnerID        int64  `xorm:"INDEX"`
	RunnerName      string `xorm:"VARCHAR(255) INDEX"`
	JobID           int64  `xorm:"INDEX"`
	WorkflowName    string `xorm:"VARCHAR(255)"`
	ProjectType     string `xorm:"VARCHAR(100) INDEX"`
	Framework       string `xorm:"VARCHAR(100)"`
	Target          string `xorm:"VARCHAR(100)"`
	Status          string `xorm:"VARCHAR(20) INDEX"`
	ErrorPatternID  int64  `xorm:"INDEX"`
	DurationSeconds int
	CreatedUnix     timeutil.TimeStamp `xorm:"created INDEX"`
}

WorkflowTelemetry records workflow run results for compatibility tracking

func (WorkflowTelemetry) TableName

func (WorkflowTelemetry) TableName() string

TableName returns the table name for WorkflowTelemetry

Source Files

  • error_pattern.go
  • seed.go

Jump to

Keyboard shortcuts

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