Skip to content

Commit ccecd2b

Browse files
authored
Makes 'unexpected engineArtifacts' an error. (#4515)
This is effectively an unreachable error case, and does not appear in our logs. Closes flutter/flutter#166795.
1 parent 1234c2c commit ccecd2b

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

app_dart/lib/src/service/luci_build_service.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,10 +306,8 @@ class LuciBuildService {
306306
}
307307
} else if (engineArtifacts is! UnnecessaryEngineArtifacts) {
308308
// This is an error case, as we're setting artifacts for a PR that will never use them.
309-
log.warn(
309+
throw StateError(
310310
'Unexpected engineArtifacts were specified for PR#${pullRequest.number} (${pullRequest.head!.sha})',
311-
null,
312-
StackTrace.current,
313311
);
314312
}
315313

app_dart/test/service/luci_build_service/schedule_try_builds_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,8 @@ void main() {
278278
await luci.scheduleTryBuilds(
279279
pullRequest: pullRequest,
280280
targets: [buildTarget],
281-
engineArtifacts: EngineArtifacts.usingExistingEngine(
282-
commitSha: pullRequest.base!.sha!,
281+
engineArtifacts: const EngineArtifacts.noFrameworkTests(
282+
reason: 'Not a flutter/flutter PR',
283283
),
284284
);
285285

0 commit comments

Comments
 (0)