Help us shape the future of Go! Take the 2026 Go Developer Survey

ufm_helpers

package
v0.30.2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetadataKeyFindingExtras = "finding-extras"
	MetadataKeyCoverage      = "coverage"
)

Test result metadata keys under which the SARIF transformation stores the details UFM has no field for, so the SARIF presenter can render them again.

Variables

This section is empty.

Functions

func DecodeMetadata added in v0.27.0

func DecodeMetadata[T any](value interface{}) (T, error)

DecodeMetadata converts a metadata value into T. The value is either T itself (in memory) or its generic JSON form (after a TestResult JSON round trip).

func GetDirectPackagePinTarget

func GetDirectPackagePinTarget(attrs *testapi.FixAttributes) (packageName, packageVersion string)

GetPinTarget returns the package to pin from fix attributes. Returns the package name and version to pin to, or empty strings if not applicable.

func GetDirectPackageUpgradeTarget

func GetDirectPackageUpgradeTarget(attrs *testapi.FixAttributes) (packageName, packageVersion string)

GetUpgradeTarget returns the direct dependency to upgrade from fix attributes. Returns the package name and version to upgrade to, or empty strings if not applicable.

func GetFixAttributes

func GetFixAttributes(issue testapi.Issue) *testapi.FixAttributes

GetFixAttributes extracts fix attributes from an issue's findings.

Types

type Coverage added in v0.27.0

type Coverage struct {
	Files       int    `json:"files"`
	IsSupported bool   `json:"isSupported"`
	Lang        string `json:"lang"`
	Type        string `json:"type"`
}

Coverage is one entry of the SARIF run coverage stored under MetadataKeyCoverage.

type FindingExtra added in v0.27.0

type FindingExtra struct {
	Fingerprints           map[string]string     `json:"fingerprints,omitempty"`
	IsAutofixable          bool                  `json:"isAutofixable,omitempty"`
	Arguments              []string              `json:"arguments,omitempty"`
	Suppression            *SuppressionExtra     `json:"suppression,omitempty"`
	MessageText            string                `json:"messageText,omitempty"`
	MessageMarkdown        string                `json:"messageMarkdown,omitempty"`
	PriorityScoreFactors   []PriorityScoreFactor `json:"priorityScoreFactors,omitempty"`
	PolicyOriginalLevel    string                `json:"policyOriginalLevel,omitempty"`
	PolicySeverity         string                `json:"policySeverity,omitempty"`
	PolicyOriginalSeverity string                `json:"policyOriginalSeverity,omitempty"`
}

FindingExtra holds the SARIF result details of one finding, keyed by finding ID under MetadataKeyFindingExtras.

type PinGroup

type PinGroup struct {
	FromPackage testapi.Package
	ToPackage   testapi.Package
	FixedIssues []testapi.Issue
}

type PriorityScoreFactor added in v0.27.0

type PriorityScoreFactor struct {
	Label bool   `json:"label"`
	Type  string `json:"type"`
}

type RemediationSummary

type RemediationSummary struct {
	Upgrades   []*UpgradeGroup
	Pins       []*PinGroup
	Unresolved []testapi.Issue
}

func GetRemediationSummary

func GetRemediationSummary(issues []testapi.Issue) *RemediationSummary

GetRemediationSummary returns a summary of the remediation actions needed for the issues. It groups issues by the package they are related to and the action needed to fix them.

func (*RemediationSummary) HasPins

func (s *RemediationSummary) HasPins() bool

func (*RemediationSummary) HasUnresolved

func (s *RemediationSummary) HasUnresolved() bool

func (*RemediationSummary) HasUpgrades

func (s *RemediationSummary) HasUpgrades() bool

type SuppressionExtra added in v0.27.0

type SuppressionExtra struct {
	GUID       string `json:"guid,omitempty"`
	Category   string `json:"category,omitempty"`
	IgnoredBy  string `json:"ignoredBy,omitempty"`
	Email      string `json:"email,omitempty"`
	Expiration string `json:"expiration,omitempty"`
	IgnoredOn  string `json:"ignoredOn,omitempty"`
}

type UpgradeGroup

type UpgradeGroup struct {
	FromPackage testapi.Package
	ToPackage   testapi.Package
	FixedIssues []testapi.Issue
}

Jump to

Keyboard shortcuts

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