From ac4eab287a96f42aa78bcc13db7619b5e7f0e6ef Mon Sep 17 00:00:00 2001 From: Ricardo Amador <32242716+ricardoamador@users.noreply.github.com> Date: Tue, 18 Jul 2023 17:16:26 -0700 Subject: [PATCH] Update Autosubmit github-webhook to publish to separate topics for pull requests (#2939) Add revert requests to a separate topic in pubsub. List which issues are fixed by this PR. You must list at least one issue. Part of https://github.com/flutter/flutter/issues/113867 *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].* --- auto_submit/lib/requests/github_webhook.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/auto_submit/lib/requests/github_webhook.dart b/auto_submit/lib/requests/github_webhook.dart index adb372614..beb0e2611 100644 --- a/auto_submit/lib/requests/github_webhook.dart +++ b/auto_submit/lib/requests/github_webhook.dart @@ -65,8 +65,11 @@ class GithubWebhook extends RequestHandler { hasAutosubmit = pullRequest.labels!.any((label) => label.name == Config.kAutosubmitLabel); hasRevertLabel = pullRequest.labels!.any((label) => label.name == Config.kRevertLabel); - if (hasAutosubmit || hasRevertLabel) { - log.info('Found pull request with auto submit and/or revert label.'); + if (hasRevertLabel) { + log.info('Found pull request with revert label.'); + await pubsub.publish(config.pubsubRevertRequestTopic, pullRequest); + } else if (hasAutosubmit) { + log.info('Found pull request with autosubmit label.'); await pubsub.publish(config.pubsubPullRequestTopic, pullRequest); }