issue_match

package
v1.26.1 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ListIssueMatchesEventName             event.EventName = "ListIssueMatches"
	GetIssueMatchEventName                event.EventName = "GetIssueMatch"
	CreateIssueMatchEventName             event.EventName = "CreateIssueMatch"
	UpdateIssueMatchEventName             event.EventName = "UpdateIssueMatch"
	DeleteIssueMatchEventName             event.EventName = "DeleteIssueMatch"
	AddEvidenceToIssueMatchEventName      event.EventName = "AddEvidenceToIssueMatch"
	RemoveEvidenceFromIssueMatchEventName event.EventName = "RemoveEvidenceFromIssueMatch"
	ListIssueMatchIDsEventName            event.EventName = "ListIssueMatchIDs"
)

Variables

View Source
var CacheTtlCountIssueMatches = 12 * time.Hour
View Source
var CacheTtlGetAllIssueMatchCursors = 12 * time.Hour
View Source
var CacheTtlGetIssueMatches = 12 * time.Hour

Functions

func BuildIssueVariantMap

func BuildIssueVariantMap(db database.Database, componentInstanceID int64, componentVersionID int64) (map[int64]entity.ServiceIssueVariant, error)

BuildIssueVariantMap builds a map of issue id to issue variant for the given issues and component instance id it does take the first issue_variant with the highest priority for the respective component instance. This is archived by utilizing database.GetServiceIssueVariants that does return ALL issue variants for a given component instance id together with the priorty and afterwards identifying for each issue the variant with the highest priority

Returns a map of issue id to issue variant

func OnComponentInstanceCreate

func OnComponentInstanceCreate(db database.Database, event event.Event)

func OnComponentVersionAssignmentToComponentInstance

func OnComponentVersionAssignmentToComponentInstance(db database.Database, componentInstanceID int64, componentVersionID int64)

OnComponentVersionAssignmentToComponentInstance is an event handler that is triggered when a component version is assigned to a component instance. It creates for the component instance ID that is assigned to component version ID a new issue match for each issue that is related to the component version. to do so it utilizes BuildIssueVariantMap to get the issue variants for the issues to identify the severity of the issueMatch.

Types

type AddEvidenceToIssueMatchEvent

type AddEvidenceToIssueMatchEvent struct {
	IssueMatchID int64
	EvidenceID   int64
}

func (*AddEvidenceToIssueMatchEvent) Name

type CreateIssueMatchEvent

type CreateIssueMatchEvent struct {
	IssueMatch *entity.IssueMatch
}

func (*CreateIssueMatchEvent) Name

type DeleteIssueMatchEvent

type DeleteIssueMatchEvent struct {
	IssueMatchID int64
}

func (*DeleteIssueMatchEvent) Name

type GetIssueMatchEvent

type GetIssueMatchEvent struct {
	IssueMatchID int64
	Result       *entity.IssueMatch
}

func (*GetIssueMatchEvent) Name

type IssueMatchHandler

type IssueMatchHandler interface {
	ListIssueMatches(filter *entity.IssueMatchFilter, options *entity.ListOptions) (*entity.List[entity.IssueMatchResult], error)
	GetIssueMatch(int64) (*entity.IssueMatch, error)
	CreateIssueMatch(context.Context, *entity.IssueMatch) (*entity.IssueMatch, error)
	UpdateIssueMatch(context.Context, *entity.IssueMatch) (*entity.IssueMatch, error)
	DeleteIssueMatch(context.Context, int64) error
	AddEvidenceToIssueMatch(int64, int64) (*entity.IssueMatch, error)
	RemoveEvidenceFromIssueMatch(int64, int64) (*entity.IssueMatch, error)
}

func NewIssueMatchHandler

func NewIssueMatchHandler(handlerContext common.HandlerContext, ss severity.SeverityHandler) IssueMatchHandler

type IssueMatchHandlerError

type IssueMatchHandlerError struct {
	// contains filtered or unexported fields
}

func NewIssueMatchHandlerError

func NewIssueMatchHandlerError(message string) *IssueMatchHandlerError

func (*IssueMatchHandlerError) Error

func (e *IssueMatchHandlerError) Error() string

type ListIssueMatchesEvent

type ListIssueMatchesEvent struct {
	Filter  *entity.IssueMatchFilter
	Options *entity.ListOptions
	Results *entity.List[entity.IssueMatchResult]
}

func (*ListIssueMatchesEvent) Name

type RemoveEvidenceFromIssueMatchEvent

type RemoveEvidenceFromIssueMatchEvent struct {
	IssueMatchID int64
	EvidenceID   int64
}

func (*RemoveEvidenceFromIssueMatchEvent) Name

type UpdateIssueMatchEvent

type UpdateIssueMatchEvent struct {
	IssueMatch *entity.IssueMatch
}

func (*UpdateIssueMatchEvent) Name

Jump to

Keyboard shortcuts

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