issuesync

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package issuesync reconciles a run's findings with a tracker's issues: it opens an issue for each BAD/ERROR finding (deduped by check+target) and closes the ones whose finding has recovered. The tracker is abstracted behind Client so the reconcile logic is unit-tested with a fake; a gh-backed client lives in the CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Key

func Key(f engine.Finding) string

Key is the stable dedup identity of a finding: check + target.

func KeyFromTitle

func KeyFromTitle(t string) string

KeyFromTitle extracts the "check/target" key from a managed issue title, or "" if the title isn't one of ours.

Types

type Client

type Client interface {
	List(ctx context.Context) ([]Issue, error)
	Create(ctx context.Context, title, body string) error
	Close(ctx context.Context, number int, comment string) error
}

Client is the subset of a tracker (GitHub, …) that issuesync needs.

type Issue

type Issue struct {
	Number int
	Key    string // the "check/target" key parsed from its title
}

Issue is an existing tracker issue managed by checkfleet.

type Report

type Report struct {
	Created   []string // keys of opened issues
	Closed    []string // keys of closed (recovered) issues
	Unchanged int
}

Report summarises what a reconcile did (or would do, in dry-run).

func Reconcile

func Reconcile(ctx context.Context, c Client, findings []engine.Finding, dryRun bool) (Report, error)

Reconcile opens issues for current problems missing one and closes managed issues whose problem has recovered. It is idempotent. With dryRun, it reports the actions without calling Create/Close.

Jump to

Keyboard shortcuts

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