next-issue 6.6.74 → 6.6.75

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.
@@ -66,11 +66,12 @@ export function waitForBaseChecks(repo, sha, options) {
66
66
  watch: async () => baseState(checks),
67
67
  }, options);
68
68
  }
69
- export async function rerunFailedBase(repo, sha) {
69
+ export async function rerunFailedBase(repo, sha, started = () => { }) {
70
70
  const failed = (await baseRuns(repo, sha)).filter(failedRun);
71
71
  for (const entry of failed) {
72
72
  await gh(repo, ['run', 'rerun', String(entry.databaseId), '--failed']);
73
73
  }
74
+ started();
74
75
  await waitForRestart(repo, sha, failed);
75
76
  return failed.map((entry) => String(entry.databaseId));
76
77
  }
package/dist/gate.mjs CHANGED
@@ -43,13 +43,25 @@ async function rerunOnce(job, sha, checks) {
43
43
  if (checks !== 'fail' || state.rerun === sha) {
44
44
  return checks;
45
45
  }
46
+ const before = state.rerun;
46
47
  state.rerun = sha;
47
48
  await writeState(context.repo, state);
49
+ let started = false;
48
50
  try {
49
- const runs = await context.ports.rerunFailedBase(context.repo, sha);
51
+ const runs = await context.ports.rerunFailedBase(context.repo, sha, () => {
52
+ started = true;
53
+ });
50
54
  log.event('main-checks.rerun', { sha, runs });
51
55
  }
52
56
  catch (error) {
57
+ if (runStopped()) {
58
+ if (started) {
59
+ throw error;
60
+ }
61
+ state.rerun = before;
62
+ await writeState(context.repo, state);
63
+ throw error;
64
+ }
53
65
  log.event('main-checks.rerun-failed', { sha, error: asError(error).message });
54
66
  return checks;
55
67
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-issue",
3
- "version": "6.6.74",
3
+ "version": "6.6.75",
4
4
  "description": "Autonomous issue harness driven by the pi SDK",
5
5
  "keywords": [
6
6
  "github",