Documentation
¶
Index ¶
- Constants
- Variables
- func BindRepairTx(ctx context.Context, tx pgx.Tx, f Finding, taskID string) error
- func BotUpdateJob(name string) bool
- func CheckRepairOverlapTx(ctx context.Context, tx pgx.Tx, f Finding) error
- func Fingerprint(org string, in Observation) string
- func Overlap(a, b []detectors.Dependency) bool
- func ReleaseTerminalRepairsTx(ctx context.Context, tx pgx.Tx, org, repo string) error
- func RepairConflict(change forge.Change) bool
- type AdvisoryInput
- type BotIdentity
- type BugReport
- type BugReportInput
- type Config
- type Evidence
- type Filter
- type Finding
- type Observation
- type Reader
- type ReviewEvidence
- type Scan
- type Service
- func (s *Service) Get(ctx context.Context, session auth.Session, org, id string) (Finding, error)
- func (s *Service) GetConfig(ctx context.Context, session auth.Session, org, repo string) (Config, error)
- func (s *Service) ImportAdvisory(ctx context.Context, session auth.Session, org string, in AdvisoryInput, ...) (Finding, error)
- func (s *Service) List(ctx context.Context, session auth.Session, org string, limit int, ...) (domain.Page[Finding], error)
- func (s *Service) PutConfig(ctx context.Context, session auth.Session, org, repo string, in Config, ...) (Config, error)
- func (s *Service) ReportBug(ctx context.Context, session auth.Session, org string, in BugReportInput, ...) (Finding, error)
- func (s *Service) Run(ctx context.Context) error
- func (s *Service) RunOnce(ctx context.Context) (bool, error)
- func (s *Service) RunOrganisationOnce(ctx context.Context, org string) (bool, error)
- func (s *Service) ScanStatus(ctx context.Context, session auth.Session, org, repo string) (Scan, error)
- func (s *Service) StartScan(ctx context.Context, session auth.Session, org, repo, request string) (Scan, error)
- func (s *Service) Update(ctx context.Context, session auth.Session, org, id string, in Update, ...) (Finding, error)
- type Update
Constants ¶
View Source
const ( WaitingForTarget = "Waiting for the default branch to pass CI" WaitingForRebase = "Waiting for the bot to rebase" )
Variables ¶
View Source
var DefaultBots = map[string]string{"dependabot[bot]\x0049699333": "dependabot", "renovate[bot]\x0029139614": "renovate"}
View Source
var ErrBlocked = errors.New("finding requires reviewed ownership or complete evidence")
View Source
var ErrDuplicate = errors.New("overlapping maintenance work exists; review existing change")
View Source
var ErrStale = errors.New("discovery evidence changed or expired; refresh discovery")
Functions ¶
func BindRepairTx ¶
func BotUpdateJob ¶
func CheckRepairOverlapTx ¶
func Fingerprint ¶
func Fingerprint(org string, in Observation) string
func Overlap ¶
func Overlap(a, b []detectors.Dependency) bool
func ReleaseTerminalRepairsTx ¶ added in v0.2.38
func RepairConflict ¶
Types ¶
type AdvisoryInput ¶
type AdvisoryInput struct {
RepositoryID string `json:"repository_id"`
AdvisoryID string `json:"advisory_id"`
Title string `json:"title"`
Severity string `json:"severity"`
ReferenceURL string `json:"reference_url"`
Path string `json:"path"`
Package string `json:"package"`
Ecosystem string `json:"ecosystem"`
AffectedRange string `json:"affected_range"`
CommitSHA string `json:"commit_sha"`
}
type BotIdentity ¶
type BugReportInput ¶ added in v0.2.38
type Config ¶
type Config struct {
RepositoryID string `json:"repository_id"`
TrustedBots []BotIdentity `json:"trusted_bots"`
MergeAuthority string `json:"merge_authority"`
Version int64 `json:"version"`
}
type Evidence ¶
type Evidence struct {
Provenance string `json:"provenance"`
ConnectionID string `json:"connection_id"`
ConnectionVersion int64 `json:"connection_version"`
ConfigVersion int64 `json:"config_version"`
HeadSHA string `json:"head_sha"`
TargetSHA string `json:"target_sha"`
TargetBranch string `json:"target_branch"`
Change *forge.Change `json:"change,omitempty"`
Checks []forge.Check `json:"checks"`
Dependencies []detectors.Dependency `json:"dependencies"`
Bot string `json:"bot"`
Behind int `json:"behind,omitempty"`
Ownership string `json:"ownership"`
HeadOwnership string `json:"head_ownership"`
MergeBlockers []string `json:"merge_blockers"`
BotConfig detectors.BotConfig `json:"bot_config"`
Complete bool `json:"complete"`
Blockers []string `json:"blockers"`
AdvisoryID string `json:"advisory_id,omitempty"`
ReferenceURL string `json:"reference_url,omitempty"`
TrackedFiles []forge.SourceEntry `json:"tracked_files,omitempty"`
Review *ReviewEvidence `json:"review,omitempty"`
Deployment string `json:"deployment,omitempty"`
ReleaseReceipt string `json:"release_receipt,omitempty"`
DeliveryOperation string `json:"delivery_operation,omitempty"`
ActionURL string `json:"action_url,omitempty"`
ActionLabel string `json:"action_label,omitempty"`
Report *BugReport `json:"report,omitempty"`
}
type Finding ¶
type Finding struct {
ID string `json:"id"`
OrgID string `json:"org_id"`
Observation
Fingerprint string `json:"fingerprint"`
EvidenceDigest string `json:"evidence_digest"`
State string `json:"state"`
Reason string `json:"reason"`
AssignedTo string `json:"assigned_to,omitempty"`
SnoozeUntil *time.Time `json:"snooze_until,omitempty"`
SupersededBy string `json:"superseded_by,omitempty"`
Version int64 `json:"version"`
FirstSeen time.Time `json:"first_seen"`
LastSeen time.Time `json:"last_seen"`
}
type Observation ¶
type Reader ¶
type Reader interface {
Read(context.Context, string, string, privateconnector.Operation, func(context.Context, pgx.Tx, connections.Connection) error) (privateconnector.Result, error)
SourceReader(string, string, func(context.Context, pgx.Tx, connections.Connection) error) source.Reader
}
type ReviewEvidence ¶
type Service ¶
type Service struct {
FixRequested func(context.Context, auth.Session, string, Finding, string) error
// contains filtered or unexported fields
}
func (*Service) ImportAdvisory ¶
func (*Service) RunOrganisationOnce ¶
func (*Service) ScanStatus ¶
Click to show internal directories.
Click to hide internal directories.