feat(suppression): automatically unsuppress and re-suppress tests on GitHub issue events - #5126
Conversation
…GitHub issue events - Add IssueService and wire it to GithubWebhookSubscription to handle GitHub 'issues' webhook events. - Automatically unsuppress tests when an associated GitHub issue is closed. - Automatically re-suppress tests when an associated GitHub issue is reopened. - Add TestSuppression.canonicalizeIssueUrl to sanitize user input (stripping fragments, query params, subpaths, and trailing slashes) into canonical GitHub issue URLs on ingress. - Add unit and webhook integration tests for IssueService, TestSuppression, and UpdateSuppressedTest.
There was a problem hiding this comment.
Code Review
This pull request introduces IssueService to automatically unsuppress or re-suppress tests when their associated GitHub issues are closed or reopened, integrating it with the GitHub webhook subscription. It also adds URL canonicalization for GitHub issue links to strip trailing slashes, query parameters, and fragments. The review feedback highlights several improvement opportunities: expanding URL canonicalization to support www.github.com (along with adding tests), canonicalizing the issue URL directly from the webhook payload, and adding defensive checks to prevent potential crashes when parsing invalid repository names.
eyebrowsoffire
left a comment
There was a problem hiding this comment.
This looks good to me. The one thing that crosses my mind right now is that we had to introduce serialized handling of PR webhooks, and I'm wondering if that will be necessary for the issue handlers as well. As of right now, it seems like this is probably safe to handle in parallel though.
Yeah, I don't think so - unsuppressing or suppressing actions are idempotent actions and we don't deal wtih any scheduled in these handlers. Something to keep an eye out for though . |
fixes: flutter/flutter#188030 only if we update the webhook.