next-issue 6.6.106 → 6.6.107
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gate.mjs +13 -1
- package/package.json +1 -1
package/dist/gate.mjs
CHANGED
|
@@ -16,7 +16,7 @@ export async function checkGate(job, sha) {
|
|
|
16
16
|
}
|
|
17
17
|
catch (error) {
|
|
18
18
|
if (job.mainBroken) {
|
|
19
|
-
return
|
|
19
|
+
return unreadFixChecks(job, error);
|
|
20
20
|
}
|
|
21
21
|
return unreadChecks(job, error);
|
|
22
22
|
}
|
|
@@ -141,6 +141,18 @@ async function unreadChecks(job, error) {
|
|
|
141
141
|
job.state.halted = true;
|
|
142
142
|
return escalateAndFinish(job, `The read of the checks on ${base} failed: ${sentence(message(error))} The landed commit is on \`${base}\`, and its checks were not awaited. ${HALT_NOTE}`, 'checks error');
|
|
143
143
|
}
|
|
144
|
+
/** A broken base whose checks cannot be read is reverted; while the revert fails, the halt stays saved. */
|
|
145
|
+
async function unreadFixChecks(job, error) {
|
|
146
|
+
if (runStopped()) {
|
|
147
|
+
throw error;
|
|
148
|
+
}
|
|
149
|
+
const { context, state } = job;
|
|
150
|
+
state.halted = true;
|
|
151
|
+
await writeState(context.repo, state);
|
|
152
|
+
const reverted = await revertOrReport(job);
|
|
153
|
+
const halt = state.halted === true ? ` ${HALT_NOTE}` : '';
|
|
154
|
+
return escalateAndFinish(job, `The read of the checks on ${context.base} failed: ${sentence(message(error))}${reverted}${halt}`, 'checks error');
|
|
155
|
+
}
|
|
144
156
|
export async function escalateError(job, error, note, reason) {
|
|
145
157
|
if (runStopped()) {
|
|
146
158
|
throw error;
|