Skip to content

Commit

Permalink
Merge pull request #19 from nais/add_app_count_metrics
Browse files Browse the repository at this point in the history
add(vulnerabilities): count of applications for a given dates and env
  • Loading branch information
christeredvartsen authored Apr 5, 2024
2 parents 091c84c + a20f74c commit d157da1
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 1 deletion.
6 changes: 6 additions & 0 deletions internal/database/gensql/vulnerability.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions internal/database/queries/vulnerability.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ SELECT
sum(low) AS low,
sum(unassigned) AS unassigned,
sum(risk_score) AS risk_score,
COUNT(DISTINCT dependencytrack_project_id) AS count,
date
FROM
vulnerability_metrics
Expand All @@ -32,6 +33,7 @@ SELECT
sum(low) AS low,
sum(unassigned) AS unassigned,
sum(risk_score) AS risk_score,
COUNT(DISTINCT dependencytrack_project_id) AS count,
date
FROM
vulnerability_metrics
Expand Down
62 changes: 62 additions & 0 deletions internal/graph/gengql/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions internal/graph/graphqls/teams.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,9 @@ type VulnerabilityMetric {

"The weighted severity score calculated from the number of vulnerabilities."
riskScore: Int!

"The number of applications with vulnerabilities."
count: Int!
}

"Slack alerts channel type."
Expand Down
2 changes: 2 additions & 0 deletions internal/graph/model/models_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion internal/graph/teams.resolvers.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d157da1

Please sign in to comment.