92
92
check_run_id: check_run_id
93
93
})
94
94
95
+ // For temporary debugging purposes to see the structure of the annotations.
96
+ console.print(annotations);
97
+
98
+ has_failed_job = false;
99
+ saved_failure_message = null;
100
+
95
101
for (annotation of annotations.data) {
96
102
if (annotation.annotation_level != 'failure') {
97
103
continue;
@@ -106,15 +112,32 @@ jobs:
106
112
107
113
const failure_match = annotation.message.match(failure_regex);
108
114
if (failure_match != null) {
109
- // We only want to restart the workflow if all of the failures were due to preemption.
110
- // We don't want to restart the workflow if there were other failures.
111
- core.notice('Choosing not to rerun workflow because we found a non-preemption failure' +
112
- 'Failure message: "' + annotation.message + '"');
113
- await create_check_run('skipped', 'Choosing not to rerun workflow because we found a non-preemption failure\n'
114
- + 'Failure message: ' + annotation.message)
115
- return;
115
+ has_failed_job = true;
116
+ saved_failure_message = annotation.message;
116
117
}
117
118
}
119
+ if (has_failed_job && (! has_preempted_job)) {
120
+ // We only want to restart the workflow if all of the failures were due to preemption.
121
+ // We don't want to restart the workflow if there were other failures.
122
+ //
123
+ // However, libcxx runners running inside docker containers produce both a preemption message and failure message.
124
+ //
125
+ // The desired approach is to ignore failure messages which appear on the same job as a preemption message
126
+ // (An job is a single run with a specific configuration, ex generic-gcc, gcc-14).
127
+ //
128
+ // However, it's unclear that this code achieves the desired approach, and it may ignore all failures
129
+ // if a preemption message is found at all on any run.
130
+ //
131
+ // For now, it's more important to restart preempted workflows than to avoid restarting workflows with
132
+ // non-preemption failures.
133
+ //
134
+ // TODO Figure this out.
135
+ core.notice('Choosing not to rerun workflow because we found a non-preemption failure' +
136
+ 'Failure message: "' + saved_failure_message + '"');
137
+ await create_check_run('skipped', 'Choosing not to rerun workflow because we found a non-preemption failure\n'
138
+ + 'Failure message: ' + saved_failure_message)
139
+ return;
140
+ }
118
141
}
119
142
120
143
if (!has_preempted_job) {
0 commit comments