Skip to content

Commit

Permalink
Include packages stars in nova dump (#4219)
Browse files Browse the repository at this point in the history
Closes #4215

Signed-off-by: Sergio Castaño Arteaga <[email protected]>
  • Loading branch information
tegioz authored Jan 7, 2025
1 parent cae04c0 commit 73f70d3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions database/migrations/functions/packages/get_nova_dump.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 8 additions & 0 deletions database/tests/functions/packages/get_nova_dump.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 (
Expand All @@ -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 (
Expand Down Expand Up @@ -131,6 +137,7 @@ select is(
}
],
"official": true,
"stars": 15,
"repository": {
"name": "repo1",
"url": "https://repo1.com",
Expand All @@ -147,6 +154,7 @@ select is(
{
"name": "package2",
"latest_version": "1.0.0",
"stars": 10,
"repository": {
"name": "repo2",
"url": "https://repo2.com"
Expand Down

0 comments on commit 73f70d3

Please sign in to comment.