Skip to content

include mechanical justification in OpenVEX statements - #2701

Open
refoo0 wants to merge 1 commit into
mainfrom
fix/vex-openvex-mechanical-justification
Open

include mechanical justification in OpenVEX statements#2701
refoo0 wants to merge 1 commit into
mainfrom
fix/vex-openvex-mechanical-justification

Conversation

@refoo0

@refoo0 refoo0 commented Jul 29, 2026

Copy link
Copy Markdown
Member

No description provided.

Signed-off-by: rafi <refaei.shikho@hotmail.com>
var mechanicalJustification dtos.MechanicalJustificationType
// check if we have any event
if len(dependencyVuln.Events) > 0 {
// look for the last event which has a justification

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently it actually retrieves the earliest justification. The justification variable gets overwritten on each matching event and since we are going backwards the earliest justification wins. If you only want the latest you are just missing the break statement.

func getJustification(dependencyVuln models.DependencyVuln) *string {
func getJustificationAndMechanicalJustification(dependencyVuln models.DependencyVuln) (*string, dtos.MechanicalJustificationType) {
var justification *string
var mechanicalJustification dtos.MechanicalJustificationType

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since its not a pointer we are currently always returning (at least) an empty string, is that consistent with other implementations? If so we can keep it like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants