From 921e83d525bc91d63839c1b34098c79ef173d541 Mon Sep 17 00:00:00 2001 From: Istvan Soos Date: Wed, 27 Nov 2024 16:46:48 +0100 Subject: [PATCH] Reduce false reporting of isBlocked packages in integrity checks. --- app/lib/shared/integrity.dart | 2 +- app/test/frontend/handlers/custom_api_test.dart | 4 ++++ app/test/frontend/handlers/documentation_test.dart | 3 +++ app/test/frontend/handlers/package_test.dart | 3 +++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/lib/shared/integrity.dart b/app/lib/shared/integrity.dart index 01569849ed..bc90eea83a 100644 --- a/app/lib/shared/integrity.dart +++ b/app/lib/shared/integrity.dart @@ -424,7 +424,7 @@ class IntegrityChecker { isModerated: p.isModerated, moderatedAt: p.moderatedAt, ); - if (p.isModerated) { + if (p.isModerated || p.isBlocked) { _packagesWithIsModeratedFlag.add(p.name!); } diff --git a/app/test/frontend/handlers/custom_api_test.dart b/app/test/frontend/handlers/custom_api_test.dart index ff5932aa32..8b197bf1e1 100644 --- a/app/test/frontend/handlers/custom_api_test.dart +++ b/app/test/frontend/handlers/custom_api_test.dart @@ -161,6 +161,10 @@ void main() { 'nextUrl': null, }, ); + + // reverting to make sure integrity check is passing + p.updateIsBlocked(isBlocked: false); + await dbService.commit(inserts: [p]); }); }); diff --git a/app/test/frontend/handlers/documentation_test.dart b/app/test/frontend/handlers/documentation_test.dart index 33f46645fd..fbaae1b687 100644 --- a/app/test/frontend/handlers/documentation_test.dart +++ b/app/test/frontend/handlers/documentation_test.dart @@ -132,6 +132,9 @@ void main() { await dbService.commit(inserts: [pkg!..updateIsBlocked(isBlocked: true)]); await expectNotFoundResponse( await issueGet('/documentation/oxygen/latest/')); + + // reverting to make sure integrity check is passing + await dbService.commit(inserts: [pkg..updateIsBlocked(isBlocked: false)]); }); }); } diff --git a/app/test/frontend/handlers/package_test.dart b/app/test/frontend/handlers/package_test.dart index 729622c138..1f0d507ad9 100644 --- a/app/test/frontend/handlers/package_test.dart +++ b/app/test/frontend/handlers/package_test.dart @@ -54,6 +54,9 @@ void main() { await issueGet('/packages/oxygen/versions/${pkg.latestVersion}')); await expectNotFoundResponse(await issueGet( '/packages/oxygen/versions/${pkg.latestVersion}/score')); + + // reverting to make sure integrity check is passing + await dbService.commit(inserts: [pkg..updateIsBlocked(isBlocked: false)]); }); testWithProfile('/packages/foobar_not_found - not found', fn: () async {