-
Notifications
You must be signed in to change notification settings - Fork 100
[scheduler] ci.yaml check run #1229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| request.headers.set('X-GitHub-Event', 'pull_request'); | ||
| }); | ||
|
|
||
| test('Exception is raised when no builders available', () async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is no longer true as there's always at least one check we generate on presubmit
| commitSha: commitSha, | ||
| ); | ||
| } catch (e) { | ||
| exception = e; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we log this exception?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should also only catch a more specific type of Exception, rather than everything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a log.
We could catch FormatException and HttpException for ci.yaml related issues, but I figured if there's an issue in scheduling the LUCI builds (anywhere), we should mark it as failed. That way people will retry the presubmit instead of having a forever pending checkrun. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to catch on FormatException. If another exception fails, this will leave the ci.yaml validation as pending.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will the exception bubbling up lead to a stronger signal that monitoring will detect? If not, then I suppose there's no advantage to disambiguating FormatExceptions.
| ); | ||
| } else { | ||
| // Failure when validating ci.yaml | ||
| await githubChecksService.githubChecksUtil.updateCheckRun( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can move this part to the catch section and remove the if - then - else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
catch blocks cannot be async which is why this is separated
| // Update validate ci.yaml check | ||
| if (exception == null) { | ||
| // Success in validating ci.yaml | ||
| await githubChecksService.githubChecksUtil.updateCheckRun( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add this to the end of the try block and remove the if - then else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is separate to minimize the code the try block deals with (only scheduler config validation + schedule builds), otherwise we would silently fail on quota issues
This adds a check to all Cocoon scheduled presubmits that validates the ci.yaml + validates all builds were scheduled.
If
.ci.yamldoes not exist, it will pass as it uses an emptySchedulerConfig.Issues
flutter/flutter#82303