review

package
v0.10.255 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package review defines provider-neutral review-domain values.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Anchor

type Anchor struct {
	Kind AnchorKind `json:"kind"`
	Side DiffSide   `json:"side,omitempty"`
	Line int        `json:"line,omitempty"`
}

Anchor is the provider-neutral location requested for a finding.

func (Anchor) Validate

func (a Anchor) Validate() error

Validate checks domain-local anchor field consistency.

type AnchorKind

type AnchorKind string

AnchorKind identifies whether a finding is line- or file-scoped.

const (
	AnchorKindLine AnchorKind = "line"
	AnchorKindFile AnchorKind = "file"
)

AnchorKind values.

func ParseAnchorKind

func ParseAnchorKind(value string) (AnchorKind, error)

ParseAnchorKind parses an anchor kind.

func (AnchorKind) String

func (k AnchorKind) String() string

String returns the wire/domain representation.

func (AnchorKind) Valid

func (k AnchorKind) Valid() bool

Valid reports whether k is one of the known anchor kind values.

type Anchoring

type Anchoring string

Anchoring records how a finding will be represented in the provider.

const (
	AnchoringInline            Anchoring = "inline"
	AnchoringFileLevelNative   Anchoring = "file-level-native"
	AnchoringFileLevelFallback Anchoring = "file-level-fallback"
	AnchoringRollupOnly        Anchoring = "rollup-only"
)

Anchoring values.

func ParseAnchoring

func ParseAnchoring(value string) (Anchoring, error)

ParseAnchoring parses an anchoring value.

func (Anchoring) String

func (a Anchoring) String() string

String returns the wire/domain representation.

func (Anchoring) Valid

func (a Anchoring) Valid() bool

Valid reports whether a is one of the known anchoring values.

type DedupeEntry

type DedupeEntry struct {
	Kept    FindingID   `json:"kept"`
	Dropped []FindingID `json:"dropped"`
	Reason  string      `json:"reason"`
}

DedupeEntry records finding IDs collapsed during rollup planning.

type DiffSide

type DiffSide string

DiffSide identifies which side of a pull-request diff an anchor targets.

const (
	DiffSideLeft  DiffSide = "LEFT"
	DiffSideRight DiffSide = "RIGHT"
)

DiffSide values.

func ParseDiffSide

func ParseDiffSide(value string) (DiffSide, error)

ParseDiffSide parses a diff side.

func (DiffSide) String

func (s DiffSide) String() string

String returns the wire/domain representation.

func (DiffSide) Valid

func (s DiffSide) Valid() bool

Valid reports whether s is one of the known diff side values.

type Finding

type Finding struct {
	ID        FindingID `json:"finding_id,omitempty"`
	Severity  Severity  `json:"severity"`
	FilePath  string    `json:"file_path"`
	Anchor    Anchor    `json:"anchor"`
	Body      string    `json:"body"`
	Anchoring Anchoring `json:"anchoring,omitempty"`
}

Finding is a provider-neutral review finding.

func (Finding) Validate

func (f Finding) Validate() error

Validate checks domain-local finding field consistency.

type FindingID

type FindingID string

FindingID identifies a finding after harness-side validation assigns it.

func (FindingID) Assigned

func (id FindingID) Assigned() bool

Assigned reports whether the finding has a harness-assigned ID.

func (FindingID) String

func (id FindingID) String() string

String returns the finding ID string.

type ReviewEvent

type ReviewEvent string

ReviewEvent is the final review submission event.

const (
	ReviewEventApprove        ReviewEvent = "approve"
	ReviewEventComment        ReviewEvent = "comment"
	ReviewEventRequestChanges ReviewEvent = "request_changes"
)

ReviewEvent values.

func ParseReviewEvent

func ParseReviewEvent(value string) (ReviewEvent, error)

ParseReviewEvent parses a review event.

func (ReviewEvent) String

func (e ReviewEvent) String() string

String returns the wire/domain representation.

func (ReviewEvent) Valid

func (e ReviewEvent) Valid() bool

Valid reports whether e is one of the known review event values.

type Rollup

type Rollup struct {
	ReviewEvent          ReviewEvent   `json:"review_event"`
	ReviewEventRationale string        `json:"review_event_rationale"`
	DedupeLog            []DedupeEntry `json:"dedupe_log"`
	OrderedFindings      []FindingID   `json:"ordered_findings"`
}

Rollup is the provider-neutral review rollup selected by the orchestrator.

type Severity

type Severity string

Severity is a reviewer finding severity.

const (
	SeverityBlocking Severity = "blocking"
	SeverityMajor    Severity = "major"
	SeverityMinor    Severity = "minor"
	SeverityNits     Severity = "nits"
)

Severity values, ordered from most to least severe.

func ParseSeverity

func ParseSeverity(value string) (Severity, error)

ParseSeverity parses a severity value from the structured review domain.

func SeverityOrder

func SeverityOrder() []Severity

SeverityOrder returns severities from most to least severe.

func (Severity) AtLeast

func (s Severity) AtLeast(threshold Severity) bool

AtLeast reports whether s is at least as severe as threshold.

func (Severity) String

func (s Severity) String() string

String returns the wire/domain representation.

func (Severity) Valid

func (s Severity) Valid() bool

Valid reports whether s is one of the known severity values.

type ThreadAction

type ThreadAction struct {
	ThreadID               string         `json:"thread_id"`
	Decision               ThreadDecision `json:"decision"`
	Summary                string         `json:"summary,omitempty"`
	SafeToResolveRationale string         `json:"safe_to_resolve_rationale,omitempty"`
}

ThreadAction is the orchestrator's chosen action for an existing PR thread.

type ThreadDecision

type ThreadDecision string

ThreadDecision is the orchestrator's decision for a review thread.

const (
	ThreadDecisionSkip                ThreadDecision = "skip"
	ThreadDecisionSummarizeOnly       ThreadDecision = "summarize_only"
	ThreadDecisionSummarizeAndResolve ThreadDecision = "summarize_and_resolve"
)

ThreadDecision values.

func ParseThreadDecision

func ParseThreadDecision(value string) (ThreadDecision, error)

ParseThreadDecision parses a thread decision.

func (ThreadDecision) String

func (d ThreadDecision) String() string

String returns the wire/domain representation.

func (ThreadDecision) Valid

func (d ThreadDecision) Valid() bool

Valid reports whether d is one of the known thread decision values.

type ThreadResponseAction added in v0.9.190

type ThreadResponseAction struct {
	Kind      ThreadResponseKind `json:"kind"`
	ThreadID  string             `json:"thread_id"`
	Body      string             `json:"body"`
	Resolve   bool               `json:"resolve,omitempty"`
	Rationale string             `json:"rationale,omitempty"`
}

ThreadResponseAction is a concrete response to an existing PR thread.

func (ThreadResponseAction) Validate added in v0.9.190

func (a ThreadResponseAction) Validate() error

Validate checks the response action can be planned safely.

type ThreadResponseKind added in v0.9.190

type ThreadResponseKind string

ThreadResponseKind identifies the type of response to post to an existing inline discussion thread.

const (
	ThreadResponseReply        ThreadResponseKind = "reply"
	ThreadResponseSummaryReply ThreadResponseKind = "summary_reply"
)

ThreadResponseKind values.

func (ThreadResponseKind) String added in v0.9.190

func (k ThreadResponseKind) String() string

String returns the wire/domain representation.

func (ThreadResponseKind) Valid added in v0.9.190

func (k ThreadResponseKind) Valid() bool

Valid reports whether k is one of the known thread response kind values.

Jump to

Keyboard shortcuts

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