enhance

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 2 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 posted to the issue as a separate comment. Empty
	// means no comment.
	CommentMarkdown string
	// Attributes are additional structured facts (system name, environment,
	// tier). Reserved for future label/field mapping; carried verbatim.
	Attributes map[string]string
}

Enrichment is what an Enhancer contributes to an issue.

type Issue

type Issue struct {
	Repo   source.Repo
	Number int
	Title  string
	Body   string
	Labels []string
}

Issue is the minimal view of a security-finding issue an Enhancer sees.

Jump to

Keyboard shortcuts

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