Skip to content

Commit

Permalink
Log pull request for autosubmit triage (#1988)
Browse files Browse the repository at this point in the history
  • Loading branch information
keyonghan authored Jul 18, 2022
1 parent b6282f2 commit 7e4d967
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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');
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

0 comments on commit 7e4d967

Please sign in to comment.