2
0
Fork 0
mirror of git://git.savannah.gnu.org/guix/guix-cuirass.git synced 2023-12-14 06:03:04 +01:00
Commit graph

102 commits

Author SHA1 Message Date
Mathieu Othacehe 8d6c0dfb7e
metrics: Rename "Builds speed" section to "Builds completion".
* src/cuirass/templates.scm (global-metrics-content): Rename "Builds speed"
section to "Builds completion".
2020-09-17 11:53:03 +02:00
Mathieu Othacehe 89f0dbc8e1
metrics: Add graph legends.
* src/cuirass/templates.scm (global-metrics-content): Add legends.
2020-09-17 10:30:49 +02:00
Mathieu Othacehe 24924bb600
templates: Do not display chart title.
* src/cuirass/templates.scm (make-line-chart): Do not display chart title.
2020-09-17 10:15:06 +02:00
Mathieu Othacehe bd4f4d680a
metrics: Display more metrics.
* src/cuirass/http.scm (url-handler): Move metric page creation to ...
(metrics-page): ... this new procedure. Pass average evaluation build start
time and evaluation completion speed to "global-metrics-content".
* src/cuirass/templates.scm (make-line-chart): Add "time-x-axes?",
"xaxes-labels", "x-label" and "y-label" arguents.
(global-metrics-content): Add "avg-eval-build-start-time" and
"eval-completion-speed" arguments. Create and display two new charts from
those metrics.
2020-09-17 10:13:14 +02:00
Mathieu Othacehe f3ab04aee4
metrics: Add 'percentage-failed-eval-per-spec support.
* src/cuirass/metrics.scm (db-percentage-failed-eval-per-spec): New procedure.
(%metrics): Add 'percentage-failure-10-last-eval-per-spec,
'percentage-failure-100-last-eval-per-spec and
'percentage-failed-eval-per-spec metrics.
(db-update-metrics): Add them.
* src/cuirass/templates.scm (global-metrics-content): Add
"percentage-failed-eval" argument. Use it to display the "percentage of failed
evaluations" table.
* src/cuirass/templates.scm (url-handler): Adapt accordingly.
2020-09-15 14:34:19 +02:00
Mathieu Othacehe 97ec7a2da5
metrics: Add 'new-derivations-per-day support.
* src/cuirass/metrics.scm (db-new-derivations-previous-day): New procedure.
(%metrics): Add 'new-derivations-per-day.
(db-update-metrics): Add it.
* src/cuirass/templates.scm (make-line-chart): Add support for multiple
datasets. Also add "interpolation?" and "legend?" options.
(global-metrics-content): Add "new-derivations-per-day" argument. Adapt
"Builds per day" chart so that it uses two datasets from
'new-derivations-per-day and 'builds-per-day metrics.
* src/cuirass/templates.scm (url-handler): Adapt accordingly.
2020-09-15 11:13:09 +02:00
Mathieu Othacehe f011d87456
metrics: Add pending builds support.
* src/cuirass/metrics.scm (db-pending-builds, db-current-day-timestamp): New
procedures.
(%metrics): Add 'pending-builds.
(db-update-metrics): Add it.
* src/cuirass/templates.scm (global-metrics-content): Add "pending-builds"
argument. Display pending builds in a line chart.
* src/cuirass/http.scm (url-handler): Adapt "global-metrics-content" call
accordingly.
2020-09-15 09:55:40 +02:00
Mathieu Othacehe 21a9b2b386
Do not override onload callback.
* src/cuirass/templates.scm (make-line-chart): Do not override onload callback
as that would prevent us from adding multiple charts.
2020-09-15 09:49:40 +02:00
Mathieu Othacehe cf11b73db0
Add metrics support.
* Makefile.am: Add "upgrade-11.sql", "chart.js" and "metrics.js".
* bin/cuirass.in (main): Add 'metrics fiber.
* src/cuirass/http.scm (%file-white-list): Add "js/chart.js".
(url-handler): Add "/metrics" route.
* src/cuirass/metrics.scm: New file.
* src/cuirass/templates.scm (html-page): Add a "Global metrics" sub-menu to
"Status" dropdown menu.
(make-line-chart, global-metrics-content): New procedures.
* src/schema.sql (Metrics): New table.
* src/sql/upgrade-11.sql: New file.
* src/static/js/chart.js: New file.
2020-09-14 14:32:12 +02:00
Mathieu Othacehe f5b0d39328
Add a status field to Evaluation table.
The Evaluation table currently has an 'in_progress' field. Distinction between
succeeded and failed evaluations are based on the presence of Builds records
for the evaluation. It it also not possible to distinguish aborted evaluations
from failed evaluations.

Rename 'in_progress' field to 'status'. The 'status' field can be equal to
'started', 'succeeded', 'failed' or 'aborted'.

* src/cuirass/database.scm (evaluation-status): New exported enumeration.
(db-set-evaluations-done, db-set-evaluation-done): Remove them.
(db-abort-pending-evaluations, db-set-evaluation-status): New exported procedures.
(db-add-evaluation, db-get-builds, db-get-evaluations,
db-get-evaluations-build-summary, db-get-evaluation-summary): Adapt to use
'status' field instead of 'in_progress' field.
* src/cuirass/templates.scm (evaluation-badges): Ditto.
* src/schema.sql (Evaluations): Rename 'in_progress' field to 'status'.
* src/sql/upgrade-10.sql: New file.
* bin/cuirass.in (main): Use "db-abort-pending-evaluations" instead of
"db-set-evaluations-done".
* src/cuirass/base.scm (evaluate): Use "db-set-evaluation-status" instead of
"db-set-evaluations-done".
(build-packages): Use "db-set-evaluation-status" instead of
"db-set-evaluation-done".
* tests/database.scm (sqlite-exec): Adapt accordingly.
* tests/http.scm (evaluations-query-result): Ditto.
2020-09-10 15:16:15 +02:00
Mathieu Othacehe 33798abc3b
Handle evaluations without timestamp.
This is a follow-up of d9879583af.

* src/cuirass/templates.scm (evaluation-build-table): Do not print evaluation
date if the "timestamp" field equals zero.
2020-09-06 14:42:40 +02:00
Mathieu Othacehe d9879583af
Display evaluation date and duration.
src/cuirass/database.scm (db-get-evaluations): Add support for "timestamp",
"checkouttime" and "evaltime" fields,
(db-get-evaluation-summary): ditto.
src/cuirass/templates.scm (nearest-exact-integer, seconds->string): New
procedures,
(evaluation-build-table): print evaluation date and duration.
2020-09-06 14:23:01 +02:00
Mathieu Othacehe f71f026a41
templates: Handle missing input case.
It happens that some left-over checkout entries refer to removed inputs. In
that case, input will be #f, causing commit-hyperlink to fail with the
following error message:

In cuirass/http.scm:
   475:25  9 (url-handler _ _)
    193:3  8 (evaluation-html-page ((#:id . 5103) (# . 0) (# . 39) ?) ?)
In cuirass/templates.scm:
   612:14  7 (evaluation-build-table _ #:checkouts _ #:inputs _ # _ # ?)
In srfi/srfi-1.scm:
   586:17  6 (map1 (((#:commit . "3a3e9f2bb586e79a7931163f0191d?") ?)))
In cuirass/templates.scm:
   621:39  5 (_ _)
   584:15  4 (commit-hyperlink #f "3a3e9f2bb586e79a7931163f0191df615?")
In web/uri.scm:
   308:23  3 (string->uri _)
   278:14  2 (string->uri-reference _)
In unknown file:
           1 (regexp-exec #<regexp 7f3a76c05980> #f #<undefined> #<u?>)
In ice-9/boot-9.scm:
  1669:16  0 (raise-exception _ #:continuable? _)
In procedure regexp-exec: Wrong type argument in position 2 (expecting string): #f

* src/cuirass/templates.scm (evaluation-build-table): Do not call
"commit-hyperlink" if the matching input could not be found.
2020-07-26 17:28:03 +02:00
Mathieu Othacehe d11ce40a10
navbar: Fix typo.
* src/cuirass/templates.scm (html-page): Turn "Latest builds" into "Running
builds".
2020-07-03 08:36:27 +02:00
Mathieu Othacehe 136a8295e4
Add "latest builds" support.
Add a "status" dropdown menu in the navigation bar. For now this menu only
contains one item, a link to the "latest builds" page at "/status" location.

* src/cuirass/database.scm (db-get-builds): Add support for 'started status.
* src/cuirass/http.scm (url-handler): Add "/status" route.
* src/cuirass/templates.scm (running-builds-table): New procedure,
(html-page): add a dropdown menu containing one item, a link to "/status"
route defined above.
* src/static/css/cuirass.css: Add new class to allow bootstrap dropdown menus
to work without javascript plugin.
2020-07-02 21:07:30 +02:00
Mathieu Othacehe c2aed4a5c1
templates: Add build product type.
* src/cuirass/templates.scm (build-details): Display build product type.
2020-06-14 12:55:37 +02:00
Mathieu Othacehe f44618fc79
Add support for build products downloading.
* src/sql/upgrade-7.sql: New file.
* Makefile.am: Add it.
* src/cuirass/base.scm (create-build-outputs): New procedure,
(build-packages): call it,
(process-spec): add the new spec argument and pass it to create-build-outputs.
* src/cuirass/database.scm (db-add-build-product, db-get-build-product-path,
db-get-build-products): New exported procedures.
* src/cuirass/http.scm (respond-static-file): Move file sending to ...
(respond-file): ... this new procedure,
(url-handler): add a new "download/<id>" route, serving the requested file
with the new respond-file procedure. Also gather build products and pass them
to "build-details" for "build/<id>/details" route.
* src/cuirass/templates.scm (build-details): Honor the new "products" argument
to display all the build products associated to the given build.
* src/schema.sql (BuildProducts): New table,
(Specifications)[build_outputs]: new field.
* tests/database.scm: Add empty build-outputs spec.
* tests/http.scm: Ditto.
* examples/guix-jobs.scm: Ditto.
* examples/hello-git.scm: Ditto.
* examples/hello-singleton.scm: Ditto.
* examples/hello-subset.scm: Ditto.
* examples/random.scm: Ditto.
* doc/cuirass.texi (overview): Document it.
2020-06-10 16:42:21 +02:00
Ludovic Courtès 9559fd18d4 templates: Evaluation page links to VCS web view.
* src/cuirass/templates.scm (%vcs-web-views): New variable.
(commit-hyperlink): New procedure.
(evaluation-build-table): Use it in the input/commit table.
2020-04-17 15:07:17 +02:00
Ludovic Courtès c961de2f63 templates: Evaluation page shows each input and commit.
* src/cuirass/database.scm (db-get-inputs, db-get-checkouts): Export.
* src/cuirass/http.scm (evaluation-html-page): Pass #:checkouts and
 #:inputs to 'evaluation-build-table'.
* src/cuirass/templates.scm (evaluation-build-table): Add #:checkouts
and #:inputs.  Emit a table with "Input" and "Commit" columns.
2020-04-17 15:07:17 +02:00
Ludovic Courtès 7744583920 templates: 'time->string' doesn't show timezone for old builds.
* src/cuirass/templates.scm (time->string): Remove ~z for old builds.
2020-04-17 15:07:17 +02:00
Ludovic Courtès 9b40113ec2 templates: Fix typo in 'time->string'.
This is a followup to a1d353b152.
Until now we'd never display the year.

* src/cuirass/templates.scm (time->string): Check for (= year current).
2020-04-17 15:07:17 +02:00
Ricardo Wurmus 27af1d3464
templates: html-page: Fix indentation.
* src/cuirass/templates.scm (html-page): Fix indentation.
2020-04-15 19:54:38 +02:00
Ricardo Wurmus 6aef31bd93
templates: Display search hints.
* src/static/css/cuirass.css: New file.
* Makefile.am (dist_css_DATA): Add it.
* src/cuirass/http.scm (%file-white-list): Add css/cuirass.css.
* src/cuirass/templates.scm (search-form): Add search-hints div.
(html-page): Load cuirass.css.
2020-04-15 19:54:09 +02:00
Ludovic Courtès a436895372 http: Move "/eval" page to (cuirass templates).
* src/cuirass/http.scm (url-handler): Move inline code for ('GET "eval" id)
to...
(evaluation-html-page): ... here.  New procedure.
* src/cuirass/templates.scm (evaluation-build-table): New procedure.
2020-02-24 00:09:22 +01:00
Ludovic Courtès 1f5e5796ef templates: Build page links to corresponding evaluation.
* src/cuirass/templates.scm (build-details): Define 'evaluation'.  Add
"Evaluation" row with a link to EVALUATION.
2020-02-24 00:09:22 +01:00
Ricardo Wurmus 53fe4996be
templates: specifications-table: Add admin features.
* src/cuirass/templates.scm (specifications-table): Handle optional ADMIN?
argument.
2019-10-30 09:20:51 +01:00
Ludovic Courtès 80b6e89a7b templates: Failed evaluations link to their log.
* src/cuirass/templates.scm (evaluation-badges): Link to
/eval/ID/log/raw in the 'zero?' case.
2019-10-23 15:46:10 +02:00
Ludovic Courtès d27ff21e43 templates: Fix type errors in build details page.
This is a followup to 858b6b8c8f.

* src/cuirass/templates.scm (build-details)[blocking-outputs]: Fix type
errors when dealing with the result of 'derivation-build-plan'.
2019-09-23 22:44:53 +02:00
Ludovic Courtès 858b6b8c8f templates: Use 'derivation-build-plan'.
* src/cuirass/templates.scm (build-details): Use 'derivation-build-plan'
instead of 'derivation-prerequisites-to-build'.
2019-08-17 19:08:33 +02:00
Robert Vollmert 1aeea2f97f
Fix templates to handle all statuses.
* src/cuirass/templates.scm: Factor out class and title helpers
for build statuses, and handle all the statuses.
2019-08-07 16:19:20 +02:00
Danny Milosavljevic d5b827097b
templates: If applicable, disable "Last" and "First" pagination links.
* src/cuirass/templates.scm (pagination): Disable "Last" and "First"
if applicable.
2019-06-19 17:47:13 +02:00
Tobias Geerinckx-Rice 8c91c82e35
templates: Add link titles to evaluation badges.
* src/cuirass/templates.scm (evaluation-badges): Add ‘title’ attributes.
2019-06-19 16:24:18 +02:00
Ricardo Wurmus 39e3c899e2
templates: Expand search input on focus.
* src/cuirass/templates.scm (html-page): Include CSS for widening the search
input field on focus.
2019-06-19 15:42:00 +02:00
Ricardo Wurmus 219506d5f9
cuirass: Restore search query.
* src/cuirass/templates.scm (search-form): Take the query as an argument and
set it as the value (unless #F).
(html-page): Optionally take a value for QUERY as an argument.
* src/cuirass/http.scm (url-handler): Let "search" handler pass QUERY to
HTML-PAGE.
2019-06-19 15:38:01 +02:00
Ricardo Wurmus 5885b9814d
templates: Display logs of blocking dependencies.
* src/cuirass/templates.scm (build-details): Determine failed outputs of
prerequisites and link to their logs.
2019-06-19 15:17:45 +02:00
Ricardo Wurmus 372d47b326
cuirass: Display builds in separate tabs.
* src/cuirass/http.scm (url-handler): Split result for "eval" page in tabs.
* src/cuirass/templates.scm (build-eval-table): Remove border from table head;
Remove lead paragraph.
2019-06-19 09:38:08 +02:00
Ricardo Wurmus 5f631820c8
templates: Link to "details" page in build tables.
* src/cuirass/templates.scm (build-eval-table, build-search-results-table):
Link ID to build details URL.
2019-06-19 00:09:27 +02:00
Ricardo Wurmus 5070d17e7e
http: Handle /build/<id>/details URL.
* src/cuirass/http.scm (url-handler): Add handler for /build/<id>/details.
* src/cuirass/templates.scm (build-details): New procedure.
2019-06-18 23:59:53 +02:00
Ricardo Wurmus 965bace663
templates: Highlight query string.
* src/cuirass/templates.scm (build-search-results-table): Highlight query
string.
2019-05-21 11:37:34 +02:00
Ricardo Wurmus ce114d8446
cuirass: Add search for builds.
* src/cuirass/database.scm (db-get-builds-by-search, db-get-builds-query-min,
db-get-builds-query-max): New procedures.
* src/cuirass/http.scm (handle-builds-search-request): New procedure.
(url-handler): Handle "search" route.
* src/cuirass/templates.scm (search-form): New variable.
(html-page): Use it.
(build-search-results-table): New procedure.
2019-05-17 22:40:12 +02:00
Ludovic Courtès 0b40dca734 templates: Mark failures on the evaluation page.
* src/cuirass/templates.scm (evaluation-badges): Use a special badge
denoting failure when the sum of all jobs is zero.
2018-11-07 15:28:05 +01:00
Ludovic Courtès 2d7b703197 templates: Add link to build log only for completed builds.
* src/cuirass/templates.scm (build-eval-table)[table-row]: Define
'completed?'.  Add link to build log iff COMPLETED? is true.
2018-11-07 15:28:05 +01:00
Ludovic Courtès a1d353b152 templates: Display dates in a concise way.
* src/cuirass/templates.scm (time->string): New procedure.
(build-eval-table): Use it instead of 'strftime'.
2018-11-07 15:28:05 +01:00
Ludovic Courtès 74436dae50 templates: Adjust build table headers.
* src/cuirass/templates.scm (build-eval-table)[table-header]: Change
"Nixname" to "Name" and "Finished at" to "Completion time".  Use strings
for each header.
2018-11-07 15:28:05 +01:00
Ludovic Courtès fd7dca655f templates: Display a finish time only for completed builds.
* src/cuirass/templates.scm (build-eval-table): Display a finish time
only when STATUS is 'succeeded' or 'failed'.
2018-11-07 15:28:05 +01:00
Ludovic Courtès d90751624c templates: Distinguish among the various failure cases.
* src/cuirass/templates.scm (build-eval-table)[table-row]: Use the
'build-status' macro instead of numeric values.  Distinguish the
'cancel' and 'failed-dependency' cases from other failure cases.
2018-11-07 15:28:05 +01:00
TSholokhova bccb268f80
templates: Add title to the evaluations table.
* src/cuirass/http.scm (url-handler): Pass the ID argument to
BUILD-EVAL-TABLE.
* src/cuirass/templates.scm (build-eval-table): Add an EVAL-ID argument, add
title.
2018-09-30 17:08:17 +02:00
TSholokhova cbf8e13835
templates: Add a navigation bar.
* src/cuirass/database.scm (db-get-evaluation-specification): New exported
procedure.
* src/cuirass/http.scm (respond-html): Allow to pass CODE as argument.
(respond-html-eval-not-found): New procedure.
(url-handler): Fill navigation arguments.  Handle the case where the
evaluation doesn't exist.
* src/cuirass/templates.scm (navigation-items): New procedure.
(html-page): Add navigation bar.

Co-authored-by: Clément Lassieur <clement@lassieur.org>
2018-09-30 17:08:15 +02:00
TSholokhova 3b08d6ea98
templates: Add build log links.
* src/cuirass/templates.scm (build-eval-table): Add build log links to the
table.
2018-09-30 13:14:02 +02:00
TSholokhova f51bd3f554
templates: Allow to filter builds by status.
* src/cuirass/database.scm (db-get-builds): Add 'succeeded' and 'failed'
status filters.
(db-get-builds-min, db-get-builds-max): Add support for a new 'status'
argument.
* src/cuirass/http.scm (url-handler): Add a status argument for the '/eval/id'
endpoint.
* src/cuirass/templates.scm (evaluation-badges): Add links to the buttons.
(build-eval-table): Add a 'status' argument.

Co-authored-by: Clément Lassieur <clement@lassieur.org>
2018-09-30 13:10:56 +02:00
Clément Lassieur 8d40c49170
database: Add a Checkouts table.
It is used to know when a new evaluation must be triggered and to display
input changes.

* Makefile.am (dist_sql_DATA): Add 'src/sql/upgrade-3.sql'.
* bin/cuirass.in (main): Call DB-SET-EVALUATION-DONE at startup to clear
'in-progress' evaluations.
* bin/evaluate.in (input-checkout, format-checkouts): Rename '#:name' to
'#:input'.
* doc/cuirass.texi (Stamps): Remove section.
(Checkouts): New section.
* src/cuirass/base.scm (fetch-input, fetch-inputs, compile-checkouts): Rename
'#:name' to '#:input'.
(evaluate): Remove the COMMITS argument.  Add an EVAL-ID argument.  Don't call
DB-ADD-EVALUATION because it was called sooner.  Remove the EVAL-ID argument
to AUGMENT-JOB because it's a closure.
(build-packages): Add an EVAL-ID argument.  Call DB-SET-EVALUATION-DONE once
all the derivations are registered.
(process-specs): Replace the stamping mechanism by the primary key constraint
of the Checkouts table: call "evaluate" only when DB-ADD-EVALUATION is true,
which means that at least one checkout was added.  Change the EVALUATE and
BUILD-PACKAGES arguments accordingly.
* src/cuirass/database.scm (db-add-stamp, db-get-stamp): Remove procedures.
(db-set-evaluations-done, db-set-evaluation-done): New exported procedure.
(db-add-checkout): New procedure that returns #f if a checkout with the same
revision already exists.
(db-add-evaluation): Replace the EVAL argument with a SPEC-NAME and a
CHECKOUTS arguments.  Insert the evaluation only if at least one checkout was
inserted.  Return #f otherwise.
(db-get-checkouts): New procedure.
(db-get-evaluations, db-get-evaluations-build-summary): Handle the
'in_progress' column, remove the 'commits' column.  Return the result of
DB-GET-CHECKOUTS as part of the evaluation.
* src/cuirass/templates.scm (input-changes, evaluation-badges): New
procedures.
(evaluation-info-table): Rename "Commits" to "Input changes".  Use
INPUT-CHANGES to display the input changes that triggered the evaluation.  Use
EVALUATION-BADGES to display a message indicating that the evaluation is in
progress.
* src/schema.sql (Stamps): Remove table.
(Checkouts): New table.
(Evaluations): Remove the 'commits' column.  Add an 'in_progress' column.
* src/sql/upgrade-3.sql: New file with SQL queries to upgrade the database.
* tests/database.scm (make-dummy-eval): Remove procedure.
(make-dummy-checkouts): New procedure.
("sqlite-exec"): Remove the 'commits' column.  Add the 'in_progress' column.
("db-update-build-status!", "db-get-builds", "db-get-pending-derivations"):
Update the arguments of DB-ADD-EVALUATION accordingly.
* tests/http.scm (hash-table=?): Add support for lists of hash tables.
(evaluations-query-result): Replace '#:commits' with '#:checkouts'.  Return a
list instead of returning one element, for symmetry.
("fill-db"): Add a new input so that the second checkout can refer to it.
Replace EVALUATION1 and EVALUATION2 with CHECKOUTS1 and CHECKOUTS2.  Update
the arguments of DB-ADD-EVALUATION accordingly.
("/api/queue?nr=100"): Take the CAR of the EVALUATIONS-QUERY-RESULT list to
make it symmetrical with the other argument of HASH-TABLE=?.
2018-08-27 15:38:44 +02:00
TSholokhova 675cd04a85
Add a web interface.
* Makefile.am (dist_sql_DATA): Add static files.
* src/cuirass/database.scm (assqx-ref): Export it.
(db-get-builds): Add 'evaluation' filter and filters for pagination.
(db-get-evaluations-build-summary, db-get-evaluations-id-min,
db-get-evaluations-id-max, db-get-builds-min, db-get-builds-max): New exported
procedures.
* src/cuirass/http.scm (%static-directory): New parameter.
(%page-size, %file-mime-types, %file-white-list): New variables.
(handle-build-request, handle-builds-request): Move the WITH-CRITICAL-SECTION
call out.
(url-handler): Add RESPOND-HTML, RESPOND-STATIC-FILE and RESPOND-NOT-FOUND
procedures.  Call WITH-CRITICAL-SECTION sooner for the '/build',
'/api/latestbuilds' and '/api/queue' routes.  Add '/', '/jobset/<name>',
'/eval/<id>', '/static/<path>' routes.  Use RESPOND-NOT-FOUND when the route
isn't found.
* src/cuirass/templates.scm: New file.
(html-page, specifications-table, evaluation-info-table,
build-eval-table): New exported procedures.
(pagination): New procedure.

Signed-off-by: Clément Lassieur <clement@lassieur.org>
2018-07-29 23:47:00 +02:00