From 73f70d3c8f51f4b0b0b93e659bc1537bb10bf069 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Casta=C3=B1o=20Arteaga?= Date: Tue, 7 Jan 2025 16:52:59 +0100 Subject: [PATCH] Include packages stars in nova dump (#4219) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #4215 Signed-off-by: Sergio CastaƱo Arteaga --- database/migrations/functions/packages/get_nova_dump.sql | 1 + database/tests/functions/packages/get_nova_dump.sql | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/database/migrations/functions/packages/get_nova_dump.sql b/database/migrations/functions/packages/get_nova_dump.sql index 839d1300a..5084c8620 100644 --- a/database/migrations/functions/packages/get_nova_dump.sql +++ b/database/migrations/functions/packages/get_nova_dump.sql @@ -16,6 +16,7 @@ returns setof json as $$ where pm.package_id = p.package_id ), 'official', p.official, + 'stars', p.stars, 'repository', json_build_object( 'name', r.name, 'url', r.url, diff --git a/database/tests/functions/packages/get_nova_dump.sql b/database/tests/functions/packages/get_nova_dump.sql index 066d43d15..a107f05e6 100644 --- a/database/tests/functions/packages/get_nova_dump.sql +++ b/database/tests/functions/packages/get_nova_dump.sql @@ -35,12 +35,14 @@ insert into package ( name, latest_version, official, + stars, repository_id ) values ( :'package1ID', 'package1', '1.0.0', true, + 15, :'repo1ID' ); insert into package__maintainer (package_id, maintainer_id) @@ -68,11 +70,13 @@ insert into package ( package_id, name, latest_version, + stars, repository_id ) values ( :'package2ID', 'package2', '1.0.0', + 10, :'repo2ID' ); insert into snapshot ( @@ -90,11 +94,13 @@ insert into package ( package_id, name, latest_version, + stars, repository_id ) values ( :'package3ID', 'package3', '1.0.0', + 5, :'repo3ID' ); insert into snapshot ( @@ -131,6 +137,7 @@ select is( } ], "official": true, + "stars": 15, "repository": { "name": "repo1", "url": "https://repo1.com", @@ -147,6 +154,7 @@ select is( { "name": "package2", "latest_version": "1.0.0", + "stars": 10, "repository": { "name": "repo2", "url": "https://repo2.com"