do not reRequest CheckRun - #5142
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the handling of dashboard checks. It moves the logic for resetting dashboard checks to neutral from the scheduler (which now ignores re-run requests for these checks) to the LuciBuildService when the presubmit guard has no failed jobs. The review feedback recommends explicitly setting the check run status to completed when updating it to a neutral conclusion to comply with GitHub API requirements, along with updating the corresponding test verifications.
| await _githubChecksUtil.updateCheckRun( | ||
| _config, | ||
| slug, | ||
| dashboardChecks, | ||
| conclusion: CheckRunConclusion.neutral, | ||
| output: const CheckRunOutput( | ||
| title: Config.kDashboardCheckName, | ||
| summary: Scheduler.kDashboardChecksDescription, | ||
| ), | ||
| ); |
There was a problem hiding this comment.
When updating a check run with a conclusion (such as CheckRunConclusion.neutral), GitHub API requires the status to be set to completed. Explicitly passing status: CheckRunStatus.completed avoids potential API validation errors or unexpected behavior.
| await _githubChecksUtil.updateCheckRun( | |
| _config, | |
| slug, | |
| dashboardChecks, | |
| conclusion: CheckRunConclusion.neutral, | |
| output: const CheckRunOutput( | |
| title: Config.kDashboardCheckName, | |
| summary: Scheduler.kDashboardChecksDescription, | |
| ), | |
| ); | |
| await _githubChecksUtil.updateCheckRun( | |
| _config, | |
| slug, | |
| dashboardChecks, | |
| status: CheckRunStatus.completed, | |
| conclusion: CheckRunConclusion.neutral, | |
| output: const CheckRunOutput( | |
| title: Config.kDashboardCheckName, | |
| summary: Scheduler.kDashboardChecksDescription, | |
| ), | |
| ); |
| verify( | ||
| mockCheckRunsService.reRequestCheckRun( | ||
| mockGithubChecksUtil.updateCheckRun( | ||
| any, | ||
| RepositorySlug.full('flutter/flutter'), | ||
| checkRunId: 1234, | ||
| checkRunGuard, | ||
| conclusion: CheckRunConclusion.neutral, | ||
| output: const CheckRunOutput( | ||
| title: Config.kDashboardCheckName, | ||
| summary: Scheduler.kDashboardChecksDescription, | ||
| ), | ||
| ), | ||
| ).called(1); |
There was a problem hiding this comment.
Update the test verification to match the explicit status: CheckRunStatus.completed parameter added to the updateCheckRun call.
verify(
mockGithubChecksUtil.updateCheckRun(
any,
RepositorySlug.full('flutter/flutter'),
checkRunGuard,
status: CheckRunStatus.completed,
conclusion: CheckRunConclusion.neutral,
output: const CheckRunOutput(
title: Config.kDashboardCheckName,
summary: Scheduler.kDashboardChecksDescription,
),
),
).called(1);
attempt to solve mysterious merge without unlocked merge queue guard
flutter/flutter#191610