Skip to content

Commit

Permalink
Reduce false reporting of isBlocked packages in integrity checks. (#8341
Browse files Browse the repository at this point in the history
)
  • Loading branch information
isoos committed Nov 29, 2024
1 parent 806b8de commit d40f2ae
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/lib/shared/integrity.dart
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ class IntegrityChecker {
isModerated: p.isModerated,
moderatedAt: p.moderatedAt,
);
if (p.isModerated) {
if (p.isModerated || p.isBlocked) {
_packagesWithIsModeratedFlag.add(p.name!);
}

Expand Down
4 changes: 4 additions & 0 deletions app/test/frontend/handlers/custom_api_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
});
});

Expand Down
3 changes: 3 additions & 0 deletions app/test/frontend/handlers/documentation_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,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)]);
});
});
}
3 changes: 3 additions & 0 deletions app/test/frontend/handlers/package_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit d40f2ae

Please sign in to comment.