Skip to content
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

Merged
merged 7 commits into from
Aug 3, 2018
Merged

feat: add vulnerability trend #3130

merged 7 commits into from
Aug 3, 2018

Conversation

sguiheux
Copy link
Collaborator

@sguiheux sguiheux commented Aug 2, 2018

  1. Description
  2. Related issues
  3. About tests
  4. Mentions

@ovh/cds

@sguiheux sguiheux requested review from yesnault, fsamin and bnjjj August 2, 2018 12:36
}
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
Copy link
Member

Choose a reason for hiding this comment

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

doc is about LoadVulnerabilities

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 {
Copy link
Member

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)
Copy link
Member

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)
Copy link
Member

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)
Copy link
Member

Choose a reason for hiding this comment

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

log.Warning??

@ovh-cds
Copy link
Collaborator

ovh-cds commented Aug 2, 2018

CDS Report ut-engine#5322.0 ✘

  • Stage 1

    • Engine Test with DB ✘
      Unit Tests Report
  • github.com/ovh/cds/cli

  • github.com/ovh/cds/engine/api

    • Test_getWorkflowNodeRunHandler ✘
  • github.com/ovh/cds/engine/api/application

  • github.com/ovh/cds/engine/api/environment

  • github.com/ovh/cds/engine/api/keys

  • github.com/ovh/cds/engine/api/migrate

  • github.com/ovh/cds/engine/api/pipeline

  • github.com/ovh/cds/engine/api/plugin

  • github.com/ovh/cds/engine/api/poller

  • github.com/ovh/cds/engine/api/project

  • github.com/ovh/cds/engine/api/scheduler

  • github.com/ovh/cds/engine/api/secret

  • github.com/ovh/cds/engine/api/user

  • github.com/ovh/cds/engine/api/warning

  • github.com/ovh/cds/engine/api/worker

  • github.com/ovh/cds/engine/api/workflow

  • github.com/ovh/cds/engine/hatchery/swarm

  • github.com/ovh/cds/engine/hooks

  • github.com/ovh/cds/engine/repositories

  • github.com/ovh/cds/engine/vcs

  • github.com/ovh/cds/engine/vcs/bitbucket

  • github.com/ovh/cds/engine/vcs/github

  • github.com/ovh/cds/engine/vcs/gitlab

  • github.com/ovh/cds/engine/worker

  • github.com/ovh/cds/sdk

  • github.com/ovh/cds/sdk/exportentities

  • github.com/ovh/cds/sdk/interpolate

  • github.com/ovh/cds/sdk/luascript

  • github.com/ovh/cds/sdk/plugin/dummy/caller

  • github.com/ovh/cds/sdk/vcs/git

@ovh-cds
Copy link
Collaborator

ovh-cds commented Aug 2, 2018

CDS Report ut-engine#5325.0 ✘

  • Stage 1

    • Engine Test with DB ✘
      Unit Tests Report
  • github.com/ovh/cds/cli

  • github.com/ovh/cds/engine/api

    • Test_getWorkflowNodeRunHandler ✘
  • github.com/ovh/cds/engine/api/application

  • github.com/ovh/cds/engine/api/environment

  • github.com/ovh/cds/engine/api/keys

  • github.com/ovh/cds/engine/api/migrate

  • github.com/ovh/cds/engine/api/pipeline

  • github.com/ovh/cds/engine/api/plugin

  • github.com/ovh/cds/engine/api/poller

  • github.com/ovh/cds/engine/api/project

  • github.com/ovh/cds/engine/api/scheduler

  • github.com/ovh/cds/engine/api/secret

  • github.com/ovh/cds/engine/api/user

  • github.com/ovh/cds/engine/api/warning

  • github.com/ovh/cds/engine/api/worker

  • github.com/ovh/cds/engine/api/workflow

  • github.com/ovh/cds/engine/hatchery/swarm

  • github.com/ovh/cds/engine/hooks

  • github.com/ovh/cds/engine/repositories

  • github.com/ovh/cds/engine/vcs

  • github.com/ovh/cds/engine/vcs/bitbucket

  • github.com/ovh/cds/engine/vcs/github

  • github.com/ovh/cds/engine/vcs/gitlab

  • github.com/ovh/cds/engine/worker

  • github.com/ovh/cds/sdk

  • github.com/ovh/cds/sdk/exportentities

  • github.com/ovh/cds/sdk/interpolate

  • github.com/ovh/cds/sdk/luascript

  • github.com/ovh/cds/sdk/plugin/dummy/caller

  • github.com/ovh/cds/sdk/vcs/git

@ovh-cds
Copy link
Collaborator

ovh-cds commented Aug 2, 2018

CDS Report ut-engine#5331.0 ✘

  • Stage 1

    • Engine Test with DB ✘
      Unit Tests Report
  • github.com/ovh/cds/cli

  • github.com/ovh/cds/engine/api

    • Test_getLatestWorkflowRunHandler ✘
  • github.com/ovh/cds/engine/api/application

  • github.com/ovh/cds/engine/api/environment

  • github.com/ovh/cds/engine/api/keys

  • github.com/ovh/cds/engine/api/migrate

  • github.com/ovh/cds/engine/api/pipeline

  • github.com/ovh/cds/engine/api/plugin

  • github.com/ovh/cds/engine/api/poller

  • github.com/ovh/cds/engine/api/project

  • github.com/ovh/cds/engine/api/scheduler

  • github.com/ovh/cds/engine/api/secret

  • github.com/ovh/cds/engine/api/user

  • github.com/ovh/cds/engine/api/warning

  • github.com/ovh/cds/engine/api/worker

  • github.com/ovh/cds/engine/api/workflow

  • github.com/ovh/cds/engine/hatchery/swarm

  • github.com/ovh/cds/engine/hooks

  • github.com/ovh/cds/engine/repositories

  • github.com/ovh/cds/engine/vcs

  • github.com/ovh/cds/engine/vcs/bitbucket

  • github.com/ovh/cds/engine/vcs/github

  • github.com/ovh/cds/engine/vcs/gitlab

  • github.com/ovh/cds/engine/worker

  • github.com/ovh/cds/sdk

  • github.com/ovh/cds/sdk/exportentities

  • github.com/ovh/cds/sdk/interpolate

  • github.com/ovh/cds/sdk/luascript

  • github.com/ovh/cds/sdk/plugin/dummy/caller

  • github.com/ovh/cds/sdk/vcs/git

}
return nil, sdk.WrapError(err, "loadPreviousRunVulnerabilityReport> Unable to load previous report")
}
log.Warning("%+v", dbReport.Report.Summary)
Copy link
Member

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")
Copy link
Contributor

Choose a reason for hiding this comment

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

s/loadPreviousRunVulnerabilityReport/loadLatestRunVulnerabilityReport

@ovh-cds
Copy link
Collaborator

ovh-cds commented Aug 2, 2018

CDS Report ut-engine#5333.0 ✘

  • Stage 1

    • Engine Test with DB ✘
      Unit Tests Report
  • github.com/ovh/cds/cli

  • github.com/ovh/cds/engine/api

    • Test_getWorkflowNodeRunHandler ✘
  • github.com/ovh/cds/engine/api/application

  • github.com/ovh/cds/engine/api/environment

  • github.com/ovh/cds/engine/api/keys

  • github.com/ovh/cds/engine/api/migrate

  • github.com/ovh/cds/engine/api/pipeline

  • github.com/ovh/cds/engine/api/plugin

  • github.com/ovh/cds/engine/api/poller

  • github.com/ovh/cds/engine/api/project

  • github.com/ovh/cds/engine/api/scheduler

  • github.com/ovh/cds/engine/api/secret

  • github.com/ovh/cds/engine/api/user

  • github.com/ovh/cds/engine/api/warning

  • github.com/ovh/cds/engine/api/worker

  • github.com/ovh/cds/engine/api/workflow

  • github.com/ovh/cds/engine/hatchery/swarm

  • github.com/ovh/cds/engine/hooks

  • github.com/ovh/cds/engine/repositories

  • github.com/ovh/cds/engine/vcs

  • github.com/ovh/cds/engine/vcs/bitbucket

  • github.com/ovh/cds/engine/vcs/github

  • github.com/ovh/cds/engine/vcs/gitlab

  • github.com/ovh/cds/engine/worker

  • github.com/ovh/cds/sdk

  • github.com/ovh/cds/sdk/exportentities

  • github.com/ovh/cds/sdk/interpolate

  • github.com/ovh/cds/sdk/luascript

  • github.com/ovh/cds/sdk/plugin/dummy/caller

  • github.com/ovh/cds/sdk/vcs/git

@fsamin fsamin merged commit 4861e20 into master Aug 3, 2018
@sguiheux sguiheux deleted the vulnTrend branch September 20, 2018 14:41
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.

5 participants