Skip to content

Commit def0ae4

Browse files
authored
Move remaining repos to ^3.9.0 and reformat (#4847)
This was blocked for a while due to the Dart beta not being code signed, but is fixed at HEAD. ```sh sed s/sdk: ^3.7.0/sdk: ^3.9.0 dart format . ```
1 parent 3359ca1 commit def0ae4

File tree

68 files changed

+786
-858
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+786
-858
lines changed

analyze/analyze.dart

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,11 @@ Future<void> run(List<String> arguments) async {
4545

4646
Future<void> verifyProtos(Directory workingDirectory) async {
4747
final errors = <String>[];
48-
final protos =
49-
await _allFiles(
50-
workingDirectory.path,
51-
'proto',
52-
minimumMatches: 1,
53-
).toList();
48+
final protos = await _allFiles(
49+
workingDirectory.path,
50+
'proto',
51+
minimumMatches: 1,
52+
).toList();
5453
for (final proto in protos) {
5554
final content = proto.readAsStringSync();
5655
if (!content.contains(RegExp(r'package\ \w+;'))) {
@@ -244,10 +243,9 @@ Future<void> _checkForNewExecutables() async {
244243
// 0b001001001
245244
const executableBitMask = 0x49;
246245
final files = await _gitFiles(cocoonRoot.path);
247-
final relativePaths =
248-
files.map<String>((File file) {
249-
return path.relative(file.path, from: cocoonRoot.path);
250-
}).toList();
246+
final relativePaths = files.map<String>((File file) {
247+
return path.relative(file.path, from: cocoonRoot.path);
248+
}).toList();
251249
for (var allowed in kExecutableAllowlist) {
252250
if (!relativePaths.contains(allowed)) {
253251
throw Exception(

analyze/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: Cocoon static analysis scripts
33
publish_to: none
44

55
environment:
6-
sdk: ^3.7.0
6+
sdk: ^3.9.0
77

88
dependencies:
99
file: 7.0.1

auto_submit/bin/server.dart

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,17 @@ Future<void> main() async {
3434
);
3535
const authProvider = CronAuthProvider();
3636

37-
final router =
38-
Router()
39-
..post('/webhook', GithubWebhook(config: config).post)
40-
..get(
41-
'/check-pull-request',
42-
CheckPullRequest(
43-
config: config,
44-
cronAuthProvider: authProvider,
45-
).run,
46-
)
47-
..get(
48-
'/check-revert-requests',
49-
CheckRevertRequest(
50-
config: config,
51-
cronAuthProvider: authProvider,
52-
).run,
53-
)
54-
..get('/readiness_check', ReadinessCheck(config: config).run);
37+
final router = Router()
38+
..post('/webhook', GithubWebhook(config: config).post)
39+
..get(
40+
'/check-pull-request',
41+
CheckPullRequest(config: config, cronAuthProvider: authProvider).run,
42+
)
43+
..get(
44+
'/check-revert-requests',
45+
CheckRevertRequest(config: config, cronAuthProvider: authProvider).run,
46+
)
47+
..get('/readiness_check', ReadinessCheck(config: config).run);
5548
await serveHandler(router.call);
5649
});
5750
}

auto_submit/lib/action/git_cli_revert_method.dart

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -86,17 +86,16 @@ class GitCliRevertMethod implements RevertMethod {
8686
pullRequestToRevert.number!,
8787
);
8888

89-
final formatter =
90-
RevertIssueBodyFormatter(
91-
slug: slug,
92-
prToRevertNumber: pullRequestToRevert.number!,
93-
initiatingAuthor: initiatingAuthor,
94-
revertReason: reasonForRevert,
95-
prToRevertAuthor: pullRequestToRevert.user!.login,
96-
prToRevertReviewers: prToRevertReviewers,
97-
prToRevertTitle: pullRequestToRevert.title,
98-
prToRevertBody: pullRequestToRevert.body,
99-
).format;
89+
final formatter = RevertIssueBodyFormatter(
90+
slug: slug,
91+
prToRevertNumber: pullRequestToRevert.number!,
92+
initiatingAuthor: initiatingAuthor,
93+
revertReason: reasonForRevert,
94+
prToRevertAuthor: pullRequestToRevert.user!.login,
95+
prToRevertReviewers: prToRevertReviewers,
96+
prToRevertTitle: pullRequestToRevert.title,
97+
prToRevertBody: pullRequestToRevert.body,
98+
).format;
10099

101100
log.info(
102101
'Attempting to create pull request with ${slug.fullName}/${gitRevertBranchName.branch}.',

auto_submit/lib/model/auto_submit_query_result.g.dart

Lines changed: 55 additions & 74 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

auto_submit/lib/requests/github_pull_request_event.g.dart

Lines changed: 6 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

auto_submit/lib/requests/github_webhook.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ class GithubWebhook extends RequestHandler {
4444
request.headers[GithubWebhook.signatureHeader] == null) {
4545
throw const BadRequestException('Missing required headers.');
4646
}
47-
final requestBytes =
48-
await request.read().expand((bodyBytes) => bodyBytes).toList();
47+
final requestBytes = await request
48+
.read()
49+
.expand((bodyBytes) => bodyBytes)
50+
.toList();
4951
final hmacSignature = request.headers[GithubWebhook.signatureHeader];
5052
if (!await _validateRequest(hmacSignature, requestBytes)) {
5153
log.info('User is forbidden');

auto_submit/lib/revert/revert_discord_message.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ class RevertDiscordMessage extends Message {
1919
String initiatingAuthor,
2020
String reasonForRevert,
2121
) {
22-
final content = '''
22+
final content =
23+
'''
2324
Pull Request [$originalPrDisplayText](<$originalPrUrl>) has been reverted by $initiatingAuthor.
2425
Please see the revert PR here: [$revertPrDisplayText](<$revertPrUrl>).
2526
Reason for reverting: $reasonForRevert''';
2627

27-
final truncatedContent =
28-
content.length <= discordMessageLength
29-
? content
30-
: '${content.substring(0, discordMessageLength - elipsesOffset)}...';
28+
final truncatedContent = content.length <= discordMessageLength
29+
? content
30+
: '${content.substring(0, discordMessageLength - elipsesOffset)}...';
3131

3232
return RevertDiscordMessage(content: truncatedContent, username: _username);
3333
}

auto_submit/lib/revert/revert_info_collection.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@ class RevertInfoCollection {
7575
// is a block of text that contain links. We want to preserve the link so we
7676
// take text after the first colon ':' to avoid destroying information with
7777
// a split.
78-
final matchedText =
79-
foundMatch.substring(foundMatch.indexOf(':') + 1).trim();
78+
final matchedText = foundMatch
79+
.substring(foundMatch.indexOf(':') + 1)
80+
.trim();
8081
return matchedText;
8182
}
8283
}

auto_submit/lib/revert/revert_issue_body_formatter.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ class RevertIssueBodyFormatter {
4444
prToRevertBody ??= 'No description provided.';
4545

4646
// Create the body for the revert issue.
47-
revertPrBody = '''
47+
revertPrBody =
48+
'''
4849
<!-- start_original_pr_link -->
4950
Reverts: $revertPrLink
5051
<!-- end_original_pr_link -->

0 commit comments

Comments
 (0)