Skip to content

Commit afd6bd6

Browse files
committed
fix: pr comments
Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
1 parent cac0120 commit afd6bd6

3 files changed

Lines changed: 11 additions & 6 deletions

File tree

services/libs/tinybird/pipes/repo_health_score_active_contributors.pipe

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ NODE repo_health_score_active_contributors_score
1212
SQL >
1313
%
1414
{% if defined(repoUrl) %}
15-
SELECT channel, COALESCE(uniq(memberId), 0) AS activeContributors
15+
SELECT channel, uniq(memberId) AS activeContributors
1616
FROM activityRelations_deduplicated_cleaned_bucket_union
1717
WHERE
1818
memberId != ''
@@ -29,7 +29,7 @@ SQL >
2929
{% end %}
3030
GROUP BY channel
3131
{% else %}
32-
SELECT channel, COALESCE(uniq(memberId), 0) AS activeContributors
32+
SELECT channel, uniq(memberId) AS activeContributors
3333
FROM activityRelations_deduplicated_cleaned_bucket_union
3434
WHERE
3535
memberId != ''

services/libs/tinybird/pipes/repo_health_score_copy.pipe

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ SQL >
4040
COALESCE(
4141
owh.contributionsOutsideWorkHoursBenchmark, 0
4242
) AS contributionsOutsideWorkHoursBenchmark,
43-
COALESCE(sec.securityPercentage, 0) AS securityPercentage
43+
sec.securityPercentage AS securityPercentage
4444
FROM repo_health_score_copy_repos AS repos
4545
LEFT JOIN repo_health_score_active_contributors AS ac USING (channel)
4646
LEFT JOIN repo_health_score_contributor_dependency AS cd USING (channel)
@@ -124,8 +124,13 @@ SQL >
124124
/ if(length(developmentBenchmarks) = 0, 1, 5 * length(developmentBenchmarks))
125125
) AS developmentPercentage,
126126
round(
127-
(contributorPercentage + popularityPercentage + developmentPercentage + securityPercentage)
128-
/ 4
127+
(
128+
contributorPercentage
129+
+ popularityPercentage
130+
+ developmentPercentage
131+
+ if(isNotNull(securityPercentage), securityPercentage, 0)
132+
)
133+
/ if(isNotNull(securityPercentage), 4, 3)
129134
) AS overallScore
130135
FROM repo_health_score_copy_data
131136

services/libs/tinybird/pipes/repo_health_score_security.pipe

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ SQL >
3333
sum(failedAssessments) AS failed,
3434
sum(passedAssessments) AS passed,
3535
sum(failedAssessments + passedAssessments) AS total,
36-
round(100 * (passed / total)) AS percentage
36+
if(total = 0, 0, round(100 * (passed / total))) AS percentage
3737
FROM repo_health_score_security_check_pass_rate
3838
WHERE repo != ''
3939
GROUP BY repo, category

0 commit comments

Comments
 (0)