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

247 commits

Author SHA1 Message Date
Christopher Baines
42c608e004 Add a --update-database option
This runs Sqitch on startup, which should make managing the database easier,
as you just have to restart the service with this option, and the database
should be updated if necessary.
2019-06-07 07:33:34 +01:00
Christopher Baines
33cf8d66f6 Add a healthcheck endpoint
This indicates currently if the database is accessible and a simple query can
be performed. I'm mostly looking at using this when writing a system test for
this service.
2019-06-06 21:08:34 +01:00
Christopher Baines
aad2c9d9e8 Extract the database connection handling from the server
Previously, one of the first things that happened when responding to a request
was a database connection was made, even when serving the CSS. This is
unnecessary, so move the database connection handling in to the controller.

Also, to allow for separating it out from the assets, separate the assets out
from the parts of the controller that require a database connection.
2019-06-06 20:43:54 +01:00
Christopher Baines
544dc1558f Add a new test to cover some of the loading new revisions code 2019-06-02 22:02:12 +01:00
Christopher Baines
5d06a28577 Add more detailed new revision job handling
Create a new events table for the new guix revision jobs, and update this when
processing a job starts, as well as finished with success or failure.

Additionally, remove the dependnency on open-inferior/container, as this
functionality isn't merged in to Guix master yet.
2019-06-02 22:00:29 +01:00
Christopher Baines
4ccf3132b6 Record job success without deleting the job record
Previously, the records for jobs would be deleted. It's useful to know when
jobs were inserted in to the database, as well as when they succeeded (if they
have). This change also makes it possible to keep track of jobs that have
failed, as they won't be deleted.
2019-06-02 21:48:02 +01:00
Christopher Baines
f03a750705 Add some missing test files to Makefile.am 2019-06-02 16:19:06 +01:00
Christopher Baines
95ad50a80c Fix #:no-default-when in the query-parameters module
It now actually looks at the fields which have been provided.
2019-05-20 08:22:41 +01:00
Christopher Baines
9c23451482 Handle the 404 case when viewing store items 2019-05-20 08:17:56 +01:00
Christopher Baines
6add08b109 Add missing revision handling
As previously the pages would render, but with no data.
2019-05-19 22:31:07 +01:00
Christopher Baines
cc0ecdc055 Add #:code to render-json 2019-05-19 22:30:50 +01:00
Christopher Baines
2c35331075 Add #:code option to render-html 2019-05-19 22:23:22 +01:00
Christopher Baines
e92e095ee9 Add an all results option to the packages page 2019-05-19 21:28:01 +01:00
Christopher Baines
0a7e6a76f3 Add #:no-default-when option to parse-query-parameters
Where there are multiple interrelated fields, then it's useful to only apply
the default if another field hasn't been specified.
2019-05-19 21:26:38 +01:00
Christopher Baines
9f94e3278e Improve the query-parameters module for checkbox support 2019-05-19 21:26:14 +01:00
Christopher Baines
78fb3fafc0 Add type support to form-horizontal-control
Particularly to support checkboxes.
2019-05-19 21:24:50 +01:00
Christopher Baines
d4b23f81c1 Cache the pages which don't really change for a day 2019-05-18 20:25:34 +01:00
Christopher Baines
0ca5748c0f Enable passing extra headers for JSON responses
Mostly to enable passing the cache-control header.
2019-05-18 20:25:05 +01:00
Christopher Baines
03faff5da0 Remove the HTTP headers from the html module
Given that the headers may be the same, regardless whether it's HTML or JSON
being sent in the body of the response, I think it makes more sense to handle
the headers in the controller.
2019-05-18 20:08:34 +01:00
Christopher Baines
ed19764bc3 Show the branches for a revision 2019-05-18 12:36:03 +01:00
Christopher Baines
eb80905f0f Add git-branches-with-repository-details-for-commit
To get git repository and git branch information suitable for the revision
page.
2019-05-18 12:35:17 +01:00
Christopher Baines
5124fbc471 Add a utility to group list values
This is useful for some queries with duplicated parts of the results.
2019-05-18 12:34:37 +01:00
Christopher Baines
48070e4a99 Fix the table headers on the Branches page
Date and Commit were the wrong way around.
2019-05-18 12:34:18 +01:00
Christopher Baines
f04690f38c Add a View JSON button to the packages page 2019-05-16 22:44:07 +01:00
Christopher Baines
dfb1da3197 Fix query-parameters->string for multi-valued parameters 2019-05-16 22:43:51 +01:00
Christopher Baines
83012b101b Allow specifying the fields on the packages page
This is mostly for the JSON output, as it allows much more information to be
included.
2019-05-16 22:28:16 +01:00
Christopher Baines
d52f5b530f Add support to multi-value fields with defaults
To the query parameters module.
2019-05-16 22:27:47 +01:00
Christopher Baines
26cdf5568f Fix the package-metadata tests 2019-05-16 00:25:45 +01:00
Christopher Baines
e6effe7556 Fix how email dates are inserted in to PostgreSQL
Previously, the timezone was stripped off, so the timestamps were off. This
commit changes the code to use a Unix timestamp, which avoids this issue.
2019-05-16 00:03:06 +01:00
Christopher Baines
16799a34a9 Store license information for packages
And display this on the package page.

This uses a couple of new tables, and an additional field in the
package_metadata table.

Currently, the order of the licenses in the package definition isn't stored,
as I'm not sure the order in the list is significant.
2019-05-15 08:05:14 +01:00
Christopher Baines
28c2d46081 Fix type issues with the location ids
On one code path, they were handled as numbers, whereas elsewhere they were
handled as strings. This led to the package-metadata code trying to insert
duplicate entries.

Instead, just handle them as strings everywhere.
2019-05-14 07:55:17 +01:00
Christopher Baines
721d21ed4d Order the all-git-repositories results
So at least they're stable.
2019-05-13 21:10:20 +01:00
Christopher Baines
7341d17254 Store and display the location of packages
Store the location a package can be found at, and display this on the package
page.

If available, link off to the git repository containing the package.
2019-05-13 21:07:48 +01:00
Christopher Baines
9aaab6b751 Add a textual search to the packages page 2019-05-12 21:17:08 +01:00
Christopher Baines
b151d8bb78 Add a function for making query parameters mutually exclusive
This allows building more complicated forms, where some of the query
parameters don't work together.
2019-05-12 21:16:24 +01:00
Christopher Baines
4a5f42ee52 Add a function for searching for packages 2019-05-12 21:16:10 +01:00
Christopher Baines
0bdc555ff8 Add some basic pagination to the packages page
Lower powered devices will have problems displaying all ~9000+ packages, so
return a smaller number by default.
2019-05-12 20:45:33 +01:00
Christopher Baines
8eac26b17d Remove the sha1_hash from the package_metadata table
I'm thinking about adding more fields to this table, and the sha1_hash values
will make this tricker.

Therefore, remove the value, and adjust the existing code to cope. This commit
also adds a new test which coveres some of the changed functionality.
2019-05-12 18:08:17 +01:00
Christopher Baines
0ab1c71722 Add a mock-inferior module
This to help test code which uses the (guix inferior) module.
2019-05-12 17:32:37 +01:00
Christopher Baines
d212682061 Add a (tests driver) module
Using the test driver from build-aux/test-driver.scm, as this shows the test
errors when tests fail.
2019-05-12 17:32:21 +01:00
Christopher Baines
de76f89cb3 Add initial JSON output for the package page 2019-05-12 10:11:14 +01:00
Christopher Baines
e64fc090cd Add a JSON variant of the packages page 2019-05-12 09:56:24 +01:00
Christopher Baines
b3f2aab8c9 Add a JSON variant of the revision page 2019-05-12 09:51:28 +01:00
Christopher Baines
bd8b9f951c Fix extension handling a bit more
Previously, it was spliting versions up for the package pages. To stop this,
now it just matches the extensions it knows about (currently .html and .json).
2019-05-12 09:32:58 +01:00
Christopher Baines
b15c8f706e Fix a request->path-components-and-mime-type bug
The first value should always be a list.
2019-05-11 23:02:54 +01:00
Christopher Baines
658a1a20b2 Improve the content negotiation handling in general
Previously, the routing layer handled the content negotiation, and the Accept
header was ignored. Now, the extension if one is provided in the URL is still
used, and more widely than before, but the Accept header is also taken in to
account.

This all now happens before the routing decisions are made, so the routing is
now pretty much extension independant (with the exception of the
/gnu/store/... routes).
2019-05-11 22:56:25 +01:00
Christopher Baines
640fb8a2ad Update the derivation comparison implementation
This adds more query parameter validation, and uses form-horizontal-control to
neaten up the view code.
2019-05-11 20:38:16 +01:00
Christopher Baines
512a583fa7 Add support for select elements to form-horizontal-control 2019-05-11 20:36:37 +01:00
Christopher Baines
94e321ec38 Add query-parameters->string 2019-05-11 20:36:18 +01:00
Christopher Baines
3d004f8597 Add #:required and #:multi-value support to parse-query-parameters 2019-05-11 20:34:53 +01:00