Skip to content

Attempt to fix libc++ actions runner restarter. #120627

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

Merged
merged 2 commits into from
Jan 21, 2025
Merged
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
37 changes: 30 additions & 7 deletions .github/workflows/libcxx-restart-preempted-jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ jobs:
check_run_id: check_run_id
})

// For temporary debugging purposes to see the structure of the annotations.
console.print(annotations);

has_failed_job = false;
saved_failure_message = null;

for (annotation of annotations.data) {
if (annotation.annotation_level != 'failure') {
continue;
Expand All @@ -106,15 +112,32 @@ jobs:

const failure_match = annotation.message.match(failure_regex);
if (failure_match != null) {
// We only want to restart the workflow if all of the failures were due to preemption.
// We don't want to restart the workflow if there were other failures.
core.notice('Choosing not to rerun workflow because we found a non-preemption failure' +
'Failure message: "' + annotation.message + '"');
await create_check_run('skipped', 'Choosing not to rerun workflow because we found a non-preemption failure\n'
+ 'Failure message: ' + annotation.message)
return;
has_failed_job = true;
saved_failure_message = annotation.message;
}
}
if (has_failed_job && (! has_preempted_job)) {
// We only want to restart the workflow if all of the failures were due to preemption.
// We don't want to restart the workflow if there were other failures.
//
// However, libcxx runners running inside docker containers produce both a preemption message and failure message.
//
// The desired approach is to ignore failure messages which appear on the same job as a preemption message
// (An job is a single run with a specific configuration, ex generic-gcc, gcc-14).
//
// However, it's unclear that this code achieves the desired approach, and it may ignore all failures
// if a preemption message is found at all on any run.
//
// For now, it's more important to restart preempted workflows than to avoid restarting workflows with
// non-preemption failures.
//
// TODO Figure this out.
core.notice('Choosing not to rerun workflow because we found a non-preemption failure' +
'Failure message: "' + saved_failure_message + '"');
await create_check_run('skipped', 'Choosing not to rerun workflow because we found a non-preemption failure\n'
+ 'Failure message: ' + saved_failure_message)
return;
}
}

if (!has_preempted_job) {
Expand Down
Loading