app

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package app contains the application-level orchestration for ci-snitch.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Repo            string
	Branch          string
	Since           time.Time
	Workflow        string
	IncludeFailures bool
	Verbose         bool
}

Options configures an analysis run.

type RunStore

type RunStore interface {
	RunsSince(workflowID int64, since time.Time) ([]model.WorkflowRun, error)
	IncompleteRunIDs() ([]int64, error)
	LoadRunDetail(runID int64) (*model.RunDetail, error)
	SaveRunDetails(details []model.RunDetail) error
}

RunStore abstracts the SQLite store.

type Service

type Service struct {
	Client WorkflowFetcher
	Store  RunStore // nil to skip caching
	Prog   *output.Progress
}

Service orchestrates the fetch → preprocess → analyze pipeline.

func (*Service) Run

func (s *Service) Run(ctx context.Context, opts *Options) (analyze.AnalysisResult, error)

Run executes the full analysis pipeline and returns the result.

type WorkflowFetcher

type WorkflowFetcher interface {
	ListWorkflows(ctx context.Context) ([]model.Workflow, error)
	FetchRuns(ctx context.Context, workflowID int64, since time.Time, branch string) ([]model.WorkflowRun, []diag.Diagnostic, error)
	FetchRunDetails(ctx context.Context, runs []model.WorkflowRun) ([]model.RunDetail, []diag.Diagnostic)
	FetchRunDetailsGraphQL(ctx context.Context, runs []model.WorkflowRun) ([]model.RunDetail, []diag.Diagnostic)
	RateLimit(ctx context.Context) (github.RateLimitStatus, error)
}

WorkflowFetcher abstracts the GitHub API client.

Jump to

Keyboard shortcuts

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