The failed-build counter on /eval/ID pages is now orange when there are
no new build failures, red when there are new build failures.
* src/cuirass/templates.scm (newly-failed-build-badge): New procedure.
(specifications-table): Use it instead of ‘failed-build-badge’.
(evaluation-badges): Use ‘newly-failed-build-badge’ when ABSOLUTE has
a positive ‘new-failed’.
The contrast icon was arguably misleading.
* src/cuirass/templates.scm (specifications-table): Use ‘oi-dashboard’
rather than ‘oi-contrast’ for the toggle button; clarify ‘title’.
(evaluation-info-table): Likewise.
* src/cuirass/templates.scm (evaluation-build-table): Special-case the
situation where EVALUATION is not in ‘succeeded’ state. Do not emit
build table when BUILDS is empty and EVALUATION is not in ‘succeeded’
state.
* src/cuirass/templates.scm (build-details): Add link to /build/ID/log.
(build-eval-table, build-search-results-table, running-builds-table):
Link to /build/ID/log.
* src/cuirass/http.scm (evaluation-html-page): Define ‘checkout-changes’
and pass it to ‘evaluation-build-table’.
* src/cuirass/templates.scm (checkout-table): Add #:changes parameter
and honor it.
(evaluation-build-table): Add #:checkout-changes parameter and pass it
on to ‘checkout-table.
(evaluation-dashboard): Define ‘checkout-changes’ and pass it to
‘checkout-table’.
The goal is to make it easier to find the origin of a build failure.
* src/cuirass/templates.scm (build-details): Add #:channels,
#:checkouts, #:previous-checkouts, and #:first-failure.
[build-failure-info]: New procedure.
Use it.
(checkout-change-table): New procedure.
* src/cuirass/http.scm (url-handler): In “/build/ID/details”, pass extra
arguments to ‘build-details’.
* TODO: Update.
Division by zero could happen in the unlikely case of a successful
evaluation containing zero jobs.
* src/cuirass/templates.scm (specifications-table)[summary->percentage]:
Check whether TOTAL is zero before dividing.
Previously we’d pass #f to ‘eval-summary’ for jobsets that do not have
any successful evaluation.
* src/cuirass/templates.scm (specifications-table): Correctly handle
‘spec->latest-eval-ok’ returning #f.
Fixes a bug introduced in c445d2d642
whereby we’d call ‘evaluation-badges’ with #f as its first argument, due
to the last of a summary for LAST-EVAL.
* src/cuirass/templates.scm (specifications-table): When
LAST-EVAL-STATUS-OK? is false, call ‘broken-evaluation-badge’.
Fixes a bug introduced in c445d2d642.
* src/cuirass/templates.scm (specifications-table)[eval-summary]:
Use the right record accessors.
Call ‘eval-summary’ on ‘last-eval’.
The progress bar of an x86_64-linux build might be blue, that of an
i686-linux build green, and so on.
* src/cuirass/templates.scm (system->color-class): New procedure.
(workers-status): Use it to choose progress bar color class based on
system type.
Instead of using alists, internal code now manipulates records. Strong
typing makes the code easier to understand and to check for correctness.
* src/cuirass/database.scm (<build>, <build-product>, <job>)
(<output>): New record types.
(db-add-output): Keep a single argument, expect an <output> record.
(db-add-build-product): Expect a <build> record and return its ID on
success.
(db-add-build-product, db-get-output, db-get-outputs)
(db-get-build-percentages): Use record accessors and constructors.
(db-add-job): Rename to...
(db-add-job-for-build): ... this. Expect records.
(db-get-jobs): Likewise. Augment query to include 'evaluation'.
(<evaluation>): New record type.
(db-get-build-dependencies/derivation, build-dependencies/id): New
procedures.
(db-register-builds): Change signature and adjust for records.
(db-get-last-status): Produce records.
(db-get-builds-by-search, db-get-builds): Likewise.
(<checkout>): New record type.
(db-get-checkouts, db-get-latest-checkout): Produce them.
(parse-evaluation): Likewise.
(<build-summary>, <evaluation-summary>): New record types.
(db-get-latest-evaluations, db-get-evaluation-summary): Produce them.
(db-get-evaluations-absolute-summary): Adjust for records.
(<dashboard>): New record type.
(db-get-dashboard): Produce it.
* src/cuirass/http.scm (build->hydra-build): Expect records.
(evaluation->json-object): Likewise.
(evaluation-html-page): Likewise.
(url-handler): Likewise.
* src/cuirass/notification.scm (build-weather-text)
(build-details-url, notification-subject, notification-text): Likewise.
* src/cuirass/rss.scm (build-details-url, build->rss-item): Likewise.
* src/cuirass/scripts/evaluate.scm (checkouts->channel-instances):
Likewise.
(user-alists->builds): New procedure.
(inferior-evaluation): Use it.
* src/cuirass/templates.scm (specifications-table, build-details)
(input-changes, evaluation-badges, evaluation-info-table)
(build-eval-table, evaluation-build-table, running-builds-table): Adjust
for records.
(workers-status): Likewise, and add 'percentages' parameter.
(machine-status, evaluation-dashboard): Adjust for records.
* src/cuirass/base.scm (set-build-successful!, build-derivation=?)
(create-build-outputs, build-packages): Likewise.
* tests/database.scm (make-dummy-build): Likewsise.
All tests use and expect records.
* tests/remote.scm: Likewise.
* tests/http.scm: Likewise.
This avoids cluttering evaluation tables with zeros (zero scheduled
builds, zero failures, etc.).
* src/cuirass/templates.scm (build-counter-badge): Add the "hidden"
class when VALUE is 0.
* src/static/css/cuirass.css (.hidden): New class.
* src/cuirass/templates.scm (build-counter-badge)
(successful-build-badge, failed-build-badge, scheduled-build-badge): New
procedures.
(specifications-table, evaluation-badges): Use them rather than inline
code.
This is a followup to c7db7f88a2, which
would only show, say, 'guix-past' and not 'guix' (the latter being a
dependency of the former).
* src/cuirass/http.scm (dashboard-page): Call 'latest-checkouts' and
pass #:checkouts to 'evaluation-dashboard'.
* src/cuirass/templates.scm (evaluation-dashboard): Add #:checkouts and
honor it.
* src/cuirass/http.scm (url-handler)[redirect]: New procedure.
Add clause for /eval/latest/dashboard.
* src/cuirass/templates.scm (specifications-table): Link to it.
Also distinguish between a build that is completed from a build that is
completed with some available logs.
* src/cuirass/templates.scm (completed?, completed-with-logs?): New
procedures.
The specification used to build our master branch was renamed from
"guix-master" to "master".
* doc/cuirass.texi (API description): Change "guix-master" to "master".
* src/cuirass/templates.scm: Change "guix-master" to "master".