Skip to content

Commit d157da1

Browse files
Merge pull request #19 from nais/add_app_count_metrics
add(vulnerabilities): count of applications for a given dates and env
2 parents 091c84c + a20f74c commit d157da1

File tree

6 files changed

+77
-1
lines changed

6 files changed

+77
-1
lines changed

internal/database/gensql/vulnerability.sql.go

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/database/queries/vulnerability.sql

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ SELECT
77
sum(low) AS low,
88
sum(unassigned) AS unassigned,
99
sum(risk_score) AS risk_score,
10+
COUNT(DISTINCT dependencytrack_project_id) AS count,
1011
date
1112
FROM
1213
vulnerability_metrics
@@ -32,6 +33,7 @@ SELECT
3233
sum(low) AS low,
3334
sum(unassigned) AS unassigned,
3435
sum(risk_score) AS risk_score,
36+
COUNT(DISTINCT dependencytrack_project_id) AS count,
3537
date
3638
FROM
3739
vulnerability_metrics

internal/graph/gengql/generated.go

+62
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/graph/graphqls/teams.graphqls

+3
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,9 @@ type VulnerabilityMetric {
432432

433433
"The weighted severity score calculated from the number of vulnerabilities."
434434
riskScore: Int!
435+
436+
"The number of applications with vulnerabilities."
437+
count: Int!
435438
}
436439

437440
"Slack alerts channel type."

internal/graph/model/models_gen.go

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/graph/teams.resolvers.go

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)