Don't mark dashboard checks as neutral on rerun. - #5154
Conversation
This is causing some PRs to autosubmit with failing checks. Ideally, we'd actually rerun failed checks when this is clicked. For now, we should make this a no-op.
There was a problem hiding this comment.
Code Review
This pull request simplifies the scheduler logic in scheduler.dart by grouping Config.kDashboardCheckName with Config.kMergeQueueLockName to ignore re-run requests, removing the previous try-catch block that reset dashboard checks to neutral. The review feedback recommends enhancing null safety by replacing repeated null assertion operators (!) with null-safe navigation (?.) to prevent potential runtime crashes.
| final checkSuiteId = checkRunEvent.checkRun!.checkSuite!.id!; | ||
| log.debug( | ||
| '$logCrumb: Requested re-run of "$name" for ' | ||
| '$slug / $checkSuiteId - ignoring', | ||
| ); | ||
| success = true; |
There was a problem hiding this comment.
To adhere to defensive programming and Dart's null safety best practices, avoid using the null assertion operator (!) repeatedly (e.g., checkRunEvent.checkRun!.checkSuite!.id!). If any of these fields are unexpectedly null (for example, in unit tests or due to API changes), it will cause a runtime crash. Instead, use null-safe navigation (?.) and handle the null case gracefully.
| final checkSuiteId = checkRunEvent.checkRun!.checkSuite!.id!; | |
| log.debug( | |
| '$logCrumb: Requested re-run of "$name" for ' | |
| '$slug / $checkSuiteId - ignoring', | |
| ); | |
| success = true; | |
| final checkSuiteId = checkRunEvent.checkRun?.checkSuite?.id; | |
| if (checkSuiteId == null) { | |
| log.warn('$logCrumb: Requested re-run of "$name" but checkSuiteId was null'); | |
| return const ProcessCheckRunResult.success(); | |
| } | |
| log.debug( | |
| '$logCrumb: Requested re-run of "$name" for ' | |
| '$slug / $checkSuiteId - ignoring', | |
| ); | |
| success = true; |
Is this code path just failing currently (and being caught by the try catch)? |
|
After discussing offline: the code path in question just kicks off a |
ievdokdm
left a comment
There was a problem hiding this comment.
LGTM
with that change developers no longer would be able to add autosubmit label for PR where all failed check-runs were re-run requested in flutter/flutter#191005
This is causing some PRs to autosubmit with failing checks. Ideally, we'd actually rerun failed checks when this is clicked. For now, we should make this a no-op.
This should address the main issue with flutter/flutter#191610 for now.