Skip to content

Commit

Permalink
stable-rc: fix empty build failure section
Browse files Browse the repository at this point in the history
In some cases, build architecture information
is not available for failed builds.
Do not list down such builds in failures section
as it won't be meaningful if such information
is not present.

Signed-off-by: Jeny Sadadia <[email protected]>
  • Loading branch information
Jeny Sadadia committed Aug 14, 2024
1 parent 95bf8d1 commit 9165f5b
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions kcidb/templates/stable_rc_build.j2
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,22 @@
{{- "\nBUILDS" }}
{% set invalid_builds =
container.builds | selectattr("valid", "false") |
selectattr('origin', 'in', stable_rc_macros.selected_origins) | list %}
selectattr('origin', 'in', stable_rc_macros.selected_origins) |
rejectattr('architecture', 'none') | list %}
{% set invalid_build_count = invalid_builds | length %}
{% if invalid_builds %}
{{- "\n Failures" }}
{% for origin, builds in invalid_builds|groupby("origin") %}
{% if origin in stable_rc_macros.selected_origins %}
{% for build in builds %}
{% if build.architecture %}
{{- [(' -') + build.architecture,
none if build.config_name is none else ('(' + build.config_name + ')')] |
reject("none") | join(" ") -}}
{{- "\n Build detail: https://kcidb.kernelci.org/d/build/build?orgId=1&var-id=" + build.id}}
{% if build.log_excerpt %}
{{- " Build error: " + build.log_error }}
{% endif %}
{% endif %}
{% endfor %}
{{- " CI system: " + origin + "\n\n"-}}
{% endif %}
{% for build in builds %}
{{- [(' -') + build.architecture,
none if build.config_name is none else ('(' + build.config_name + ')')] |
reject("none") | join(" ") -}}
{{- "\n Build detail: https://kcidb.kernelci.org/d/build/build?orgId=1&var-id=" + build.id}}
{% if build.log_excerpt %}
{{- " Build error: " + build.log_error }}
{% endif %}
{% endfor %}
{{- " CI system: " + origin + "\n\n"-}}
{% endfor %}
{% else %}
{{- "\n No build failures found" }}
Expand Down

0 comments on commit 9165f5b

Please sign in to comment.