Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions app_dart/lib/src/service/scheduler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -672,10 +672,14 @@ $s
// TODO: MergeQueueHashStatus
// - .build: trigger targets!
// - .wait: something is building.
// - .completed: hash already built, complete!
// - .*: do nothing
// FOR NOW: trigger builds for build/wait
// FOR NOW: trigger builds for build/wait/completed because they are also
// building for SHA.
switch (artifactStatus) {
case MergeQueueHashStatus.build || MergeQueueHashStatus.wait
case MergeQueueHashStatus.build ||
MergeQueueHashStatus.wait ||
MergeQueueHashStatus.complete
when _config.flags.contentAwareHashing.waitOnContentHash:
// Note from codefu: We do not have the merge queue lock yet.
// It was short-circuited if the waitOnContentHash is set. The
Expand Down
34 changes: 34 additions & 0 deletions app_dart/test/service/scheduler/hash_workflow_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,40 @@ void main() async {
),
).called(1);
});

test(
'triggers tests on waitOnContentHash + completed artifacts (PRE-CAH flip over)',
() async {
config.dynamicConfig = DynamicConfig.fromJson({
'contentAwareHashing': {'waitOnContentHash': true},
});

final job = workflowJobTemplate().toWorkflowJob();

firestore.putDocument(
ContentAwareHashBuilds(
createdOn: DateTime(2025, 05, 20),
contentHash: '65038ef4984b927fd1762ef01d35c5ecc34ff5f7',
commitSha: 'a' * 40,
buildStatus: BuildStatus.success,
waitingShas: [],
),
);

await scheduler.processWorkflowJob(job);

verify(
mockGithubChecksUtil.createCheckRun(
any,
RepositorySlug.full('flutter/flutter'),
'27bfdee25949bc48044c4e16678f3449dd213b6e',
'Merge Queue Guard',
output: anyNamed('output'),
conclusion: anyNamed('conclusion'),
),
).called(1);
},
);
}

extension on String {
Expand Down