Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce false reporting of isBlocked packages in integrity checks. #8341

Merged
merged 1 commit into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -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)]);
});
});
}
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