-
Notifications
You must be signed in to change notification settings - Fork 433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add vulnerability trend #3130
Conversation
} | ||
return nil | ||
} | ||
|
||
// LoadVulnerabilitiesByRun loads vulnerabilities for the given run | ||
func LoadVulnerabilitiesByRun(db gorp.SqlExecutor, nodeRunID int64) ([]sdk.Vulnerability, error) { | ||
// LoadLatestVulnerabilities load vulnerabilities for the given application |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doc is about LoadVulnerabilities
engine/api/workflow/dao_node_run.go
Outdated
if errV != nil && errV != sdk.ErrNotFound { | ||
return nil, sdk.WrapError(errV, "LoadNodeRun>Error loading vulnerabilities for run %d", r.ID) | ||
vuln, errV := loadVulnerabilityReport(db, r.ID) | ||
if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if errV and not err
projectVCSServer := repositoriesmanager.GetProjectVCSServer(proj, nr.VCSServer) | ||
client, erra := repositoriesmanager.AuthorizedClient(db, cache, projectVCSServer) | ||
if erra != nil { | ||
return sdk.WrapError(sdk.ErrNoReposManagerClientAuth, "HandleVulnerabilityReport> Cannot get repo client %s : %s", nr.VCSServer, erra) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
%v for erra
nodeRunReport.Report.PreviousRunSummary = previousRunReport | ||
|
||
// Get summary from default branch | ||
log.Warning("%s %s", defaultBranch, nr.VCSBranch) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log.warning??
ORDER BY workflow_number DESC, workflow_node_run_id DESC | ||
LIMIT 1 | ||
` | ||
log.Warning("%d %d %s", nr.ApplicationID, nr.WorkflowID, branch) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log.Warning??
CDS Report ut-engine#5322.0 ✘
|
CDS Report ut-engine#5325.0 ✘
|
CDS Report ut-engine#5331.0 ✘
|
} | ||
return nil, sdk.WrapError(err, "loadPreviousRunVulnerabilityReport> Unable to load previous report") | ||
} | ||
log.Warning("%+v", dbReport.Report.Summary) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log.Warning??
if err == sql.ErrNoRows { | ||
return nil, sdk.ErrNotFound | ||
} | ||
return nil, sdk.WrapError(err, "loadPreviousRunVulnerabilityReport> Unable to load previous report") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/loadPreviousRunVulnerabilityReport/loadLatestRunVulnerabilityReport
CDS Report ut-engine#5333.0 ✘
|
@ovh/cds