Skip to content

Commit

Permalink
Add has_values_schema field to search output (#3771)
Browse files Browse the repository at this point in the history
Signed-off-by: Sergio Castaño Arteaga <[email protected]>
  • Loading branch information
tegioz authored Apr 17, 2024
1 parent 109ae95 commit f83b553
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
4 changes: 3 additions & 1 deletion database/migrations/functions/packages/search_packages.sql
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ begin
r.scanner_disabled as repository_scanner_disabled,
u.alias as user_alias,
o.name as organization_name,
o.display_name as organization_display_name
o.display_name as organization_display_name,
(s.values_schema is not null and s.values_schema <> '{}') as has_values_schema
from package p
join snapshot s using (package_id)
join repository r using (repository_id)
Expand Down Expand Up @@ -176,6 +177,7 @@ begin
'app_version', app_version,
'license', license,
'deprecated', deprecated,
'has_values_schema', has_values_schema,
'signed', signed,
'signatures', signatures,
'security_report_summary', security_report_summary,
Expand Down
36 changes: 36 additions & 0 deletions database/tests/functions/packages/search_packages.sql
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ insert into snapshot (
readme,
security_report_summary,
containers_images,
values_schema,
ts
) values (
:'package3ID',
Expand All @@ -229,6 +230,7 @@ insert into snapshot (
'readme',
'{"high": 2, "medium": 1}',
'[{"image": "quay.io/org/img:1.0.0", "whitelisted": true}]',
'{"key": "value"}',
'2020-06-16 11:20:34+02'
);
insert into production_usage (package_id, organization_id) values(:'package1ID', :'org1ID');
Expand Down Expand Up @@ -257,6 +259,7 @@ select results_eq(
"version": "1.0.0",
"app_version": "12.1.0",
"deprecated": true,
"has_values_schema": false,
"signed": true,
"signatures": ["cosign"],
"all_containers_images_whitelisted": false,
Expand Down Expand Up @@ -288,6 +291,7 @@ select results_eq(
"logo_image_id": "00000000-0000-0000-0000-000000000001",
"version": "1.0.0",
"app_version": "12.1.0",
"has_values_schema": false,
"license": "Apache-2.0",
"production_organizations_count": 1,
"ts": 1592299235,
Expand All @@ -313,6 +317,7 @@ select results_eq(
"description": "description",
"logo_image_id": "00000000-0000-0000-0000-000000000003",
"version": "1.0.0",
"has_values_schema": true,
"security_report_summary": {
"high": 2,
"medium": 1
Expand Down Expand Up @@ -405,6 +410,7 @@ select results_eq(
"version": "1.0.0",
"app_version": "12.1.0",
"deprecated": true,
"has_values_schema": false,
"signed": true,
"signatures": ["cosign"],
"all_containers_images_whitelisted": false,
Expand Down Expand Up @@ -437,6 +443,7 @@ select results_eq(
"version": "1.0.0",
"app_version": "12.1.0",
"license": "Apache-2.0",
"has_values_schema": false,
"production_organizations_count": 1,
"ts": 1592299235,
"repository": {
Expand All @@ -461,6 +468,7 @@ select results_eq(
"description": "description",
"logo_image_id": "00000000-0000-0000-0000-000000000003",
"version": "1.0.0",
"has_values_schema": true,
"security_report_summary": {
"high": 2,
"medium": 1
Expand Down Expand Up @@ -512,6 +520,7 @@ select results_eq(
"version": "1.0.0",
"app_version": "12.1.0",
"license": "Apache-2.0",
"has_values_schema": false,
"production_organizations_count": 1,
"ts": 1592299235,
"repository": {
Expand Down Expand Up @@ -558,6 +567,7 @@ select results_eq(
"version": "1.0.0",
"app_version": "12.1.0",
"license": "Apache-2.0",
"has_values_schema": false,
"production_organizations_count": 1,
"ts": 1592299235,
"repository": {
Expand Down Expand Up @@ -603,6 +613,7 @@ select results_eq(
"version": "1.0.0",
"app_version": "12.1.0",
"deprecated": true,
"has_values_schema": false,
"signed": true,
"signatures": ["cosign"],
"all_containers_images_whitelisted": false,
Expand Down Expand Up @@ -635,6 +646,7 @@ select results_eq(
"version": "1.0.0",
"app_version": "12.1.0",
"license": "Apache-2.0",
"has_values_schema": false,
"production_organizations_count": 1,
"ts": 1592299235,
"repository": {
Expand Down Expand Up @@ -681,6 +693,7 @@ select results_eq(
"version": "1.0.0",
"app_version": "12.1.0",
"license": "Apache-2.0",
"has_values_schema": false,
"production_organizations_count": 1,
"ts": 1592299235,
"repository": {
Expand Down Expand Up @@ -727,6 +740,7 @@ select results_eq(
"version": "1.0.0",
"app_version": "12.1.0",
"deprecated": true,
"has_values_schema": false,
"signed": true,
"signatures": ["cosign"],
"all_containers_images_whitelisted": false,
Expand Down Expand Up @@ -759,6 +773,7 @@ select results_eq(
"version": "1.0.0",
"app_version": "12.1.0",
"license": "Apache-2.0",
"has_values_schema": false,
"production_organizations_count": 1,
"ts": 1592299235,
"repository": {
Expand Down Expand Up @@ -805,6 +820,7 @@ select results_eq(
"version": "1.0.0",
"app_version": "12.1.0",
"deprecated": true,
"has_values_schema": false,
"signed": true,
"signatures": ["cosign"],
"all_containers_images_whitelisted": false,
Expand Down Expand Up @@ -837,6 +853,7 @@ select results_eq(
"version": "1.0.0",
"app_version": "12.1.0",
"license": "Apache-2.0",
"has_values_schema": false,
"production_organizations_count": 1,
"ts": 1592299235,
"repository": {
Expand Down Expand Up @@ -922,6 +939,7 @@ select results_eq(
"version": "1.0.0",
"app_version": "12.1.0",
"license": "Apache-2.0",
"has_values_schema": false,
"production_organizations_count": 1,
"ts": 1592299235,
"repository": {
Expand Down Expand Up @@ -1026,6 +1044,7 @@ select results_eq(
"version": "1.0.0",
"app_version": "12.1.0",
"license": "Apache-2.0",
"has_values_schema": false,
"production_organizations_count": 1,
"ts": 1592299235,
"repository": {
Expand Down Expand Up @@ -1075,6 +1094,7 @@ select results_eq(
"version": "1.0.0",
"app_version": "12.1.0",
"deprecated": true,
"has_values_schema": false,
"signed": true,
"signatures": ["cosign"],
"all_containers_images_whitelisted": false,
Expand Down Expand Up @@ -1294,6 +1314,7 @@ select results_eq(
"description": "description",
"logo_image_id": "00000000-0000-0000-0000-000000000003",
"version": "1.0.0",
"has_values_schema": true,
"security_report_summary": {
"high": 2,
"medium": 1
Expand Down Expand Up @@ -1347,6 +1368,7 @@ select results_eq(
"version": "1.0.0",
"app_version": "12.1.0",
"license": "Apache-2.0",
"has_values_schema": false,
"production_organizations_count": 1,
"ts": 1592299235,
"repository": {
Expand Down Expand Up @@ -1398,6 +1420,7 @@ select results_eq(
"version": "1.0.0",
"app_version": "12.1.0",
"license": "Apache-2.0",
"has_values_schema": false,
"production_organizations_count": 1,
"ts": 1592299235,
"repository": {
Expand All @@ -1422,6 +1445,7 @@ select results_eq(
"description": "description",
"logo_image_id": "00000000-0000-0000-0000-000000000003",
"version": "1.0.0",
"has_values_schema": true,
"security_report_summary": {
"high": 2,
"medium": 1
Expand Down Expand Up @@ -1477,6 +1501,7 @@ select results_eq(
"version": "1.0.0",
"app_version": "12.1.0",
"license": "Apache-2.0",
"has_values_schema": false,
"production_organizations_count": 1,
"ts": 1592299235,
"repository": {
Expand Down Expand Up @@ -1527,6 +1552,7 @@ select results_eq(
"version": "1.0.0",
"app_version": "12.1.0",
"license": "Apache-2.0",
"has_values_schema": false,
"production_organizations_count": 1,
"ts": 1592299235,
"repository": {
Expand Down Expand Up @@ -1576,6 +1602,7 @@ select results_eq(
"version": "1.0.0",
"app_version": "12.1.0",
"deprecated": true,
"has_values_schema": false,
"signed": true,
"signatures": ["cosign"],
"all_containers_images_whitelisted": false,
Expand Down Expand Up @@ -1608,6 +1635,7 @@ select results_eq(
"version": "1.0.0",
"app_version": "12.1.0",
"license": "Apache-2.0",
"has_values_schema": false,
"production_organizations_count": 1,
"ts": 1592299235,
"repository": {
Expand Down Expand Up @@ -1655,6 +1683,7 @@ select results_eq(
"version": "1.0.0",
"app_version": "12.1.0",
"deprecated": true,
"has_values_schema": false,
"signed": true,
"signatures": ["cosign"],
"all_containers_images_whitelisted": false,
Expand Down Expand Up @@ -1726,6 +1755,7 @@ select results_eq(
"version": "1.0.0",
"app_version": "12.1.0",
"license": "Apache-2.0",
"has_values_schema": false,
"production_organizations_count": 1,
"ts": 1592299235,
"repository": {
Expand Down Expand Up @@ -1851,6 +1881,7 @@ select results_eq(
"version": "1.0.0",
"app_version": "12.1.0",
"deprecated": true,
"has_values_schema": false,
"signed": true,
"signatures": ["cosign"],
"all_containers_images_whitelisted": false,
Expand Down Expand Up @@ -1883,6 +1914,7 @@ select results_eq(
"version": "1.0.0",
"app_version": "12.1.0",
"license": "Apache-2.0",
"has_values_schema": false,
"production_organizations_count": 1,
"ts": 1592299235,
"repository": {
Expand Down Expand Up @@ -1929,6 +1961,7 @@ select results_eq(
"version": "1.0.0",
"app_version": "12.1.0",
"deprecated": true,
"has_values_schema": false,
"signed": true,
"signatures": ["cosign"],
"all_containers_images_whitelisted": false,
Expand Down Expand Up @@ -1961,6 +1994,7 @@ select results_eq(
"version": "1.0.0",
"app_version": "12.1.0",
"license": "Apache-2.0",
"has_values_schema": false,
"production_organizations_count": 1,
"ts": 1592299235,
"repository": {
Expand Down Expand Up @@ -2009,6 +2043,7 @@ select results_eq(
"version": "1.0.0",
"app_version": "12.1.0",
"license": "Apache-2.0",
"has_values_schema": false,
"production_organizations_count": 1,
"ts": 1592299235,
"repository": {
Expand Down Expand Up @@ -2036,6 +2071,7 @@ select results_eq(
"version": "1.0.0",
"app_version": "12.1.0",
"deprecated": true,
"has_values_schema": false,
"signed": true,
"signatures": ["cosign"],
"all_containers_images_whitelisted": false,
Expand Down

0 comments on commit f83b553

Please sign in to comment.