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

Log pull request for autosubmit triage #1988

Merged
merged 1 commit into from
Jul 18, 2022
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
4 changes: 2 additions & 2 deletions auto_submit/lib/requests/check_pull_request.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ class CheckPullRequest extends AuthenticatedRequestHandler {
final String messageData = message.message!.data!;
final rawBody = json.decode(String.fromCharCodes(base64.decode(messageData))) as Map<String, dynamic>;
final PullRequest pullRequest = PullRequest.fromJson(rawBody);
log.info('Processing PR: $pullRequest');
log.info('Processing PR: $rawBody');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably go through the github library and add toString methods to these objects.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created an issue from github repo: SpinlockLabs/github.dart#323

if (processingLog.contains(pullRequest.number)) {
// Ack duplicate.
log.info('Ack the duplicated message : ${message.ackId!}.');
await pubsub.acknowledge('auto-submit-queue-sub', message.ackId!);
continue;
} else {
await approver.approve(pullRequest);
log.info('Approved pull request: $pullRequest');
log.info('Approved pull request: $rawBody');
processingLog.add(pullRequest.number!);
}
futures.add(validationService.processMessage(pullRequest, message.ackId!, pubsub));
Expand Down
2 changes: 1 addition & 1 deletion auto_submit/lib/service/validation_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class ValidationService {
/// Processes a pub/sub message associated with PullRequest event.
Future<void> processMessage(github.PullRequest messagePullRequest, String ackId, PubSub pubsub) async {
if (!await shouldProcess(messagePullRequest)) {
log.info('Shout not process $messagePullRequest, and ack the message.');
log.info('Shout not process ${messagePullRequest.toJson()}, and ack the message.');
await pubsub.acknowledge('auto-submit-queue-sub', ackId);
return;
}
Expand Down