Documentation
¶
Index ¶
- func DistinctStdlibVulnIDs(bumps []gobump.StdlibBump) []string
- func ExtractFilename(path string) string
- func OutputJSON(w io.Writer, data any) error
- func OutputYAML(w io.Writer, data any) error
- type BumpResponse
- type BumpSummary
- type CheckResponse
- type CheckSummary
- type UpdateResponse
- type UpdateSummary
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DistinctStdlibVulnIDs ¶ added in v0.3.0
func DistinctStdlibVulnIDs(bumps []gobump.StdlibBump) []string
DistinctStdlibVulnIDs returns a file's distinct fixable stdlib vulnerability IDs across all of its StdlibBump entries, sorted for deterministic display. gobump.evaluateStdlibStaleness records one StdlibBump per go-package pin constraint, so the same vulnerability ID can recur across constraints (e.g. a package pinning both go1.22 and go1.23 toolchains, both affected by the same stdlib CVE) - callers that count or list stdlib vulnerabilities per file must dedupe via this function rather than summing len(bump.VulnIDs) across bumps.
func ExtractFilename ¶
ExtractFilename extracts the filename (with extension) from a full file path
func OutputJSON ¶
OutputJSON writes data as formatted JSON to the given writer
Types ¶
type BumpResponse ¶ added in v0.4.0
type BumpResponse struct {
Results map[string]*gobump.Result `json:"results" yaml:"results"`
Summary BumpSummary `json:"summary" yaml:"summary"`
}
BumpResponse wraps gobump command results (keyed by file path) with summary metadata
type BumpSummary ¶ added in v0.4.0
type BumpSummary struct {
TotalPackages int `json:"total_packages" yaml:"total_packages"`
PackagesWithVulns int `json:"packages_with_vulns" yaml:"packages_with_vulns"`
PackagesFixed int `json:"packages_fixed" yaml:"packages_fixed"`
PackagesPartial int `json:"packages_partial" yaml:"packages_partial"`
PackagesUnvalidated int `json:"packages_unvalidated" yaml:"packages_unvalidated"`
TotalVulnsFound int `json:"total_vulns_found" yaml:"total_vulns_found"`
TotalVulnsFixed int `json:"total_vulns_fixed" yaml:"total_vulns_fixed"`
TotalVulnsResidual int `json:"total_vulns_residual" yaml:"total_vulns_residual"`
// TotalVulnsUnreachable counts advisories affecting only modules not
// linked into any build artifact (informational; not fixed, not residual).
TotalVulnsUnreachable int `json:"total_vulns_unreachable" yaml:"total_vulns_unreachable"`
TotalModulesBumped int `json:"total_modules_bumped" yaml:"total_modules_bumped"`
// TotalHygieneModulesBumped counts scanner-hygiene entries written (see
// Result.HygieneBumps) - never part of TotalModulesBumped.
TotalHygieneModulesBumped int `json:"total_hygiene_modules_bumped,omitempty" yaml:"total_hygiene_modules_bumped,omitempty"`
Errors int `json:"errors" yaml:"errors"`
// PackagesSkipped counts files (or parts of files) not analyzed - see
// Result.SkipReasons.
PackagesSkipped int `json:"packages_skipped" yaml:"packages_skipped"`
// PackagesExcluded counts files that opted out of bumping via the
// choam/bump-exclude-reason annotation (see Result.ExcludedReason).
PackagesExcluded int `json:"packages_excluded" yaml:"packages_excluded"`
// PackagesStdlibStale counts files with at least one distinct fixable
// stdlib vulnerability ID (see DistinctStdlibVulnIDs); TotalStdlibVulns
// sums those per-file distinct counts across all files. Deliberately
// separate from the dependency-vulnerability counters above: a stdlib
// staleness fix is a toolchain rebuild, not a dependency bump, and a file
// can carry stdlib fixes with zero dependency vulnerabilities found.
PackagesStdlibStale int `json:"packages_stdlib_stale" yaml:"packages_stdlib_stale"`
TotalStdlibVulns int `json:"total_stdlib_vulns" yaml:"total_stdlib_vulns"`
// PackagesPatchNeeded counts files with at least one first-party apk
// advisory (see Result.FirstPartyVulnIDs); TotalFirstPartyVulns sums
// those IDs. Not dependency fixes: they need a source patch.
PackagesPatchNeeded int `json:"packages_patch_needed" yaml:"packages_patch_needed"`
TotalFirstPartyVulns int `json:"total_first_party_vulns" yaml:"total_first_party_vulns"`
// PackagesChanged counts files whose epoch moved or that were rewritten;
// PackagesActionNeeded files that errored or carry Result.ActionsNeeded.
PackagesChanged int `json:"packages_changed" yaml:"packages_changed"`
PackagesActionNeeded int `json:"packages_action_needed" yaml:"packages_action_needed"`
}
BumpSummary provides aggregate statistics for gobump command. Vuln counts are advisories; TotalModulesBumped counts changed dependency entries.
type CheckResponse ¶
type CheckResponse struct {
Results map[string]*updater.UpdateResult `json:"results" yaml:"results"`
Summary CheckSummary `json:"summary" yaml:"summary"`
}
CheckResponse wraps check command results with summary metadata
type CheckSummary ¶
type CheckSummary struct {
TotalPackages int `json:"total_packages" yaml:"total_packages"`
UpdatesAvailable int `json:"updates_available" yaml:"updates_available"`
Errors int `json:"errors" yaml:"errors"`
Manual int `json:"manual" yaml:"manual"`
}
CheckSummary provides aggregate statistics for check command
type UpdateResponse ¶
type UpdateResponse struct {
Results map[string]*updater.ApplyResult `json:"results" yaml:"results"`
Summary UpdateSummary `json:"summary" yaml:"summary"`
}
UpdateResponse wraps update command results with summary metadata
type UpdateSummary ¶
type UpdateSummary struct {
TotalPackages int `json:"total_packages" yaml:"total_packages"`
SuccessfulUpdates int `json:"successful_updates" yaml:"successful_updates"`
Errors int `json:"errors" yaml:"errors"`
Manual int `json:"manual" yaml:"manual"`
}
UpdateSummary provides aggregate statistics for update command