next-issue 6.6.122 → 6.6.124
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/README.md +6 -1
- package/dist/pending.mjs +28 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -348,7 +348,12 @@ keeps the commits, so taking the `skip` label off later resumes the issue
|
|
|
348
348
|
and checks them. Such a resume is not held back
|
|
349
349
|
by another halted issue while it only checks its commit already on the
|
|
350
350
|
base; a fix it has to land waits like any other change. The hand-over
|
|
351
|
-
comment says so.
|
|
351
|
+
comment says so. A halted issue that was deleted or moved to another
|
|
352
|
+
repository can no longer be answered or given up, so the next run that gets
|
|
353
|
+
a not-found error when it reads the issue releases it the same way: it drops
|
|
354
|
+
the halt from the state, keeps the commits and logs a `land.released` event
|
|
355
|
+
with the reason `issue not found`. Any other read error (for example a
|
|
356
|
+
network error) keeps the block for that run.
|
|
352
357
|
|
|
353
358
|
The fixer sees the findings of all earlier rounds, not only the last one, with
|
|
354
359
|
its own disputes next to them. From round two, the reviewer judges only the
|
package/dist/pending.mjs
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import { message } from './errors.mjs';
|
|
2
|
-
import { readState, savedIssues } from './state.mjs';
|
|
3
|
-
import { blocksLanding } from './unsettled.mjs';
|
|
1
|
+
import { errorMatches, message } from './errors.mjs';
|
|
2
|
+
import { readState, savedIssues, writeState } from './state.mjs';
|
|
3
|
+
import { blocksLanding, heldOnBase } from './unsettled.mjs';
|
|
4
|
+
/**
|
|
5
|
+
* What `gh issue view` says for an issue that was deleted or moved to another repository. Its GraphQL
|
|
6
|
+
* `repository.issue` lookup does not follow a transfer (only REST does), so a moved issue fails like a deleted one.
|
|
7
|
+
*/
|
|
8
|
+
const ISSUE_GONE = /Could not resolve to an issue or pull request|HTTP 404/;
|
|
4
9
|
export async function pendingIssues(context) {
|
|
5
10
|
const { repo, config, ports } = context;
|
|
6
11
|
const { ready, inProgress, inReview } = config.labels;
|
|
@@ -52,9 +57,26 @@ async function savedIssue(context, number) {
|
|
|
52
57
|
return { open, issue: { ...issue, closed: true } };
|
|
53
58
|
}
|
|
54
59
|
catch (error) {
|
|
55
|
-
context.recorder
|
|
56
|
-
|
|
57
|
-
|
|
60
|
+
const log = context.recorder.scope({ issue: number });
|
|
61
|
+
log.event('issue.unreadable', { error: message(error) }, 'quiet');
|
|
62
|
+
if (saved !== 'broken' && errorMatches(error, ISSUE_GONE)) {
|
|
63
|
+
await releaseGone(context, saved);
|
|
64
|
+
}
|
|
58
65
|
return { open: false };
|
|
59
66
|
}
|
|
60
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* A halted issue that was deleted or moved never resumes or gets the skip label, so its halt would block every
|
|
70
|
+
* landing for good: drop it like a given-up issue. The state keeps what is on the base. A passing read failure
|
|
71
|
+
* (a network error) keeps the halt.
|
|
72
|
+
*/
|
|
73
|
+
async function releaseGone(context, saved) {
|
|
74
|
+
if (!blocksLanding(saved, context.base)) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
delete saved.halted;
|
|
78
|
+
await writeState(context.repo, saved);
|
|
79
|
+
context.recorder
|
|
80
|
+
.scope({ issue: saved.issue })
|
|
81
|
+
.event('land.released', { held: heldOnBase(saved, context.base), reason: 'issue not found' });
|
|
82
|
+
}
|