Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ SQL >
) AS vulnerabilities30d
FROM vulnerabilities v FINAL
JOIN repositories r FINAL ON v.repoUrl = r.url
WHERE v.repoUrl IN (SELECT url FROM ai_repos)
WHERE v.repoUrl IN (SELECT url FROM ai_repos) AND r.archived = false
GROUP BY r.insightsProjectId

NODE final_join
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ SQL >
LEFT JOIN
vulnerability_scans vs final
ON vs.repoUrl = insights_projects_populated_copy_flatten_projects.repository
WHERE
insights_projects_populated_copy_flatten_projects.repository
NOT IN (SELECT url FROM repositories FINAL WHERE archived = true)
group by insightsProjectId
Comment thread
joanagmaia marked this conversation as resolved.

NODE insights_projects_populated_copy_results
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ SQL >
round(count(v.id) * 100.0 / greatest(sum(count(v.id)) OVER (), 1), 0) as percentage
FROM vulnerabilities as v FINAL
WHERE
repoUrl in (select arrayJoin(repositories) from segments_filtered) AND v.status != 'RESOLVED'
repoUrl in (select arrayJoin(repositories) from segments_filtered)
AND v.repoUrl NOT IN (SELECT url FROM repositories FINAL WHERE archived = true)
Comment thread
joanagmaia marked this conversation as resolved.
AND v.status != 'RESOLVED'
{% if defined(repos) %} AND repoUrl IN (SELECT channel FROM repos_to_channels) {% end %}
GROUP BY v.packageEcosystem
ORDER BY count DESC
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ SQL >
round(count(v.id) * 100.0 / greatest(sum(count(v.id)) OVER (), 1), 0) as percentage
FROM vulnerabilities as v FINAL
WHERE
repoUrl in (select arrayJoin(repositories) from segments_filtered) AND v.status != 'RESOLVED'
repoUrl in (select arrayJoin(repositories) from segments_filtered)
AND v.repoUrl NOT IN (SELECT url FROM repositories FINAL WHERE archived = true)
Comment thread
joanagmaia marked this conversation as resolved.
AND v.status != 'RESOLVED'
{% if defined(repos) %} AND repoUrl IN (SELECT channel FROM repos_to_channels) {% end %}
GROUP BY v.severity
ORDER BY count DESC
2 changes: 2 additions & 0 deletions services/libs/tinybird/pipes/vulnerabilities_list.pipe
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ SQL >
FROM vulnerabilities as v FINAL
WHERE
repoUrl in (select arrayJoin(repositories) from segments_filtered)
AND v.repoUrl NOT IN (SELECT url FROM repositories FINAL WHERE archived = true)
Comment thread
joanagmaia marked this conversation as resolved.
{% if defined(repos) %} AND repoUrl IN (SELECT channel FROM repos_to_channels) {% end %}
{% if defined(ecosystem) %}
AND v.packageEcosystem = {{ String(ecosystem, required=False) }}
Expand All @@ -28,6 +29,7 @@ SQL >
FROM vulnerabilities as v FINAL
WHERE
repoUrl in (select arrayJoin(repositories) from segments_filtered)
AND v.repoUrl NOT IN (SELECT url FROM repositories FINAL WHERE archived = true)
Comment thread
joanagmaia marked this conversation as resolved.
{% if defined(repos) %} AND repoUrl IN (SELECT channel FROM repos_to_channels)
{% end %}
{% if defined(ecosystem) %} AND v.packageEcosystem = {{ String(ecosystem, required=False) }}
Expand Down
1 change: 1 addition & 0 deletions services/libs/tinybird/pipes/vulnerabilities_summary.pipe
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ SQL >
FROM vulnerabilities as v FINAL
WHERE
repoUrl in (select arrayJoin(repositories) from segments_filtered)
AND v.repoUrl NOT IN (SELECT url FROM repositories FINAL WHERE archived = true)
Comment thread
joanagmaia marked this conversation as resolved.
{% if defined(repos) %} AND repoUrl IN (SELECT channel FROM repos_to_channels) {% end %}
Loading