Versions in this module Expand all Collapse all v0 v0.4.3 Jul 27, 2026 v0.4.2 Jul 27, 2026 v0.4.1 Jul 26, 2026 v0.4.0 Jul 26, 2026 v0.3.3 Jul 26, 2026 Changes in this version + const DefaultOpenPRCap + var ErrDefaultBranchDeletion = errors.New("cannot delete the default branch") + var ErrOpenPRBranchDeletion = errors.New("branch has an open pull request") + var ErrProtectedBranchDeletion = errors.New("cannot delete a protected branch") + func CompareProtectionRules(rules []*ProtectionRule) map[string][]string + func ComputeBranchStats(runs []RunTiming, baseBranch string) map[string]*BranchStats + func ComputeJobStats(runs []RunTiming) map[string]*JobStats + func ComputeWorkflowStats(runs []RunTiming) map[string]*WorkflowStats + func FilterByCommit(commits ...string) func(TestRun) bool + func FilterByRepository(repos ...string) func(TestRun) bool + func FormatAsJSON(contexts []*ErrorContext) (string, error) + func FormatAsMarkdown(contexts []*ErrorContext) string + func FormatDuration(d time.Duration) string + func GroupSecretsByScope(secrets []Secret) map[string][]Secret + func ParseSinceDate(value string) (time.Time, error) + func ScanWorkflowForSecrets(workflowContent string) []string + func SetTestTransport(rt http.RoundTripper) func() + func SortRunsByDate(runs []RunTiming, ascending bool) + type Branch struct + Ahead int + Behind int + LastCommitDate time.Time + Name string + Protected bool + SHA string + type BranchStats struct + AvgDuration time.Duration + Branch string + DeltaVsBase float64 + DeltaVsBasePct float64 + TotalRuns int + WorkflowStats map[string]*WorkflowStats + type BranchStatus struct + ComparedTo string + IsDefault bool + PR *PullRequest + func (b BranchStatus) DeleteBlocked() error + type BranchWithComparison struct + ComparedTo string + type Client struct + func NewClient(ctx context.Context) (*Client, error) + func NewClientWithToken(ctx context.Context, token string) (*Client, error) + func NewClientWithTransport(ctx context.Context, rt http.RoundTripper) (*Client, error) + func (c *Client) AddCollaborator(owner, repo, username, permission string) error + func (c *Client) CompareBranches(owner, repo, base, head string) (ahead, behind int, err error) + func (c *Client) Context() context.Context + func (c *Client) CreatePullRequest(owner, repo, title, body, head, base string) (int, error) + func (c *Client) Delete(path string, response interface{}) error + func (c *Client) DeleteBranch(owner, repo, branch string) error + func (c *Client) DeleteRepoSubscription(owner, repo string) error + func (c *Client) FetchFailedJobLogs(owner, repo string, runID int) ([]JobLog, error) + func (c *Client) FetchRunDetails(owner, repo string, runID int) (*RunTiming, error) + func (c *Client) FetchWorkflowRuns(owner, repo string, opts FetchWorkflowRunsOptions) ([]RunTiming, error) + func (c *Client) FetchWorkflowRunsWithDetails(owner, repo string, opts FetchWorkflowRunsOptions) ([]RunTiming, error) + func (c *Client) Get(path string, response interface{}) error + func (c *Client) GetAuthenticatedUser() (string, error) + func (c *Client) GetBranchProtection(owner, repo, branch string) (*ProtectionRule, error) + func (c *Client) GetBranchesWithComparison(owner, repo, baseBranch string) ([]BranchWithComparison, error) + func (c *Client) GetDefaultBranch(owner, repo string) (string, error) + func (c *Client) GetDefaultBranchProtection(owner, repo string) (*ProtectionRule, error) + func (c *Client) GetLatestRelease(owner, repo string) (*Release, error) + func (c *Client) GetPullRequestsForBranch(owner, repo, branch string) ([]PullRequest, error) + func (c *Client) GetRepoSettings(owner, repo string) (*RepoSettings, error) + func (c *Client) ListBranchStatuses(owner, repo, baseBranch string) ([]BranchStatus, error) + func (c *Client) ListBranches(owner, repo string) ([]Branch, error) + func (c *Client) ListCollaborators(owner, repo string) ([]Collaborator, error) + func (c *Client) ListNamespaceRepositories(namespace string) ([]Repository, bool, error) + func (c *Client) ListOrgRepositories(org string) ([]Repository, error) + func (c *Client) ListOrgSecrets(org string) ([]Secret, error) + func (c *Client) ListPullRequests(owner, repo, state string) ([]PullRequest, error) + func (c *Client) ListReleases(owner, repo string) ([]Release, error) + func (c *Client) ListRepoSecrets(owner, repo string) ([]Secret, error) + func (c *Client) ListUserRepositories(username string) ([]Repository, error) + func (c *Client) ListWebhookDeliveries(owner, repo string, hookID int) ([]WebhookDelivery, error) + func (c *Client) ListWebhooks(owner, repo string) ([]Webhook, error) + func (c *Client) ListWorkflowRuns(owner, repo string) ([]WorkflowRun, error) + func (c *Client) ListWorkflows(owner, repo string) ([]WorkflowFile, error) + func (c *Client) Patch(path string, body, response interface{}) error + func (c *Client) Post(path string, body, response interface{}) error + func (c *Client) Put(path string, body, response interface{}) error + func (c *Client) RemoveCollaborator(owner, repo, username string) error + func (c *Client) SetRepoSubscription(owner, repo string, subscribed, ignored bool) (*Subscription, error) + type Collaborator struct + Login string + Permission string + Repository string + type CollaboratorGrant struct + ExpiresAt time.Time + GrantedAt time.Time + GrantedBy string + Permission string + Repository string + RevokedAt *time.Time + User string + type DuplicateSecret struct + Count int + Name string + Repos []string + Scopes []string + func FindDuplicateSecrets(secrets []Secret) []DuplicateSecret + type ErrorContext struct + Conclusion string + Context []string + ErrorLines []string + ErrorType string + JobName string + Repository string + StepName string + Summary string + Timestamp time.Time + WorkflowName string + func BatchExtractErrors(logs []JobLog, workflow string, config LogExtractionConfig) []*ErrorContext + func ExtractErrorContext(log JobLog, workflow string, config LogExtractionConfig) *ErrorContext + type FetchWorkflowRunsOptions struct + Branch string + CreatedAfter time.Time + Limit int + Status string + WorkflowFile string + type FlakyDetectionConfig struct + IncludeSkipped bool + MinFailureRate float64 + MinFlips int + SameCommitOnly bool + TimeWindow time.Duration + func DefaultFlakyConfig() FlakyDetectionConfig + type FlakyTest struct + FailureCount int + FailureRate float64 + FirstFailure time.Time + FlipCount int + LastFlip time.Time + Name string + Pattern string + TotalRuns int + func DetectFlakyTests(runs []TestRun, config FlakyDetectionConfig) []FlakyTest + type GQLClient struct + func NewGQLClient() (*GQLClient, error) + func (g *GQLClient) ListOpenPRReviewThreads(client *Client, owner, repo string, maxPRs int) ([]ReviewThread, error) + func (g *GQLClient) ListPRReviewThreads(owner, repo string, prNumber int) ([]ReviewThread, error) + func (g *GQLClient) ListRepoReviewThreads(client *Client, owner, repo string, prNumber, maxPRs int) ([]ReviewThread, error) + func (g *GQLClient) ListViewerRepoWatchInfo() (string, []RepoWatchInfo, error) + type JobLog struct + Conclusion string + JobID int + JobName string + Lines []string + Repository string + Timestamp time.Time + WorkflowID int + type JobStats struct + AvgDuration time.Duration + MaxDuration time.Duration + MinDuration time.Duration + TotalRuns int + WorkflowJob string + func GetTopJobsByDuration(stats map[string]*JobStats, limit int) []*JobStats + type JobTiming struct + CompletedAt time.Time + Conclusion string + Duration time.Duration + DurationSeconds float64 + Name string + StartedAt time.Time + Status string + Steps []StepTiming + type LogExtractionConfig struct + ContextLines int + ErrorPatterns []string + ExtractStackTrace bool + FilterNoise bool + IncludeSuccess bool + TailLines int + func DefaultLogConfig() LogExtractionConfig + type PRRef struct + Ref string + Repo string + SHA string + type ProtectionRule struct + AllowDeletions bool + AllowForcePushes bool + Branch string + EnforceAdmins bool + Repository string + RequireCodeOwnerReviews bool + RequireLinearHistory bool + RequireStatusChecks []string + RequiredReviews int + type PullRequest struct + Base PRRef + ClosedAt *time.Time + Head PRRef + MergedAt *time.Time + Number int + State string + Title string + func MatchBranchPR(prs []PullRequest, repoFullName, branch string) *PullRequest + type Release struct + Author string + Body string + CreatedAt time.Time + Draft bool + ID int + Name string + Prerelease bool + PublishedAt time.Time + Repository string + TagName string + type ReleaseComparison struct + LatestReleases map[string]*Release + NonSemVerRepos []string + OutdatedRepos []string + Repositories []string + func CompareReleases(releases map[string]*Release) ReleaseComparison + type RepoBasic struct + FullName string + Name string + Owner string + Private bool + type RepoSettings struct + AllowMergeCommit bool + AllowRebaseMerge bool + AllowSquashMerge bool + DefaultBranch string + DeleteBranchOnMerge bool + HasIssues bool + HasProjects bool + HasWiki bool + Repository string + type RepoWatchInfo struct + IsArchived bool + IsFork bool + PushedAt time.Time + StargazerCount int + State WatchState + UpdatedAt time.Time + ViewerCanSubscribe bool + WatcherCount int + type Repository struct + Archived bool + DefaultBranch string + FullName string + Name string + Owner string + Private bool + type ReviewComment struct + Author string + Body string + CreatedAt time.Time + URL string + type ReviewThread struct + Comments []ReviewComment + IsOutdated bool + IsResolved bool + PRNumber int + PRTitle string + Path string + Repository string + func FilterUnresolvedThreads(threads []ReviewThread) []ReviewThread + func (t ReviewThread) FirstComment() (ReviewComment, bool) + func (t ReviewThread) LastActivity() time.Time + type RunTiming struct + Branch string + Conclusion string + CreatedAt time.Time + Duration time.Duration + DurationSeconds float64 + HeadSHA string + Jobs []JobTiming + RunID int + UpdatedAt time.Time + Workflow string + WorkflowID int + func FilterRunsByBranch(runs []RunTiming, branch string) []RunTiming + func FilterRunsByTimeRange(runs []RunTiming, since, until time.Time) []RunTiming + func FilterRunsByWorkflows(runs []RunTiming, workflows []string) []RunTiming + type Secret struct + CreatedAt string + Name string + Repository string + Scope string + UpdatedAt string + type SecretUsage struct + Name string + ReferencedIn []string + Repository string + Scope string + Unused bool + func DetectUnusedSecrets(secrets []Secret, workflowRefs map[string][]string) []SecretUsage + type SettingsDiff struct + Baseline interface{} + Current interface{} + Field string + Severity string + func CompareSettings(baseline, current *RepoSettings) []SettingsDiff + type StepTiming struct + CompletedAt time.Time + Conclusion string + Duration time.Duration + DurationSeconds float64 + Name string + StartedAt time.Time + Status string + type Subscription struct + CreatedAt time.Time + Ignored bool + Reason string + Repository string + State WatchState + Subscribed bool + type TestRun struct + CommitSHA string + Duration time.Duration + Name string + Repository string + Status string + Timestamp time.Time + WorkflowID int + func ApplyFilters(runs []TestRun, filters ...func(TestRun) bool) []TestRun + func WorkflowRunsToTestRuns(repo string, runs []WorkflowRun) []TestRun + type ThreadFilter struct + Author string + Search string + Since *time.Time + func (f ThreadFilter) Apply(threads []ReviewThread) []ReviewThread + type WatchState string + const WatchStateDefault + const WatchStateIgnored + const WatchStateSubscribed + type Webhook struct + Active bool + Events []string + ID int + Repository string + URL string + type WebhookDelivery struct + Duration int + Event string + ID int + Status int + Timestamp string + type WebhookHealth struct + AvgDuration int + Failures int + SuccessRate float64 + TotalDeliveries int + WebhookID int + func AnalyzeWebhookHealth(deliveries []WebhookDelivery) WebhookHealth + type WorkflowFile struct + ID int + Name string + Path string + State string + type WorkflowRun struct + Branch string + Conclusion string + CreatedAt time.Time + Duration time.Duration + HeadSHA string + ID int + Name string + Status string + UpdatedAt time.Time + type WorkflowRunStats struct + AvgDuration time.Duration + FailureCount int + Runs []WorkflowRun + SuccessRate float64 + TotalRuns int + func AnalyzeWorkflowRuns(runs []WorkflowRun) WorkflowRunStats + type WorkflowStats struct + AvgDuration time.Duration + FailureCount int + MaxDuration time.Duration + MinDuration time.Duration + SuccessRate float64 + TotalRuns int + Workflow string