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.
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 ¶
ParseAnchoring parses an anchoring value.
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.
func ParseDiffSide ¶
ParseDiffSide parses a diff side.
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.
type FindingID ¶
type FindingID string
FindingID identifies a finding after harness-side validation assigns it.
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 ¶
ParseSeverity parses a severity value from the structured review domain.
func SeverityOrder ¶
func SeverityOrder() []Severity
SeverityOrder returns severities from most to least severe.
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.