Documentation
¶
Overview ¶
Package enhance is patchy's public plugin seam for context enhancement. An Enhancer augments a newly opened security-finding issue with first/third party context — CMDB ownership, associated infrastructure, runbooks — as a comment (the issue body is owned by the accumulator) plus structured attributes the pipeline consumes, most importantly the owners used for assignment.
Implementations may live outside this repository; the exported API is deliberately self-contained and depends on nothing under internal/. Enhancers run as an ordered chain and must be best-effort: a failing enhancer is logged and skipped, never blocking the pipeline.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Enhancer ¶
type Enhancer interface {
// ID names the enhancer, for logs and comment attribution.
ID() string
// Enhance returns the enrichment for the issue, or (nil, nil) when the
// enhancer has nothing to contribute.
Enhance(ctx context.Context, issue Issue) (*Enrichment, error)
}
Enhancer is the interface a context-enhancement plugin implements.
type Enrichment ¶
type Enrichment struct {
// Owners are GitHub logins responsible for the affected repository, in
// preference order; the pipeline uses them for issue assignment.
Owners []string
// CommentMarkdown is arbitrary content, kept as one sticky comment per
// enhancer on the tracking issue. Empty means no comment. Semi-structured
// facts belong in Attributes, not here.
CommentMarkdown string
// Attributes are semi-structured facts (system name, environment, tier),
// projected as tracking labels; carried verbatim.
Attributes map[string]string
}
Enrichment is what an Enhancer contributes to an issue.