pr-report-core 0.2.0 → 0.3.0
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 +5 -2
- package/dist/branch-rules.d.mts +30 -0
- package/dist/branch-rules.d.mts.map +1 -0
- package/dist/branch-rules.mjs +71 -0
- package/dist/branch-rules.mjs.map +1 -0
- package/dist/checks.d.mts +61 -62
- package/dist/checks.d.mts.map +1 -1
- package/dist/checks.mjs +0 -1
- package/dist/checks.mjs.map +1 -1
- package/dist/claim.d.mts +21 -15
- package/dist/claim.d.mts.map +1 -1
- package/dist/claim.mjs +1 -1
- package/dist/claim.mjs.map +1 -1
- package/dist/closing-issues.d.mts +18 -19
- package/dist/closing-issues.d.mts.map +1 -1
- package/dist/closing-issues.mjs +0 -1
- package/dist/closing-issues.mjs.map +1 -1
- package/dist/code-owners.d.mts +33 -34
- package/dist/code-owners.d.mts.map +1 -1
- package/dist/code-owners.mjs +0 -2
- package/dist/code-owners.mjs.map +1 -1
- package/dist/index.d.mts +3 -0
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +3 -0
- package/dist/index.mjs.map +1 -1
- package/dist/issue-claim.d.mts +56 -0
- package/dist/issue-claim.d.mts.map +1 -0
- package/dist/issue-claim.mjs +87 -0
- package/dist/issue-claim.mjs.map +1 -0
- package/dist/issue-priority.d.mts +44 -0
- package/dist/issue-priority.d.mts.map +1 -0
- package/dist/issue-priority.mjs +91 -0
- package/dist/issue-priority.mjs.map +1 -0
- package/dist/labels.d.mts +43 -42
- package/dist/labels.d.mts.map +1 -1
- package/dist/labels.mjs +2 -1
- package/dist/labels.mjs.map +1 -1
- package/dist/merge-after.d.mts +22 -16
- package/dist/merge-after.d.mts.map +1 -1
- package/dist/merge-after.mjs +87 -24
- package/dist/merge-after.mjs.map +1 -1
- package/dist/queue-comments.d.mts +2 -2
- package/dist/queue-order.d.mts +32 -32
- package/dist/queue-order.mjs +0 -2
- package/dist/queue-order.mjs.map +1 -1
- package/dist/queue-owner.d.mts +14 -14
- package/dist/queue-owner.d.mts.map +1 -1
- package/dist/queue-owner.mjs +18 -0
- package/dist/queue-owner.mjs.map +1 -1
- package/dist/report.d.mts +4 -4
- package/dist/review-hold.d.mts +14 -14
- package/dist/ruleset.d.mts +12 -13
- package/dist/ruleset.d.mts.map +1 -1
- package/dist/ruleset.mjs +0 -1
- package/dist/ruleset.mjs.map +1 -1
- package/dist/set-aside.d.mts +29 -28
- package/dist/set-aside.d.mts.map +1 -1
- package/dist/set-aside.mjs +2 -0
- package/dist/set-aside.mjs.map +1 -1
- package/dist/stack.d.mts +14 -15
- package/dist/stack.d.mts.map +1 -1
- package/dist/stack.mjs +0 -1
- package/dist/stack.mjs.map +1 -1
- package/dist/start-after.d.mts +20 -21
- package/dist/start-after.d.mts.map +1 -1
- package/dist/start-after.mjs +0 -1
- package/dist/start-after.mjs.map +1 -1
- package/dist/summarize.d.mts +2 -2
- package/dist/timestamp.d.mts +10 -10
- package/dist/tree.d.mts +5 -5
- package/dist/types.d.mts +32 -33
- package/dist/types.d.mts.map +1 -1
- package/package.json +10 -10
- package/src/branch-rules.mts +105 -0
- package/src/branch-rules.test.mts +221 -0
- package/src/checks.mts +64 -65
- package/src/checks.test.mts +30 -31
- package/src/claim.mts +16 -16
- package/src/closing-issues.mts +18 -19
- package/src/closing-issues.test.mts +2 -2
- package/src/code-owners.mts +39 -41
- package/src/index.mts +3 -0
- package/src/issue-claim.mts +138 -0
- package/src/issue-claim.test.mts +149 -0
- package/src/issue-priority.mts +116 -0
- package/src/issue-priority.test.mts +71 -0
- package/src/labels.mts +43 -42
- package/src/merge-after.mts +142 -49
- package/src/merge-after.test.mts +80 -3
- package/src/queue-comments.mts +2 -2
- package/src/queue-order.mts +60 -62
- package/src/queue-order.test.mts +6 -6
- package/src/queue-owner.mts +46 -25
- package/src/queue-owner.test.mts +4 -2
- package/src/report.mts +9 -9
- package/src/review-hold.mts +14 -14
- package/src/review-hold.test.mts +3 -3
- package/src/ruleset.mts +12 -13
- package/src/set-aside.mts +30 -28
- package/src/set-aside.test.mts +22 -0
- package/src/stack.mts +14 -15
- package/src/stack.test.mts +4 -4
- package/src/start-after.mts +20 -21
- package/src/summarize.mts +2 -2
- package/src/timestamp.mts +14 -14
- package/src/tree.mts +5 -5
- package/src/types.mts +32 -33
package/dist/merge-after.mjs
CHANGED
|
@@ -11,14 +11,16 @@ import { Arr, Num, Result } from 'ts-data-forge';
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
|
|
15
14
|
const NUMBER_REF = /(?<![\w./-])#(?<number>\d+)\b/gu;
|
|
16
15
|
const DECLARATION_LINE = {
|
|
17
16
|
'merge-after': /^[^\S\n]*merge-after[^\S\n]*:(?<refs>[^\n]*)$/gimu,
|
|
18
17
|
'start-after': /^[^\S\n]*start-after[^\S\n]*:(?<refs>[^\n]*)$/gimu,
|
|
19
18
|
};
|
|
20
19
|
|
|
21
|
-
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
const FENCE_LINE = /^[^\S\n]*(?<marker>`{3,}|~{3,})(?<rest>[^\n]*)$/u;
|
|
22
24
|
|
|
23
25
|
|
|
24
26
|
|
|
@@ -49,14 +51,33 @@ export const parseStartAfter = (body) => parseDeclaration(body, 'start-after');
|
|
|
49
51
|
|
|
50
52
|
|
|
51
53
|
export const outsideCodeFences = (body) => {
|
|
52
|
-
|
|
54
|
+
|
|
55
|
+
let mut_openedBy = undefined;
|
|
53
56
|
return body
|
|
54
57
|
.split('\n')
|
|
55
58
|
.map((line) => {
|
|
56
|
-
|
|
57
|
-
|
|
59
|
+
const fence = FENCE_LINE.exec(line)?.groups;
|
|
60
|
+
const marker = fence?.['marker'];
|
|
61
|
+
const rest = fence?.['rest'] ?? '';
|
|
62
|
+
if (mut_openedBy === undefined) {
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
if (marker === undefined ||
|
|
66
|
+
(marker.startsWith('`') && rest.includes('`'))) {
|
|
67
|
+
return line;
|
|
68
|
+
}
|
|
69
|
+
mut_openedBy = marker;
|
|
70
|
+
return '';
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
if (marker !== undefined &&
|
|
76
|
+
marker.at(0) === mut_openedBy.at(0) &&
|
|
77
|
+
marker.length >= mut_openedBy.length &&
|
|
78
|
+
rest.trim() === '') {
|
|
79
|
+
mut_openedBy = undefined;
|
|
58
80
|
}
|
|
59
|
-
mut_inFence = !mut_inFence;
|
|
60
81
|
return '';
|
|
61
82
|
})
|
|
62
83
|
.join('\n');
|
|
@@ -73,30 +94,30 @@ export const outsideCodeFences = (body) => {
|
|
|
73
94
|
|
|
74
95
|
|
|
75
96
|
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
76
103
|
export const findMergeAfterCycles = (dependencies) => {
|
|
77
|
-
const
|
|
104
|
+
const mut_covered = new Set();
|
|
78
105
|
const mut_cycles = new Map();
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
106
|
+
for (const node of dependencies.keys()) {
|
|
107
|
+
if (mut_covered.has(node)) {
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
82
110
|
|
|
83
111
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
if (mut_finished.has(node)) {
|
|
89
|
-
return;
|
|
112
|
+
const cycle = shortestCycleThrough(node, dependencies);
|
|
113
|
+
if (cycle === undefined) {
|
|
114
|
+
continue;
|
|
90
115
|
}
|
|
91
|
-
for (const
|
|
92
|
-
|
|
116
|
+
for (const member of cycle) {
|
|
117
|
+
mut_covered.add(member);
|
|
93
118
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
mut_finished.add(node);
|
|
97
|
-
};
|
|
98
|
-
for (const node of dependencies.keys()) {
|
|
99
|
-
visit(node, []);
|
|
119
|
+
const rotated = rotateToLowest(cycle);
|
|
120
|
+
mut_cycles.set(rotated.join(','), rotated);
|
|
100
121
|
}
|
|
101
122
|
return Array.from(mut_cycles.values());
|
|
102
123
|
};
|
|
@@ -113,6 +134,48 @@ const parseDeclaration = (body, key) => Arr.uniq(outsideCodeFences(body)
|
|
|
113
134
|
return Result.isOk(parsed) ? [parsed.value] : [];
|
|
114
135
|
}))
|
|
115
136
|
.toArray());
|
|
137
|
+
|
|
138
|
+
const pathFromStart = (start, end, reachedFrom) => {
|
|
139
|
+
const mut_reversed = [end];
|
|
140
|
+
let mut_node = end;
|
|
141
|
+
while (mut_node !== start) {
|
|
142
|
+
const previous = reachedFrom.get(mut_node);
|
|
143
|
+
if (previous === undefined) {
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
mut_reversed.push(previous);
|
|
147
|
+
mut_node = previous;
|
|
148
|
+
}
|
|
149
|
+
return mut_reversed.toReversed();
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
const shortestCycleThrough = (start, dependencies) => {
|
|
156
|
+
|
|
157
|
+
const mut_reachedFrom = new Map();
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
let mut_frontier = [start];
|
|
161
|
+
while (Arr.isNonEmpty(mut_frontier)) {
|
|
162
|
+
const mut_nextFrontier = [];
|
|
163
|
+
for (const node of mut_frontier) {
|
|
164
|
+
for (const next of dependencies.get(node) ?? []) {
|
|
165
|
+
if (next === start) {
|
|
166
|
+
return pathFromStart(start, node, mut_reachedFrom);
|
|
167
|
+
}
|
|
168
|
+
if (mut_reachedFrom.has(next)) {
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
mut_reachedFrom.set(next, node);
|
|
172
|
+
mut_nextFrontier.push(next);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
mut_frontier = mut_nextFrontier;
|
|
176
|
+
}
|
|
177
|
+
return undefined;
|
|
178
|
+
};
|
|
116
179
|
const rotateToLowest = (cycle) => {
|
|
117
180
|
if (!Arr.isNonEmpty(cycle)) {
|
|
118
181
|
return cycle;
|
package/dist/merge-after.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge-after.mjs","sourceRoot":"","sources":["../src/merge-after.mts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEjD
|
|
1
|
+
{"version":3,"file":"merge-after.mjs","sourceRoot":"","sources":["../src/merge-after.mts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEjD;;;;;;GAMG;AACH,MAAM,UAAU,GAAG,iCAAiC,CAAC;AAErD,MAAM,gBAAgB,GAAG;IACvB,aAAa,EAAE,mDAAmD;IAClE,aAAa,EAAE,mDAAmD;CAC1D,CAAC;AAEX;;;GAGG;AACH,MAAM,UAAU,GAAG,kDAAkD,CAAC;AAEtE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,IAAY,EAAqB,EAAE,CACjE,gBAAgB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;AAExC;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,IAAY,EAAqB,EAAE,CACjE,gBAAgB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;AAExC;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,IAAY,EAAU,EAAE;IACxD,mEAAmE;IACnE,IAAI,YAAY,GAAuB,SAAS,CAAC;IAEjD,OAAO,IAAI;SACR,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACZ,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAE5C,MAAM,MAAM,GAAG,KA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c,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -30,8 +30,8 @@ export type QueueComment<A> = Readonly<{
|
|
|
30
30
|
applies: boolean;
|
|
31
31
|
}>;
|
|
32
32
|
/**
|
|
33
|
-
* Reads `comments`, oldest first, for the oldest comment of each kind: each
|
|
34
|
-
*
|
|
33
|
+
* Reads `comments`, oldest first, for the oldest comment of each kind: each is
|
|
34
|
+
* one comment edited in place, and of several the oldest is the one.
|
|
35
35
|
*/
|
|
36
36
|
export declare const readQueueComments: (comments: readonly OwnComment[], state: Readonly<{
|
|
37
37
|
headSha: string;
|
package/dist/queue-order.d.mts
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* Where each pull request stands in `unblock-prs`'s queue, and the order the
|
|
3
3
|
* worker picks the ones it may pick.
|
|
4
4
|
*
|
|
5
|
-
* The worker decides on someone's machine, from what `gh` and `git` return,
|
|
6
|
-
*
|
|
5
|
+
* The worker decides on someone's machine, from what `gh` and `git` return, and
|
|
6
|
+
* the Pull Requests Manager page draws the same queue from what GraphQL
|
|
7
7
|
* returns. So the deciding is here, once, over facts either side can supply,
|
|
8
8
|
* and each side does only its own reading: the worker reads some facts only
|
|
9
9
|
* when the answer needs them — the checks of a `BLOCKED` pull request, the
|
|
10
|
-
* native stack of one without auto-merge — which is why
|
|
11
|
-
*
|
|
10
|
+
* native stack of one without auto-merge — which is why {@link queueStanding}
|
|
11
|
+
* asks for them rather than taking them all up front.
|
|
12
12
|
*
|
|
13
13
|
* What the worker alone knows is left out: which pull requests one run has
|
|
14
14
|
* demoted (`demotions.mts` in `unblock-prs`) lives in that run's memory, so
|
|
@@ -26,8 +26,8 @@ export type QueueFacts = Readonly<{
|
|
|
26
26
|
headRef: string;
|
|
27
27
|
baseRef: string;
|
|
28
28
|
/**
|
|
29
|
-
* GitHub's `mergeStateStatus` — `BEHIND`, `DIRTY`, `CLEAN`, `BLOCKED` and
|
|
30
|
-
*
|
|
29
|
+
* GitHub's `mergeStateStatus` — `BEHIND`, `DIRTY`, `CLEAN`, `BLOCKED` and so
|
|
30
|
+
* on — or as near to it as the reader can tell.
|
|
31
31
|
*/
|
|
32
32
|
mergeState: string;
|
|
33
33
|
autoMerge: boolean;
|
|
@@ -43,8 +43,8 @@ export type QueueGraphMember = Readonly<{
|
|
|
43
43
|
baseRef: string;
|
|
44
44
|
fromFork: boolean;
|
|
45
45
|
/**
|
|
46
|
-
* The open issues it closes, whose `Start-After:` it inherits. Absent for
|
|
47
|
-
*
|
|
46
|
+
* The open issues it closes, whose `Start-After:` it inherits. Absent for a
|
|
47
|
+
* reader that did not read them: nothing is inherited.
|
|
48
48
|
*/
|
|
49
49
|
closes?: readonly number[];
|
|
50
50
|
}>;
|
|
@@ -53,8 +53,8 @@ export type QueueGraph = Readonly<{
|
|
|
53
53
|
/** Which open pull request each stacked one is on: child → parent. */
|
|
54
54
|
stackParents: ReadonlyMap<number, number>;
|
|
55
55
|
/**
|
|
56
|
-
* What each pull request must merge after: what it declared, the one it
|
|
57
|
-
*
|
|
56
|
+
* What each pull request must merge after: what it declared, the one it is
|
|
57
|
+
* stacked on, and what it inherits.
|
|
58
58
|
*/
|
|
59
59
|
dependencies: ReadonlyMap<number, readonly number[]>;
|
|
60
60
|
/**
|
|
@@ -168,9 +168,9 @@ export type QueueStanding = Readonly<{
|
|
|
168
168
|
/** The branch `changesets/action` opens the version pull request from. */
|
|
169
169
|
export declare const versionBranchName: (defaultBranch: string) => string;
|
|
170
170
|
/**
|
|
171
|
-
* Whether a pull request from `headRef` is the version pull request. The
|
|
172
|
-
*
|
|
173
|
-
*
|
|
171
|
+
* Whether a pull request from `headRef` is the version pull request. The branch
|
|
172
|
+
* is the only stable handle on it: the title and body are rewritten on every
|
|
173
|
+
* run, and the number changes with every release.
|
|
174
174
|
*/
|
|
175
175
|
export declare const isVersionBranch: (headRef: string, defaultBranch: string) => boolean;
|
|
176
176
|
/**
|
|
@@ -184,8 +184,8 @@ export declare const isSafeRefName: (name: string) => boolean;
|
|
|
184
184
|
export declare const isMergeableState: (mergeState: string) => boolean;
|
|
185
185
|
/**
|
|
186
186
|
* The stacks, the declared order and its cycles, and what holds the release,
|
|
187
|
-
* read off the open pull requests. `startAfterOf` is what the issues they
|
|
188
|
-
*
|
|
187
|
+
* read off the open pull requests. `startAfterOf` is what the issues they close
|
|
188
|
+
* declare, each issue's `Start-After:` by its number.
|
|
189
189
|
*/
|
|
190
190
|
export declare const queueGraph: (pulls: readonly QueueGraphMember[], defaultBranch: string, startAfterOf?: ReadonlyMap<number, readonly number[]>) => QueueGraph;
|
|
191
191
|
/**
|
|
@@ -194,23 +194,23 @@ export declare const queueGraph: (pulls: readonly QueueGraphMember[], defaultBra
|
|
|
194
194
|
*/
|
|
195
195
|
export declare const queueStanding: (pr: QueueFacts, context: QueueContext, reads?: QueueReads) => QueueStanding;
|
|
196
196
|
/**
|
|
197
|
-
* Whether what {@link queueStanding} decided is worth asking the review
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
*
|
|
197
|
+
* Whether what {@link queueStanding} decided is worth asking the review about:
|
|
198
|
+
* one about to be picked, or one about to be watched while GitHub still calls
|
|
199
|
+
* it `BLOCKED`. A merge state GitHub already calls mergeable is its own answer
|
|
200
|
+
* that nothing but the checks is left.
|
|
201
201
|
*/
|
|
202
202
|
export declare const asksReview: (standing: QueueStanding, mergeState: string) => boolean;
|
|
203
203
|
/**
|
|
204
204
|
* The standing once the review is known: a hold that waits for someone holds
|
|
205
|
-
* it; one that only a bypass merges, and none at all, change nothing here —
|
|
206
|
-
*
|
|
205
|
+
* it; one that only a bypass merges, and none at all, change nothing here — the
|
|
206
|
+
* worker leaves the first unarmed, which is not a question of order.
|
|
207
207
|
*/
|
|
208
208
|
export declare const withReviewHold: (standing: QueueStanding, mergeState: string, hold: ReviewHold | undefined) => QueueStanding;
|
|
209
209
|
export type QueuePriority = 'high' | 'low' | 'none' | 'both';
|
|
210
210
|
/**
|
|
211
|
-
* Which priority label a pull request carries: `both` is the two at once,
|
|
212
|
-
*
|
|
213
|
-
*
|
|
211
|
+
* Which priority label a pull request carries: `both` is the two at once, which
|
|
212
|
+
* contradict each other and so count as neither. `priority:mid` is the same as
|
|
213
|
+
* neither here.
|
|
214
214
|
*/
|
|
215
215
|
export declare const priorityOfLabels: (labels: readonly string[]) => QueuePriority;
|
|
216
216
|
/**
|
|
@@ -223,15 +223,15 @@ export declare const priorityRankOfLabels: (labels: readonly string[]) => 0 | 1
|
|
|
223
223
|
* ruleset bypass merges ({@link ReviewHold}): that one ranks with
|
|
224
224
|
* `priority:low` unless labelled `priority:high` — alone, since the two
|
|
225
225
|
* together count as neither. Picked, it is released, goes green and is set
|
|
226
|
-
* aside for a person, so the cycle spent on it lands nothing; picked last,
|
|
227
|
-
*
|
|
228
|
-
*
|
|
226
|
+
* aside for a person, so the cycle spent on it lands nothing; picked last, it
|
|
227
|
+
* still has its checks run. `priority:high` is a person saying they want that
|
|
228
|
+
* verdict now, and is the one way to ask for it, so it still counts.
|
|
229
229
|
*/
|
|
230
230
|
export declare const pickPriorityRank: (labels: readonly string[], bypass: boolean) => 0 | 1 | 2;
|
|
231
231
|
/**
|
|
232
|
-
* The order the worker picks candidates in. The declared order has already
|
|
233
|
-
*
|
|
234
|
-
*
|
|
232
|
+
* The order the worker picks candidates in. The declared order has already been
|
|
233
|
+
* applied, as a gate rather than a sort, so this is lowest number first within
|
|
234
|
+
* these ranks, outermost first:
|
|
235
235
|
*
|
|
236
236
|
* 1. What a watch has seen green and still open (`demoted`) goes after
|
|
237
237
|
* everything else, the release and `priority:high` included: everything
|
|
@@ -249,8 +249,8 @@ export declare const pickPriorityRank: (labels: readonly string[], bypass: boole
|
|
|
249
249
|
* release: it only says that when a queued change and the release are
|
|
250
250
|
* both ready, the change goes first.
|
|
251
251
|
*
|
|
252
|
-
* `toSorted` is stable, so each sort keeps the order of the one before it
|
|
253
|
-
*
|
|
252
|
+
* `toSorted` is stable, so each sort keeps the order of the one before it among
|
|
253
|
+
* equals, and the last one is the outermost.
|
|
254
254
|
*/
|
|
255
255
|
export declare const orderCandidates: <P>(candidates: readonly P[], factsOf: (candidate: P) => QueueFacts, context: Readonly<{
|
|
256
256
|
defaultBranch: string;
|
package/dist/queue-order.mjs
CHANGED
|
@@ -268,7 +268,6 @@ export const orderCandidates = (candidates, factsOf, context) => {
|
|
|
268
268
|
|
|
269
269
|
|
|
270
270
|
|
|
271
|
-
|
|
272
271
|
const hasLabel = (pr, name) => pr.labels.includes(name);
|
|
273
272
|
|
|
274
273
|
const outOfScopeReason = (pr, context) => {
|
|
@@ -283,7 +282,6 @@ const outOfScopeReason = (pr, context) => {
|
|
|
283
282
|
|
|
284
283
|
|
|
285
284
|
|
|
286
|
-
|
|
287
285
|
return pr.isDraft
|
|
288
286
|
? 'draft'
|
|
289
287
|
: pr.baseRef !== context.defaultBranch &&
|
package/dist/queue-order.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue-order.mjs","sourceRoot":"","sources":["../src/queue-order.mts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,GACd,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAG1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAqItD,0EAA0E;AAC1E,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,aAAqB,EAAU,EAAE,CACjE,qBAAqB,aAAa,EAAW,CAAC;AAEhD;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,OAAe,EACf,aAAq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EAAE,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE;YACzC,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY;gBACnB,CAAC,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE;gBAC3B,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,aAAa,CAAC;oBAC3B,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE;oBACvB,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC5B,CAAC,CAAC"}
|
package/dist/queue-owner.d.mts
CHANGED
|
@@ -2,26 +2,26 @@
|
|
|
2
2
|
* Who is to move each pull request in the queue next: the worker
|
|
3
3
|
* (`pnpm run unblock-prs`), a skill, a person, or — which is a bug — nobody.
|
|
4
4
|
*
|
|
5
|
-
* The worker and the `/unblock-prs` skill move the same queue side by side
|
|
6
|
-
*
|
|
5
|
+
* The worker and the `/unblock-prs` skill move the same queue side by side and
|
|
6
|
+
* cannot see each other. Each used to decide for itself whether a
|
|
7
7
|
* set-aside still stood, from its own reading of the tip of the default
|
|
8
|
-
* branch, and when the two readings differed each left the pull request to
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* branch, and when the two readings differed each left the pull request to the
|
|
9
|
+
* other (#2267). So the answer is decided here, once, and every reader asks
|
|
10
|
+
* this function: the worker before it acts, `pr-report` for the skill,
|
|
11
11
|
* `claim-pr` before it lets a claim be written, and `report-unowned-prs` to
|
|
12
12
|
* turn `none` into an issue.
|
|
13
13
|
*
|
|
14
14
|
* **It reads the comments and the pull request, never the tip of the base.**
|
|
15
|
-
* The set-aside comment is the hand-off: it stands until the worker rewrites
|
|
16
|
-
*
|
|
15
|
+
* The set-aside comment is the hand-off: it stands until the worker rewrites it
|
|
16
|
+
* as resolved — when the head moves, when a retry is asked for, or, for a
|
|
17
17
|
* reason tied to the base, when the base moves and the worker takes the pull
|
|
18
|
-
* request back to try again. Until then it is the skill's or a person's, and
|
|
19
|
-
*
|
|
18
|
+
* request back to try again. Until then it is the skill's or a person's, and a
|
|
19
|
+
* worker that has stopped running leaves it so rather than nobody's.
|
|
20
20
|
*
|
|
21
21
|
* **Every reason the worker sets aside for has an owner**
|
|
22
22
|
* ({@link setAsideOwner}, exhaustive over {@link SET_ASIDE_REASONS}), so `none`
|
|
23
|
-
* is only ever a combination nothing here expected: a reason this module
|
|
24
|
-
*
|
|
23
|
+
* is only ever a combination nothing here expected: a reason this module does
|
|
24
|
+
* not know, written by a worker newer than the reader.
|
|
25
25
|
*/
|
|
26
26
|
import { type ClaimComment } from './claim.mjs';
|
|
27
27
|
import type { QueueComments } from './queue-comments.mjs';
|
|
@@ -30,8 +30,8 @@ import type { ReportEntry } from './types.mjs';
|
|
|
30
30
|
export declare const QUEUE_OWNERS: readonly ['worker', 'skill', 'human', 'none'];
|
|
31
31
|
/**
|
|
32
32
|
* `skill` is the `/unblock-prs` skill, which fixes every queued pull request
|
|
33
|
-
* the worker sets aside — a branch the repository generates included, which
|
|
34
|
-
*
|
|
33
|
+
* the worker sets aside — a branch the repository generates included, which it
|
|
34
|
+
* builds again rather than rebases (`generatedBranches` in
|
|
35
35
|
* `.github/unblock-prs.json`).
|
|
36
36
|
*/
|
|
37
37
|
export type QueueOwner = Readonly<{
|
|
@@ -39,7 +39,7 @@ export type QueueOwner = Readonly<{
|
|
|
39
39
|
reason: string;
|
|
40
40
|
}>;
|
|
41
41
|
/** Every reason the worker writes into a set-aside comment. */
|
|
42
|
-
export declare const SET_ASIDE_REASONS: readonly ['already-in-base', 'arm-failed', 'awaiting-bypass', 'checks-failed', 'not-merging', 'push-failed', 'rebase-failed', 'unlabel-failed', 'watch-timeout'];
|
|
42
|
+
export declare const SET_ASIDE_REASONS: readonly ['already-in-base', 'arm-failed', 'awaiting-bypass', 'checks-failed', 'checks-not-started', 'head-out-of-sync', 'not-merging', 'push-failed', 'read-failed', 'rebase-failed', 'unlabel-failed', 'watch-timeout'];
|
|
43
43
|
export type SetAsideReason = (typeof SET_ASIDE_REASONS)[number];
|
|
44
44
|
/**
|
|
45
45
|
* Who moves `pr` next, or `undefined` for a pull request the queue does not
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue-owner.d.mts","sourceRoot":"","sources":["../src/queue-owner.mts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAM9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAY,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,eAAO,MAAM,YAAY,YAAI,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAU,CAAC;AAE1E;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;IAC7C,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC,CAAC;AAEH,+DAA+D;AAC/D,eAAO,MAAM,iBAAiB,YAC5B,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,eAAe,CACP,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE;;;GAGG;AACH,eAAO,MAAM,UAAU,OAAQ,eAAe,KAAG,UAAU,GAAG,SAoE7D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,UACrB,WAAW,YACR,aAAa,WACd,QAAQ,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,SAAS,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAAC;IACvC,UAAU,EAAE,MAAM,CAAC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AAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAAC;IACvC,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC,KACD,UAAU,GAAG,SAeZ,CAAC;AAEL,eAAO,MAAM,gBAAgB,WAAY,MAAM,KAAG,MAAM,IAAI,cACjC,CAAC;AAgF5B,4DAA4D;AAC5D,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,iEAAiE;IACjE,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,gDAAgD;IAChD,OAAO,EAAE,OAAO,CAAC;IACjB,gEAAgE;IAChE,QAAQ,EAAE,eAAe,GAAG,SAAS,CAAC;IACtC,wDAAwD;IACxD,KAAK,EAAE,YAAY,GAAG,SAAS,CAAC;IAChC,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC,CAAC"}
|
package/dist/queue-owner.mjs
CHANGED
|
@@ -33,8 +33,11 @@ export const SET_ASIDE_REASONS = [
|
|
|
33
33
|
'arm-failed',
|
|
34
34
|
'awaiting-bypass',
|
|
35
35
|
'checks-failed',
|
|
36
|
+
'checks-not-started',
|
|
37
|
+
'head-out-of-sync',
|
|
36
38
|
'not-merging',
|
|
37
39
|
'push-failed',
|
|
40
|
+
'read-failed',
|
|
38
41
|
'rebase-failed',
|
|
39
42
|
'unlabel-failed',
|
|
40
43
|
'watch-timeout',
|
|
@@ -143,11 +146,26 @@ const setAsideOwner = (reason) => {
|
|
|
143
146
|
owner: 'human',
|
|
144
147
|
why: 'green, and only a ruleset bypass merges it',
|
|
145
148
|
};
|
|
149
|
+
case 'checks-not-started':
|
|
150
|
+
return {
|
|
151
|
+
owner: 'human',
|
|
152
|
+
why: 'GitHub started no run for a required check on its head; the base moving puts it back in the queue to be rebased in its turn, and a new commit pushed to the branch starts the checks sooner',
|
|
153
|
+
};
|
|
154
|
+
case 'head-out-of-sync':
|
|
155
|
+
return {
|
|
156
|
+
owner: 'human',
|
|
157
|
+
why: 'GitHub never took in the last push to its branch, so it still shows an older head; push to the branch again, or close and reopen it',
|
|
158
|
+
};
|
|
146
159
|
case 'not-merging':
|
|
147
160
|
return {
|
|
148
161
|
owner: 'human',
|
|
149
162
|
why: 'green but not merging; something the worker cannot read holds it',
|
|
150
163
|
};
|
|
164
|
+
case 'read-failed':
|
|
165
|
+
return {
|
|
166
|
+
owner: 'human',
|
|
167
|
+
why: 'its checks or its base could not be read survey after survey; the comment says what failed',
|
|
168
|
+
};
|
|
151
169
|
case 'push-failed':
|
|
152
170
|
return {
|
|
153
171
|
owner: 'human',
|
package/dist/queue-owner.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue-owner.mjs","sourceRoot":"","sources":["../src/queue-owner.mts"],"names":[],"mappings":"AAAA,iCAAiC;AAEjC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,YAAY,EAAqB,MAAM,aAAa,CAAC;AAC9D,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,GACd,MAAM,cAAc,CAAC;AAKtB,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAU,CAAC;AAa1E,+DAA+D;AAC/D,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,iBAAiB;IACjB,YAAY;IACZ,iBAAiB;IACjB,eAAe;IACf,aAAa;IACb,aAAa;IACb,eAAe;IACf,gBAAgB;IAChB,eAAe;CACP,CAAC;AAIX;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EAAmB,EAA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EAAE,CAAC,QAAQ;QACX,CAAC,CAAC,kDAAkD;QACpD,CAAC,CAAC,EAAE,CAAC,OAAO;YACV,CAAC,CAAC,yDAAyD;YAC3D,CAAC,CAAC,EAAE,CAAC,OAAO,KAAK,EAAE,CAAC,aAAa,IAAI,EAAE,CAAC,SAAS,KAAK,SAAS;gBAC7D,CAAC,CAAE,YAAY,EAAE,CAAC,OAAO,aAAa,EAAE,CAAC,aAAa,iDAA2D;gBACjH,CAAC,CAAC,SAAS,CAAC;AAEtB;;;;GAIG;AACH,MAAM,YAAY,GAAG,CACnB,EAAmB,EACnB,MAAsB,EACtB,MAAe,EACK,EAAE,CACtB,EAAE,CAAC,OAAO,KAAK,qBAAqB,EAAE,CAAC,aAAa,EAAE;IACpD,CAAC,CAAC,yEAAyE;IAC3E,CAAC,CAAC,MAAM,KAAK,eAAe,IAAI,CAAC,MAAM;QACrC,CAAC,CAAC,mDAAmD;QACrD,CAAC,CAAC,SAAS,CAAC"}
|
package/dist/report.d.mts
CHANGED
|
@@ -4,8 +4,8 @@ import type { IssueDeclarations, MergedPullRequest, OpenIssue, PrReport, PullReq
|
|
|
4
4
|
/**
|
|
5
5
|
* Reads the declared merge order and the check verdicts out of the facts.
|
|
6
6
|
*
|
|
7
|
-
* Nothing here talks to GitHub, which is what lets the whole shape of a
|
|
8
|
-
*
|
|
7
|
+
* Nothing here talks to GitHub, which is what lets the whole shape of a report
|
|
8
|
+
* be tested against a handful of literals.
|
|
9
9
|
*/
|
|
10
10
|
export declare const buildReport: ({ repo, defaultBranch, generatedAt, required, authenticated, pulls, merged, mergedWithinDays, issues, issuesLimit, issueDeclarations, references, }: Readonly<{
|
|
11
11
|
repo: RepoRef;
|
|
@@ -34,8 +34,8 @@ export declare const buildReport: ({ repo, defaultBranch, generatedAt, required,
|
|
|
34
34
|
export declare const buildEntries: ({ required, defaultBranch, pulls, issues, skipCiPauses, }: Readonly<{
|
|
35
35
|
/**
|
|
36
36
|
* The contexts the ruleset requires, or `undefined` for a repository that
|
|
37
|
-
* declares none: each pull request is then judged over every context
|
|
38
|
-
*
|
|
37
|
+
* declares none: each pull request is then judged over every context reported
|
|
38
|
+
* on its head.
|
|
39
39
|
*/
|
|
40
40
|
required: readonly string[] | undefined;
|
|
41
41
|
defaultBranch: string;
|
package/dist/review-hold.d.mts
CHANGED
|
@@ -5,18 +5,18 @@
|
|
|
5
5
|
* `main`'s ruleset asks for two things no check reports: an approval from a
|
|
6
6
|
* code owner of every owned path the pull request touches, and every review
|
|
7
7
|
* conversation resolved. A queued pull request missing either goes green and
|
|
8
|
-
* sits there, and a rebase cannot change that. Released anyway, it costs a
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
8
|
+
* sits there, and a rebase cannot change that. Released anyway, it costs a full
|
|
9
|
+
* matrix and holds the queue for the length of a watch; and because `main`
|
|
10
|
+
* moving is what puts it back in the running, it would be rebased and run again
|
|
11
|
+
* every time anything else merged. So triage reads both before picking, and
|
|
12
|
+
* leaves a pull request they hold in the queue with a note, until an approval
|
|
13
|
+
* or a resolved conversation changes the answer.
|
|
14
14
|
*
|
|
15
15
|
* Except when nothing can change it: GitHub does not let an author approve
|
|
16
16
|
* their own pull request, so one whose waiting paths only its author owns
|
|
17
|
-
* merges by a ruleset bypass or not at all. Holding that one would hold it
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* merges by a ruleset bypass or not at all. Holding that one would hold it for
|
|
18
|
+
* ever, with `skip-ci` on and no verdict for whoever makes the bypass merge to
|
|
19
|
+
* go by. So it is released and watched like any other, with
|
|
20
20
|
* auto-merge left off — it could never fire — until its checks report, and
|
|
21
21
|
* then left for that person (`awaiting-bypass`).
|
|
22
22
|
*
|
|
@@ -46,11 +46,11 @@ export type ReviewRules = Readonly<{
|
|
|
46
46
|
codeOwners: readonly CodeOwnersRule[];
|
|
47
47
|
}>;
|
|
48
48
|
/**
|
|
49
|
-
* What the review does to the pull request: `held` waits for an approval or
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
49
|
+
* What the review does to the pull request: `held` waits for an approval or a
|
|
50
|
+
* resolved conversation, `bypass` waits for nobody — only its author owns what
|
|
51
|
+
* is waiting — and `undefined` holds nothing. What cannot be told for sure —
|
|
52
|
+
* changed files past what could be read — holds nothing: the watch still
|
|
53
|
+
* catches a pull request that goes green and does not merge, and
|
|
54
54
|
* `demotions.mts` is what follows.
|
|
55
55
|
*/
|
|
56
56
|
export type ReviewHold = Readonly<{
|