-
Notifications
You must be signed in to change notification settings - Fork 40
templates: Break out build/test summaries #310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,61 @@ | |
reject("none") | join(" ") | default(build.id, true) -}} | ||
{% endmacro %} | ||
|
||
{%- macro get_build_format(space, invalid, valid, unknown) -%} | ||
{{- | ||
"%" + space + "s" + | ||
((" %s %" + | ||
(invalid | string | length | string) + "s") | ||
if invalid else | ||
"%.0s%.0s") + | ||
((" %s %" + | ||
(valid | string | length | string) + "s") | ||
if valid else | ||
"%.0s%.0s") + | ||
((" %s %" + | ||
(unknown | string | length | string) + "s") | ||
if unknown else | ||
"%.0s%.0s") | ||
-}} | ||
{% endmacro %} | ||
|
||
{%- macro status(architecture, | ||
invalid_build_count, | ||
valid_build_count, | ||
unknown_build_count, | ||
build_fmt) -%} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this should be called |
||
{{- build_fmt | format("?" if architecture is none | ||
else architecture, | ||
"❌" if invalid_build_count else "➖", | ||
(invalid_build_count | string) | ||
if invalid_build_count else "", | ||
"✅" if valid_build_count else "➖", | ||
(valid_build_count | string) | ||
if valid_build_count else "", | ||
"❓" if unknown_build_count else "➖", | ||
(unknown_build_count | string) | ||
if unknown_build_count else "") -}} | ||
{% endmacro %} | ||
|
||
{%- macro build_status(container, space="") -%} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this should be named something like |
||
{% set invalid_build_count = | ||
container | selectattr("valid", "false") | list | length %} | ||
{% set valid_build_count = | ||
container | selectattr("valid", "true") | list | length %} | ||
{% set unknown_build_count = | ||
container | selectattr("valid", "none") | list | length %} | ||
{% set build_fmt = get_build_format(space, | ||
invalid_build_count, | ||
valid_build_count, | ||
unknown_build_count) | ||
%} | ||
{{- status("", | ||
invalid_build_count, | ||
valid_build_count, | ||
unknown_build_count, | ||
build_fmt) -}} | ||
{% endmacro %} | ||
|
||
{% macro container_summary(container, max_list_len) %} | ||
{% if container.builds %} | ||
{{- "\nBUILDS" }} | ||
|
@@ -16,54 +71,20 @@ | |
{% set unknown_builds = | ||
container.builds | selectattr("valid", "none") | list %} | ||
{{- "\n Status" }} | ||
{% set invalid_build_count = invalid_builds | length %} | ||
{% set valid_build_count = valid_builds | length %} | ||
{% set unknown_build_count = unknown_builds | length %} | ||
{% set build_fmt = | ||
"%" + | ||
((8 + (container.architecture_valid_builds | | ||
map("default", "", true) | map("length") | max)) | string) + | ||
"s" + | ||
((" %s %" + | ||
(invalid_build_count | string | length | string) + "s") | ||
if invalid_build_count else | ||
"%.0s%.0s") + | ||
((" %s %" + | ||
(valid_build_count | string | length | string) + "s") | ||
if valid_build_count else | ||
"%.0s%.0s") + | ||
((" %s %" + | ||
(unknown_build_count | string | length | string) + "s") | ||
if unknown_build_count else | ||
"%.0s%.0s") | ||
%} | ||
{% macro status(architecture, | ||
invalid_build_count, | ||
valid_build_count, | ||
unknown_build_count) %} | ||
{{- build_fmt | format("?" if architecture is none | ||
else architecture, | ||
"❌" if invalid_build_count else "➖", | ||
(invalid_build_count | string) | ||
if invalid_build_count else "", | ||
"✅" if valid_build_count else "➖", | ||
(valid_build_count | string) | ||
if valid_build_count else "", | ||
"❓" if unknown_build_count else "➖", | ||
(unknown_build_count | string) | ||
if unknown_build_count else "") -}} | ||
{% endmacro %} | ||
{{- status("", | ||
invalid_build_count, | ||
valid_build_count, | ||
unknown_build_count) }} | ||
{% set space = (( 8 + (container.architecture_valid_builds | | ||
map("default", "", true) | map("length") | max)) | string) %} | ||
{{- build_status(container.builds, space) }} | ||
{{- "\n Architectures" }} | ||
{% for architecture, valid_builds | ||
{% for architecture, arch_valid_builds | ||
in container.architecture_valid_builds.items() %} | ||
{{- status(architecture, | ||
valid_builds[false] | length, | ||
valid_builds[true] | length, | ||
valid_builds[none] | length) }} | ||
arch_valid_builds[false] | length, | ||
arch_valid_builds[true] | length, | ||
arch_valid_builds[none] | length, | ||
get_build_format(space, | ||
invalid_builds | length, | ||
valid_builds | length, | ||
unknown_builds | length)) }} | ||
{% endfor %} | ||
{% if invalid_builds %} | ||
{{- " Failures" }} | ||
|
Uh oh!
There was an error while loading. Please reload this page.