aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Meumertzheim <meumertzheim@code-intelligence.com>2021-03-22 02:52:02 +0100
committerGitHub <noreply@github.com>2021-03-21 18:52:02 -0700
commit6ca344a44647fe3087d98e0f8c2a545f8285cca5 (patch)
tree3f98b0aceeb58732e20d8652e434df14fad9e5c3
parent0fba276516072c29462d67883f8823e227e387cd (diff)
downloadoss-fuzz-6ca344a44647fe3087d98e0f8c2a545f8285cca5.tar.gz
Generate badges for projects without coverage (#5459)
Generate badges also for projects with no coverage builds at all (e.g. JVM and Python projects). For these projects, the badge only has the two possible states "build passing" and "build failing".
-rw-r--r--infra/build/functions/update_build_status.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/infra/build/functions/update_build_status.py b/infra/build/functions/update_build_status.py
index b5f955227..af65a41ab 100644
--- a/infra/build/functions/update_build_status.py
+++ b/infra/build/functions/update_build_status.py
@@ -195,7 +195,10 @@ def update_build_badges(project, last_build_successful,
last_coverage_build_successful):
"""Upload badges of given project."""
badge = 'building'
- if not last_coverage_build_successful:
+ # last_coverage_build_successful is False if there was an unsuccessful build
+ # and None if the target does not support coverage (e.g. Python or Java
+ # targets).
+ if last_coverage_build_successful is False:
badge = 'coverage_failing'
if not last_build_successful:
badge = 'failing'
@@ -289,12 +292,16 @@ def update_badges():
futures = []
with ndb.Client().context():
for project in Project.query():
- if (project.name not in project_build_statuses or
- project.name not in coverage_build_statuses):
+ if project.name not in project_build_statuses:
continue
+ # Certain projects (e.g. JVM and Python) do not have any coverage
+ # builds, but should still receive a badge.
+ coverage_build_status = None
+ if project.name in coverage_build_statuses:
+ coverage_build_status = coverage_build_statuses[project.name]
futures.append(
executor.submit(update_build_badges, project.name,
project_build_statuses[project.name],
- coverage_build_statuses[project.name]))
+ coverage_build_status))
concurrent.futures.wait(futures)