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

460 commits

Author SHA1 Message Date
Mathieu Othacehe
f0e0c3454f
Add parameters support.
* src/cuirass/parameters.scm: New file.
* Makefile.am (dist_pkgmodule_DATA): Add it.
* bin/cuirass.in: Add "parameters" argument.
* src/cuirass/base.scm (read-parameters): New procedure.
* src/cuirass/notification.scm (build-details-url): New procedure.
(notification-text): Use it.
* src/cuirass/rss.scm (build-details-url): New procedure.
(build->rss-item): Use it.
(rss-feed): Remove "base-url" argument.
* src/cuirass/remote-server.scm: Add "parameters" argument.
* src/cuirass/zabbix.scm (%zabbix-uri, %zabbix-uri, %zabbix-password): Remove
them.
(zabbix-request, zabbix-login): Adapt accordingly.
2021-02-22 09:05:27 +01:00
Mathieu Othacehe
f6fdb13b50
Add Mastodon support.
* src/cuirass/mastodon.scm: New file.
* Makefile.am (dist_pkgmodule_DATA): Add it.
* src/cuirass/notification.scm (notification-type): Add "mastodon".
(notification-mastodon): New procedure.
(send-notifications): Add it.
2021-02-21 10:37:11 +01:00
Mathieu Othacehe
4495e08542
Add notifications support.
* src/cuirass/mail.scm: New file.
* src/cuirass/notification.scm: New file.
* src/sql/upgrade-5.sql: New file.
* Makefile.am (dist_pkgmodule_DATA, dist_sql_DATA): Add them.
* src/schema.sql (Specifications)[notifications]: New field.
* bin/cuirass.in: Wrap inside the "with-notification" macro.
* src/cuirass/remote-server.scm (remote-server): Ditto.
* src/cuirass/database.scm (db-add-specification): Add notifications field.
(db-get-specifications): Ditto.
(db-update-build-status!): Send notifications.
* tests/mail.sh: New file.
* tests/database.scm (mu-debug, tmp-mail): New variables.
(mailer): New procedure.
(example-spec): Add an email notification.
("mail-notification"): New test case.
2021-02-21 09:55:41 +01:00
Mathieu Othacehe
aa9099e4df
Move date->rfc822-str to utils.scm.
* src/cuirass/rss.scm (date->rfc822-str): Move it to ...
* src/cuirass/utils.scm: ... here.
2021-02-21 09:15:39 +01:00
Mathieu Othacehe
422de6c3e2
Remove favicon in SVG format.
* src/static/images/icon.svg: Remove it.
* src/cuirass/http.scm (%file-white-list): Remove "images/icon.svg".
* src/cuirass/templates.scm (html-page): Remove icon.svg link.
2021-02-19 19:25:11 +01:00
Mathieu Othacehe
2ab6c4604d
Add favicon support.
* src/cuirass/http.scm (%file-white-list): Rename "logo.png" into "guix.png".
Add "icon.png" and "icon.svg".
* src/cuirass/templates.scm (html-page): Adapt it.
* src/static/images/logo.png: Rename it ...
* src/static/images/guix.png: ... into this file.
* src/static/images/icon.png: New file.
* src/static/images/icon.svg: New file.
2021-02-19 09:53:16 +01:00
Mathieu Othacehe
b200ea8947
Add a lock icon for admin actions.
* src/cuirass/templates.scm (build-details, evaluation-info-table): Add lock
icons for admin actions.
2021-02-19 09:19:09 +01:00
Mathieu Othacehe
efb140d3d5
Remove the evaluation restart dropdown arrow.
* src/cuirass/templates.scm: Remove the evaluation restart dropdown arrow.
* src/static/css/cuirass.css (no-dropdown-arrow): New rule.
2021-02-18 15:37:10 +01:00
Mathieu Othacehe
64151eee28
Add an evaluation restart button.
* src/cuirass/http.scm (url-handler): New route
"/admin/evaluation/<id>/restart".
* src/cuirass/templates.scm (evaluation-info-table): Add an evaluation restart
button.
2021-02-18 15:22:59 +01:00
Mathieu Othacehe
4a0cea2245
database: Add "db-restart-evaluation!" support.
* src/cuirass/database.scm (db-restart-evaluation!): New procedure.
* tests/database.scm (db-restart-evaluation!): New test.
2021-02-18 15:12:54 +01:00
Mathieu Othacehe
04185edba6
Allow unconditionnal build restart.
* src/cuirass/templates.scm (build-details): Allow unconditionnal build
restart.
2021-02-18 14:57:42 +01:00
Mathieu Othacehe
4e0152f7a4
Add a build restart button.
* src/cuirass/http.scm (url-handler): New route "/admin/build/<id>/restart".
* src/cuirass/template.scm (build-details): Add a "restart" button.
2021-02-18 14:53:52 +01:00
Mathieu Othacehe
31342ff80f
database: Add db-restart-build! support.
* src/cuirass/database.scm (db-restart-build!): New procedure.
* tests/database.scm (db-restart-build!): New test.
2021-02-17 19:11:38 +01:00
Mathieu Othacehe
860fffa260
remote: Set the locale only in the publish thread.
* src/cuirass/remote-server.scm (remote-server): Move the locale setup to the
publish thread.
* src/cuirass/remote-worker.scm (remote-worker): Ditto.
* src/cuirass/remote.scm (publish-server): Set the locale.
2021-02-17 17:19:27 +01:00
Mathieu Othacehe
ea01201ccd
remote: Use a default locale.
* src/cuirass/remote-server.scm (remote-server): Use a default locale.
* src/cuirass/remote-worker.scm (remote-worker): Ditto.
2021-02-17 14:23:05 +01:00
Mathieu Othacehe
a5f0a5f04d
Remove outdated commentary.
* src/cuirass/database.scm (db-register-builds): Remove commentary.
2021-02-14 15:32:49 +01:00
Mathieu Othacehe
83f33cdbb4
remote: Remove address argument. 2021-02-12 14:39:12 +01:00
Mathieu Othacehe
b191a2a5f6
Pick the first worker build.
* src/cuirass/templates.scm (machine-status): Pick the first worker build if
multiple builds are started on the same worker.
2021-02-10 18:27:06 +01:00
Mathieu Othacehe
e77a0a94fe
database: Fix db-get-build-percentage query.
* src/cuirass/database.scm (db-get-build-percentage): Consider both successful
and failing builds.
2021-02-10 18:23:41 +01:00
Mathieu Othacehe
38701970eb
remote: Discover server log-port and publish-port without Avahi.
* src/cuirass/remote.scm (zmq-server-info, zmq-worker-request-info-message):
New procedures.
* src/cuirass/remote-server.scm (%log-port, %publish-port): New parameters.
(read-worker-exp): Handle 'worker-request-info message.
(remote-server): Set the new parameters.
* src/cuirass/remote-worker.scm (start-worker): Rename "server" argument. Send
a 'worker-request-info message to discover the server log port and publish
port.
(remote-worker): Adapt it.
2021-02-10 17:37:37 +01:00
Mathieu Othacehe
5e5850533e
Add Zabbix command line argument.
* bin/cuirass.in: Add "--zabbix-uri" argument.
* src/cuirass/zabbix.scm (%zabbix-uri): Export it.
2021-02-08 13:31:28 +01:00
Mathieu Othacehe
ac98f81671
Add Zabbix support. 2021-02-08 12:26:35 +01:00
Mathieu Othacehe
7aa1d9156a
Return worker last-seen field as integer.
* src/cuirass/database.scm (db-get-worker, db-get-workers): Return last-seen
field as integer.
2021-02-07 18:16:57 +01:00
Mathieu Othacehe
eea91d9a63
remote: Swallow zlib errors.
* src/cuirass/remote.scm (swallow-zlib-error): New macro.
(send-log): Use it.
2021-02-06 09:42:54 +01:00
Mathieu Othacehe
75c44bb579
remote: Stop polling once the workers are started.
* src/cuirass/remote-worker.scm (remote-worker): Stop the avahi poll loop once
the workers are started.
2021-02-06 09:41:11 +01:00
Mathieu Othacehe
485ed9182b
Fix weather query.
* src/cuirass/database.scm (db-get-builds): Add missing parens.
2021-02-02 14:48:36 +01:00
Mathieu Othacehe
8bdc7ee535
Fix weather value.
* src/cuirass/database.scm (db-get-builds): Fix weather value.
* tests/http.scm (build-query-result): Adapt it.
2021-02-02 14:29:16 +01:00
Mathieu Othacehe
6bd940fc24
Add RSS link to the home page.
* src/cuirass/templates.scm (specifications-table): Add RSS link.
2021-02-02 14:11:55 +01:00
Mathieu Othacehe
4e98cb02dd
Add RSS link to the evaluation page.
* src/cuirass/templates.scm (evaluation-info-table): Add RSS link.
2021-02-02 14:09:35 +01:00
Mathieu Othacehe
7cf304f754
Fix RSS specification handling.
* src/cuirass/http.scm (url-handler): Pass the specification to
"db-get-builds" procedure.
2021-02-02 13:57:28 +01:00
Mathieu Othacehe
2befdc6a0d
Use a XML header for the RSS feed.
* src/cuirass/http.scm (respond-xml): New procedure.
(url-handler): Use it for the RSS feed.
2021-02-02 13:06:38 +01:00
Mathieu Othacehe
f8ddf8ca09
Add basic RSS support.
* src/cuirass/rss.scm: New file.
* Makefile.am (dist_pkgmodule_DATA): Add it.
* src/cuirass/http.scm (url-handler): Add "/events/rss" route.
2021-02-02 11:58:29 +01:00
Mathieu Othacehe
4f4d7ff7db
Move weather field to database.
* src/sql/upgrade-4.sql: New file.
* Makefile.am (dist_sql_DATA): Add it.
* src/schema.sql (Builds)[weather]: New field.
(Builds_weather_evaluation): New index.
* src/cuirass/database.scm (db-get-last-status): New procedure.
(db-update-build-status!): Use it and update the new weather field.
(db-get-builds): Adapt it.
* tests/http.scm (build-query-result): Ditto.
2021-02-02 11:56:28 +01:00
Mathieu Othacehe
f6662298c9
Move weather icon next to build status icon.
* src/cuirass/templates.scm (build-details): Move the weather icon.
2021-02-01 19:02:27 +01:00
Mathieu Othacehe
79b77b4377
remote: Start workers only once.
* src/cuirass/remote-worker.scm (%workers-started?): New variable.
(remote-worker): Use it to start workers only once.
2021-02-01 18:16:23 +01:00
Mathieu Othacehe
a57b066e4f
Add build history support.
* src/cuirass/database.scm (db-get-builds): Add "oldevaluation" filter.
* src/cuirass/templates.scm (build-details): Add "history" argument.
* src/cuirass/http.scm (url-handler): Adapt it.
2021-02-01 17:49:00 +01:00
Mathieu Othacehe
f9a5cbe0dd
Add weather support in build details.
* src/cuirass/templates.scm (build-details): Display weather.
2021-02-01 15:15:13 +01:00
Mathieu Othacehe
d7282c05c0
Add build weather support.
* src/cuirass/database.scm (build-weather): New macro.
(build-status->weather): New procedure.
(db-get-builds): Return the build weather using the new procedure.
* src/cuirass/http.scm (build->hydra-build): Also return the weather.
* src/cuirass/templates.scm (weather-class, weather-title): New procedures.
(build-eval-table): Display the weather.
* tests/database.scm ("db-get-build weather"): New tests.
* tests/http.scm (build-query-result): Adapt it.
2021-02-01 14:27:24 +01:00
Mathieu Othacehe
54244e6e97
database: Fix "db-update-build-status!".
* src/cuirass/database.scm (db-update-build-status): Only consider evaluations
that happened before the current one. This is useful when updating the build
status of old evaluations.
2021-02-01 12:30:38 +01:00
Mathieu Othacehe
7697735fce
database: Fix "db-get-worker".
* src/cuirass/database.scm (db-get-worker): Handle the case where no worker
were found.
2021-02-01 12:22:56 +01:00
Mathieu Othacehe
da93cb96ff
Fix SQL syntax.
* src/sql/upgrade-3.sql: Fix syntax.
2021-02-01 12:06:05 +01:00
Mathieu Othacehe
74c1a94a4d
Introduce build "last_status" field.
* src/sql/upgrade-3.sql: New file.
* Makefile.am (dist_sql_DATA): Add it.
* src/schema.sql (Builds)[last_status]: New field.
* src/cuirass/database.scm (db-update-build-status!): Honor it.
(db-get-builds): Return it.
* tests/database.scm ("db-update-build-status!"): New test.
2021-02-01 11:45:10 +01:00
Mathieu Othacehe
158966dca0
Fix /api/latestbuilds ordering.
Evaluations are added sequentially to database but builds are not always
registered nor performed in order. This means that a build corresponding to an
older evaluation can be returned first if it was completed last. Order by
descending evaluation id to prevent it.

* src/cuirass/database.scm (db-get-builds): Add "evaluation" order.
* src/cuirass/http.scm (url-handler): Order latestbuilds by descending
evaluation number.
2021-01-31 21:09:17 +01:00
Mathieu Othacehe
e9e0943945
Remove workers hash table.
* src/cuirass/database.scm (db-add-worker): Rename ...
(db-add-or-update-worker): ... into this new procedure.
(db-get-worker, db-remove-unresponsive-workers): New procedures.
* src/cuirass/remote-server.scm (%workers): Remove it.
(pop-build): Adapt it.
(remove-unresponsive-workers!): Remove it.
(read-worker-exp): Adapt it.
(zmq-start-proxy): Ditto.
* tests/database.scm ("db-add-worker"): Rename ...
("db-add-or-update-worker"): ... into this new test.
("db-get-worker", "db-remove-unresponsive-workers"): New tests.
2021-01-31 10:31:01 +01:00
Mathieu Othacehe
b993f3d433
Truncate long lines.
* src/cuirass/templates (workers-status): Truncate long lines.
2021-01-30 20:50:51 +01:00
Mathieu Othacehe
4370acce19
Sort workers consistently.
* src/cuirass/templates.scm (workers-status): Sort workers consistently.
2021-01-30 18:10:31 +01:00
Mathieu Othacehe
6c0298e12c
Remove left-over procedure.
* src/cuirass/templates.scm (workers-status): Remove unused "build-row"
procedure.
2021-01-30 18:02:35 +01:00
Mathieu Othacehe
5f770638bb
Fix workers display.
* src/cuirass/templates.scm (workers-status): Handle the case where multiple
builds are started on a worker.
2021-01-30 16:55:22 +01:00
Mathieu Othacehe
6838ec2eac
database: Prevent division by zero.
* src/cuirass/database.scm (db-get-build-percentage): Prevent division by zero.
2021-01-30 16:14:04 +01:00
Mathieu Othacehe
158dd2bd42
Fix build duration display.
* src/cuirass/templates.scm (build-details): Fix build duration display.
2021-01-30 16:11:50 +01:00