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

11 commits

Author SHA1 Message Date
Danjela Lura 9e93b2b3a8 Fix the test-model-package-metadata test
Signed-off-by: Christopher Baines <mail@cbaines.net>
2020-06-19 16:03:32 +01:00
Christopher Baines bb7c2a1916 Add a missing import 2020-02-27 21:09:39 +00:00
Christopher Baines 2f41fe79be Adapt some license related code to work without mock in the tests
With Guile 3, there's a potential for mock to work in even fewer
circumstances. So, adapt the code to enable writing the tests without mock.
2020-02-24 21:47:34 +00:00
Christopher Baines ffdde6ba36 Check that the test database is being used in all the tests 2020-02-24 21:16:41 +00:00
Christopher Baines d3913a14d5 Start handling ids as numbers, rather than strings
squee, returns all data as strings, and expects strings as inputs to
queries. So, keeping the ids as strings was easy initially, but it means that
you can't tell from the type whether it should be quoted, or not...

Therefore, handle ids as strings, converting them to numbers when they're
fetched from the database, and back to strings as part of the queries.
2019-09-05 16:07:23 +02:00
Christopher Baines 84197686ce Fix some duplicated values in tables
The licenses table, along with the package_metadata table had duplicate
values. This could happen as the unique constraints on those tables didn't
properly account for the nullable fields.

The duplicates in those tables also affected the license_sets, packages,
package_derivations tables in a similar way. Finally, the
guix_revision_package_derivations table was also affected.

This commit adds a migration to fix the data, as well as the constraints. THe
code to populate the licenses and package_metadata tables is also updated.
2019-08-04 09:39:40 +01:00
Christopher Baines 743cec7cb6 Associate a name with database connections
This helps when working out which connection to the database is doing what.
2019-07-12 19:49:26 +01:00
Christopher Baines 26cdf5568f Fix the package-metadata tests 2019-05-16 00:25:45 +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 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 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