Documentation
¶
Overview ¶
Package filter implements the scope filter chain — the mandatory defense-in-depth predicate that refuses to act on any repo outside the configured REPO_ALLOWLIST, even if the upstream GitHub search returns more.
This watcher's keep/skip decision for whether a PR carries an approved-not-completed dark-factory spec is NOT a pure filter — it needs network reads and lives in the pkg/darkfactory package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseRepoAllowlist ¶
ParseRepoAllowlist parses a comma-separated allowlist string into a slice of host-qualified repo keys. Whitespace is trimmed; empty entries are skipped. Returns (nil, nil) for empty input (allow-all). Entry well-formedness is NOT validated here — repoallowlist.IsAllowed handles malformed entries gracefully at match time (logs and skips).
Types ¶
type PR ¶
type PR struct {
// RepoKey is the host-qualified repo key, e.g. "github.com/bborbe/maintainer".
RepoKey string
}
PR is the filter-evaluation input derived from a GitHub pull request. Only the RepoKey is needed for the scope decision.
type TaskCreationFilter ¶
type TaskCreationFilter interface {
// Skip returns true if the PR should be excluded from task creation.
Skip(pr PR) bool
}
TaskCreationFilter decides whether a single PR should be skipped (no vault task created). Implementations return true to skip.
func NewRepoAllowlistFilter ¶
func NewRepoAllowlistFilter(allowlist []string) TaskCreationFilter
NewRepoAllowlistFilter returns a TaskCreationFilter that skips PRs whose RepoKey is not in the allowlist. An empty allowlist never skips (allow-all).
type TaskCreationFilterFunc ¶
TaskCreationFilterFunc adapts a function to the TaskCreationFilter interface (function-as-implementation, useful for inline filters).
func (TaskCreationFilterFunc) Skip ¶
func (f TaskCreationFilterFunc) Skip(pr PR) bool
Skip implements TaskCreationFilter for the function adapter.
type TaskCreationFilters ¶
type TaskCreationFilters []TaskCreationFilter
TaskCreationFilters is a slice composite: skip if ANY member votes skip. An empty slice never skips (no filters configured = process every PR).
func (TaskCreationFilters) Skip ¶
func (fs TaskCreationFilters) Skip(pr PR) bool
Skip returns true if any contained filter votes skip. Iteration is short-circuit on first hit.