preprocess

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package preprocess provides filters and transformations for workflow run data that must be applied before any statistical analysis.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeRerunStats

func ComputeRerunStats(details []model.RunDetail) map[int64]RerunStats

ComputeRerunStats computes per-workflow retry statistics from unfiltered data. Must be called before DeduplicateRetries. Returns only workflows that had at least one retry.

func DeduplicateRetries

func DeduplicateRetries(details []model.RunDetail) []model.RunDetail

DeduplicateRetries keeps only the latest attempt for each run ID. GitHub Actions creates new run_attempt numbers for re-runs but keeps the same run ID.

func ExcludeFailures

func ExcludeFailures(details []model.RunDetail) []model.RunDetail

ExcludeFailures keeps only runs with conclusion "success".

func FilterByBranch

func FilterByBranch(details []model.RunDetail, branch string) []model.RunDetail

FilterByBranch keeps only runs from the specified branch.

func ParseMatrixJobName

func ParseMatrixJobName(name string) (base, variant string)

ParseMatrixJobName splits a job name like "test (ubuntu-latest, 20)" into base="test" and variant="ubuntu-latest, 20". If there are no parentheses, variant is empty.

Types

type Options

type Options struct {
	Branch          string // filter to this branch (empty = no filter)
	IncludeFailures bool   // if false, exclude non-success conclusions
}

Options controls which preprocessing steps are applied.

type RerunStats

type RerunStats struct {
	UniqueRuns    int     // distinct run IDs
	RetriedRuns   int     // runs with more than 1 attempt
	ExtraAttempts int     // total extra attempts (sum of max_attempt - 1 per retried run)
	RerunRate     float64 // fraction of unique runs that were retried
}

RerunStats holds retry statistics for a workflow.

type Warning

type Warning = diag.Diagnostic

Warning is a deprecated alias for diag.Diagnostic. Use diag.Diagnostic directly.

func Run

func Run(details []model.RunDetail, opts Options) (result []model.RunDetail, warnings []Warning)

Run applies all preprocessing steps in order and returns the filtered results.

Jump to

Keyboard shortcuts

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