pr-report-core 0.0.6 → 0.1.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/dist/labels.d.mts +18 -0
- package/dist/labels.d.mts.map +1 -1
- package/dist/labels.mjs +18 -0
- package/dist/labels.mjs.map +1 -1
- package/dist/report.d.mts.map +1 -1
- package/dist/report.mjs +2 -2
- package/dist/report.mjs.map +1 -1
- package/dist/start-after.d.mts +32 -7
- package/dist/start-after.d.mts.map +1 -1
- package/dist/start-after.mjs +20 -1
- package/dist/start-after.mjs.map +1 -1
- package/package.json +5 -5
- package/src/labels.mts +20 -0
- package/src/report.mts +4 -3
- package/src/report.test.mts +40 -0
- package/src/start-after.mts +47 -8
- package/src/start-after.test.mts +54 -7
package/dist/labels.d.mts
CHANGED
|
@@ -69,4 +69,22 @@ export declare const PRIORITY_MID_LABEL = "priority:mid";
|
|
|
69
69
|
* `unblock-prs`: what is held is simply not labelled `merge-queued`.
|
|
70
70
|
*/
|
|
71
71
|
export declare const PENDING_LABEL = "pending";
|
|
72
|
+
/**
|
|
73
|
+
* The label that says someone has started an issue, before there is a pull
|
|
74
|
+
* request to say so. `start-issue` puts it on, and refuses an issue that
|
|
75
|
+
* already carries it, so that two sessions do not pick up the same one; the
|
|
76
|
+
* Pull Requests Manager page and `pr-report` show a startable issue carrying
|
|
77
|
+
* it as in progress, as they show one an open pull request closes
|
|
78
|
+
* (`start-after.mts`'s `progressOf`). Nothing takes it off when the work
|
|
79
|
+
* merges: the issue closes, and the label with it stops mattering.
|
|
80
|
+
*/
|
|
81
|
+
export declare const IN_PROGRESS_LABEL = "in-progress";
|
|
82
|
+
/**
|
|
83
|
+
* The label that says someone means to start an issue next. It holds nothing
|
|
84
|
+
* back — `start-issue` takes it off as it puts {@link IN_PROGRESS_LABEL} on —
|
|
85
|
+
* and only tells whoever is choosing what to start that this one is spoken
|
|
86
|
+
* for; the page and `pr-report` show a startable issue carrying it as
|
|
87
|
+
* planned.
|
|
88
|
+
*/
|
|
89
|
+
export declare const PLANNED_LABEL = "planned";
|
|
72
90
|
//# sourceMappingURL=labels.d.mts.map
|
package/dist/labels.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"labels.d.mts","sourceRoot":"","sources":["../src/labels.mts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,aAAa,YAAY,CAAC;AAEvC;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,iBAAiB,CAAC;AAEjD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,oBAAoB,mBAAmB,CAAC;AAErD;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,gBAAgB,CAAC;AAE/C;;;;;;;;;GASG;AACH,eAAO,MAAM,mBAAmB,kBAAkB,CAAC;AAEnD,eAAO,MAAM,kBAAkB,iBAAiB,CAAC;AAEjD;;;GAGG;AACH,eAAO,MAAM,kBAAkB,iBAAiB,CAAC;AAEjD;;;;;GAKG;AACH,eAAO,MAAM,aAAa,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"labels.d.mts","sourceRoot":"","sources":["../src/labels.mts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,aAAa,YAAY,CAAC;AAEvC;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,iBAAiB,CAAC;AAEjD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,oBAAoB,mBAAmB,CAAC;AAErD;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,gBAAgB,CAAC;AAE/C;;;;;;;;;GASG;AACH,eAAO,MAAM,mBAAmB,kBAAkB,CAAC;AAEnD,eAAO,MAAM,kBAAkB,iBAAiB,CAAC;AAEjD;;;GAGG;AACH,eAAO,MAAM,kBAAkB,iBAAiB,CAAC;AAEjD;;;;;GAKG;AACH,eAAO,MAAM,aAAa,YAAY,CAAC;AAEvC;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,gBAAgB,CAAC;AAE/C;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,YAAY,CAAC"}
|
package/dist/labels.mjs
CHANGED
|
@@ -69,4 +69,22 @@ export const PRIORITY_MID_LABEL = 'priority:mid';
|
|
|
69
69
|
|
|
70
70
|
|
|
71
71
|
export const PENDING_LABEL = 'pending';
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
export const IN_PROGRESS_LABEL = 'in-progress';
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
export const PLANNED_LABEL = 'planned';
|
|
72
90
|
//# sourceMappingURL=labels.mjs.map
|
package/dist/labels.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"labels.mjs","sourceRoot":"","sources":["../src/labels.mts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC;AAEvC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,cAAc,CAAC;AAEjD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,gBAAgB,CAAC;AAErD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAAC;AAE/C;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,eAAe,CAAC;AAEnD,MAAM,CAAC,MAAM,kBAAkB,GAAG,cAAc,CAAC;AAEjD;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,cAAc,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"labels.mjs","sourceRoot":"","sources":["../src/labels.mts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC;AAEvC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,cAAc,CAAC;AAEjD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,gBAAgB,CAAC;AAErD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAAC;AAE/C;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,eAAe,CAAC;AAEnD,MAAM,CAAC,MAAM,kBAAkB,GAAG,cAAc,CAAC;AAEjD;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,cAAc,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC;AAEvC;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAAC;AAE/C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC"}
|
package/dist/report.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.d.mts","sourceRoot":"","sources":["../src/report.mts"],"names":[],"mappings":"AAAA,yDAAyD;AAOzD,OAAO,
|
|
1
|
+
{"version":3,"file":"report.d.mts","sourceRoot":"","sources":["../src/report.mts"],"names":[],"mappings":"AAAA,yDAAyD;AAOzD,OAAO,EAML,KAAK,eAAe,EACrB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,SAAS,EACT,QAAQ,EACR,gBAAgB,EAChB,OAAO,EACP,WAAW,EAEX,QAAQ,EACT,MAAM,aAAa,CAAC;AAErB;;;;;GAKG;AACH,eAAO,MAAM,WAAW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parseMergeAfter } from './merge-after.mjs';
|
|
6
6
|
import { findStackParents } from './stack.mjs';
|
|
7
|
-
import { decideStartStates, inheritStartAfter, issuesInProgress, withProgress, } from './start-after.mjs';
|
|
7
|
+
import { decideStartStates, inheritStartAfter, issuesInProgress, progressOf, withProgress, } from './start-after.mjs';
|
|
8
8
|
import { buildMergeAfterForest } from './tree.mjs';
|
|
9
9
|
|
|
10
10
|
|
|
@@ -45,7 +45,7 @@ const reportIssues = (issues, pulls, references) => {
|
|
|
45
45
|
const worked = issuesInProgress(pulls);
|
|
46
46
|
return issues.map((issue) => ({
|
|
47
47
|
...issue,
|
|
48
|
-
start: withProgress(states.get(issue.number) ?? 'free', worked.has(issue.number)),
|
|
48
|
+
start: withProgress(states.get(issue.number) ?? 'free', progressOf(issue.labels, worked.has(issue.number))),
|
|
49
49
|
named: issue.startAfter.map((number) => ({
|
|
50
50
|
number,
|
|
51
51
|
status: statusOf(number),
|
package/dist/report.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.mjs","sourceRoot":"","sources":["../src/report.mts"],"names":[],"mappings":"AAAA,yDAAyD;AAEzD,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,GAEb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAanD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAC1B,IAAI,EACJ,aAAa,EACb,WAAW,EACX,QAAQ,EACR,aAAa,EACb,KAAK,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AC5D,OAAO,EAAE,KAAK,CAAC,aAAa;gBAC5B,6DAA6D;gBAC7D,WAAW,EAAE,KAAK,CAAC,OAAO,KAAK,aAAa;aAC7C,CAAC;SACH,CAAC;IACJ,CAAC,CAAC,CAAC;IAEL,sEAAsE;IACtE,+BAA+B;IAC/B,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,qBAAqB,CAC7C,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC;QACtC,MAAM;QACN,UAAU,EAAE,SAAS;KACtB,CAAC,CAAC,CACJ,CAAC;IAEF,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AACpC,CAAC,CAAC;AAEF,MAAM,eAAe,GAAsB;IACzC,UAAU,EAAE,IAAI,GAAG,EAA6B;IAChD,IAAI,EAAE,IAAI,GAAG,EAAU;CACf,CAAC;AAEX;;;;GAIG;AACH,MAAM,cAAc,GAAG,CACrB,YAA8C,EAC3B,EAAE,CACrB,YAAY;KACT,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,KAAK,QAAQ,CAAC;KACzC,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC"}
|
package/dist/start-after.d.mts
CHANGED
|
@@ -38,14 +38,39 @@ export type StartState = 'attention' | 'blocked' | 'cycle' | 'free' | 'ready';
|
|
|
38
38
|
*/
|
|
39
39
|
export declare const waitsFor: (body: string, blockedBy: readonly number[]) => readonly number[];
|
|
40
40
|
/**
|
|
41
|
-
* How an issue is shown: its {@link StartState}, or
|
|
42
|
-
*
|
|
43
|
-
* state in the rules (`docs/issue-start-after.md`): one that is blocked
|
|
44
|
-
* on a cycle says so whether or not someone has started it.
|
|
41
|
+
* How an issue is shown: its {@link StartState}, or how far someone has got
|
|
42
|
+
* with it when it is startable ({@link IssueProgress}). Kept apart from the
|
|
43
|
+
* start state in the rules (`docs/issue-start-after.md`): one that is blocked
|
|
44
|
+
* or on a cycle says so whether or not someone has started it.
|
|
45
45
|
*/
|
|
46
|
-
export type IssueStartState = StartState | 'in-progress';
|
|
47
|
-
/**
|
|
48
|
-
|
|
46
|
+
export type IssueStartState = StartState | 'in-progress' | 'planned';
|
|
47
|
+
/**
|
|
48
|
+
* How far someone has got with an issue, whatever it waits for:
|
|
49
|
+
*
|
|
50
|
+
* - `in-progress` — an open pull request closes it, or it is labelled
|
|
51
|
+
* `in-progress` (`labels.mts`), which is how it says so before there is one.
|
|
52
|
+
* - `planned` — it is labelled `planned`: someone means to start it next.
|
|
53
|
+
* - `none` — neither.
|
|
54
|
+
*/
|
|
55
|
+
export type IssueProgress = 'in-progress' | 'none' | 'planned';
|
|
56
|
+
/**
|
|
57
|
+
* The {@link IssueProgress} of an issue carrying `labels`, given whether an
|
|
58
|
+
* open pull request closes it. Being worked on wins over being planned: one
|
|
59
|
+
* carrying both was started without the plan being taken off.
|
|
60
|
+
*/
|
|
61
|
+
export declare const progressOf: (labels: readonly Readonly<{
|
|
62
|
+
name: string;
|
|
63
|
+
}>[], closedByOpenPull: boolean) => IssueProgress;
|
|
64
|
+
/**
|
|
65
|
+
* Whether `labels` holds `name`, whatever its case. GitHub's label names
|
|
66
|
+
* are: adding `in-progress` to a repository that has `In-Progress` puts that
|
|
67
|
+
* one on, so an exact match would not see the label it just added.
|
|
68
|
+
*/
|
|
69
|
+
export declare const hasLabel: (labels: readonly Readonly<{
|
|
70
|
+
name: string;
|
|
71
|
+
}>[], name: string) => boolean;
|
|
72
|
+
/** The {@link IssueStartState} of an issue, given how far it has got. */
|
|
73
|
+
export declare const withProgress: (state: StartState, progress: IssueProgress) => IssueStartState;
|
|
49
74
|
/** The issues an open pull request closes: the ones being worked on. */
|
|
50
75
|
export declare const issuesInProgress: (pulls: readonly Readonly<{
|
|
51
76
|
linkedIssues: readonly Readonly<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-after.d.mts","sourceRoot":"","sources":["../src/start-after.mts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"start-after.d.mts","sourceRoot":"","sources":["../src/start-after.mts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;;;;;;;;;GAUG;AACH,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;AAE3E;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;AAE9E;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,SACb,MAAM,aACD,SAAS,MAAM,EAAE,KAC3B,SAAS,MAAM,EAAuD,CAAC;AAE1E;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,aAAa,GAAG,SAAS,CAAC;AAErE;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG,aAAa,GAAG,MAAM,GAAG,SAAS,CAAC;AAE/D;;;;GAIG;AACH,eAAO,MAAM,UAAU,WACb,SAAS,QAAQ,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,EAAE,oBAC3B,OAAO,KACxB,aAKW,CAAC;AAEf;;;;GAIG;AACH,eAAO,MAAM,QAAQ,WACX,SAAS,QAAQ,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,EAAE,QACvC,MAAM,KACX,OACsE,CAAC;AAE1E,yEAAyE;AACzE,eAAO,MAAM,YAAY,UAChB,UAAU,YACP,aAAa,KACtB,eAGQ,CAAC;AAEZ,wEAAwE;AACxE,eAAO,MAAM,gBAAgB,UACpB,SAAS,QAAQ,CAAC;IACvB,YAAY,EAAE,SAAS,QAAQ,CAAC;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAC;CACvD,CAAC,EAAE,KACH,WAAW,CAAC,MAAM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.mjs
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
import { Arr } from 'ts-data-forge';
|
|
7
|
+
import { IN_PROGRESS_LABEL, PLANNED_LABEL } from './labels.mjs';
|
|
7
8
|
import { findMergeAfterCycles, parseStartAfter } from './merge-after.mjs';
|
|
8
9
|
|
|
9
10
|
|
|
@@ -14,7 +15,25 @@ import { findMergeAfterCycles, parseStartAfter } from './merge-after.mjs';
|
|
|
14
15
|
|
|
15
16
|
export const waitsFor = (body, blockedBy) => Arr.uniq(parseStartAfter(body).concat(blockedBy));
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
export const progressOf = (labels, closedByOpenPull) => closedByOpenPull || hasLabel(labels, IN_PROGRESS_LABEL)
|
|
23
|
+
? 'in-progress'
|
|
24
|
+
: hasLabel(labels, PLANNED_LABEL)
|
|
25
|
+
? 'planned'
|
|
26
|
+
: 'none';
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
export const hasLabel = (labels, name) => labels.some((label) => label.name.toLowerCase() === name.toLowerCase());
|
|
33
|
+
|
|
34
|
+
export const withProgress = (state, progress) => progress !== 'none' && (state === 'free' || state === 'ready')
|
|
35
|
+
? progress
|
|
36
|
+
: state;
|
|
18
37
|
|
|
19
38
|
export const issuesInProgress = (pulls) => new Set(pulls.flatMap(({ linkedIssues }) => linkedIssues.map(({ number }) => number)));
|
|
20
39
|
|
package/dist/start-after.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-after.mjs","sourceRoot":"","sources":["../src/start-after.mts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AA8B1E;;;;;;GA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C,CAC/C,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;gBAC3B,UAAU,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;aACjD;SACO,CAAC;IACb,CAAC,CAAC,CACH,CAAC;AACJ,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pr-report-core",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "What a GitHub merge queue driven by labels and `Merge-After:` trailers decides about the open pull requests — verdicts, merge order, stacks, owners — with no I/O, shared by the GitHub Pull Requests Manager page and the unblock-prs worker",
|
|
6
6
|
"keywords": [
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
"cspell": "10.4.0",
|
|
50
50
|
"dedent": "1.7.2",
|
|
51
51
|
"eslint": "10.13.0",
|
|
52
|
-
"eslint-config-typed": "
|
|
53
|
-
"eslint-plugin-ts-data-forge": "0.10.
|
|
54
|
-
"eslint-plugin-ts-fortress": "1.3.
|
|
55
|
-
"eslint-plugin-ts-type-forge": "0.8.
|
|
52
|
+
"eslint-config-typed": "7.1.0",
|
|
53
|
+
"eslint-plugin-ts-data-forge": "0.10.5",
|
|
54
|
+
"eslint-plugin-ts-fortress": "1.3.10",
|
|
55
|
+
"eslint-plugin-ts-type-forge": "0.8.15",
|
|
56
56
|
"jiti": "2.7.0",
|
|
57
57
|
"npm-run-all2": "9.0.4",
|
|
58
58
|
"prettier": "3.9.10",
|
package/src/labels.mts
CHANGED
|
@@ -77,3 +77,23 @@ export const PRIORITY_MID_LABEL = 'priority:mid';
|
|
|
77
77
|
* `unblock-prs`: what is held is simply not labelled `merge-queued`.
|
|
78
78
|
*/
|
|
79
79
|
export const PENDING_LABEL = 'pending';
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* The label that says someone has started an issue, before there is a pull
|
|
83
|
+
* request to say so. `start-issue` puts it on, and refuses an issue that
|
|
84
|
+
* already carries it, so that two sessions do not pick up the same one; the
|
|
85
|
+
* Pull Requests Manager page and `pr-report` show a startable issue carrying
|
|
86
|
+
* it as in progress, as they show one an open pull request closes
|
|
87
|
+
* (`start-after.mts`'s `progressOf`). Nothing takes it off when the work
|
|
88
|
+
* merges: the issue closes, and the label with it stops mattering.
|
|
89
|
+
*/
|
|
90
|
+
export const IN_PROGRESS_LABEL = 'in-progress';
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* The label that says someone means to start an issue next. It holds nothing
|
|
94
|
+
* back — `start-issue` takes it off as it puts {@link IN_PROGRESS_LABEL} on —
|
|
95
|
+
* and only tells whoever is choosing what to start that this one is spoken
|
|
96
|
+
* for; the page and `pr-report` show a startable issue carrying it as
|
|
97
|
+
* planned.
|
|
98
|
+
*/
|
|
99
|
+
export const PLANNED_LABEL = 'planned';
|
package/src/report.mts
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
decideStartStates,
|
|
10
10
|
inheritStartAfter,
|
|
11
11
|
issuesInProgress,
|
|
12
|
+
progressOf,
|
|
12
13
|
withProgress,
|
|
13
14
|
type ReferenceStatus,
|
|
14
15
|
} from './start-after.mjs';
|
|
@@ -83,8 +84,8 @@ export const buildReport = ({
|
|
|
83
84
|
|
|
84
85
|
/**
|
|
85
86
|
* Each open issue with how it stands for being started
|
|
86
|
-
* (`docs/issue-start-after.md`): its start state, or
|
|
87
|
-
*
|
|
87
|
+
* (`docs/issue-start-after.md`): its start state, or how far someone has
|
|
88
|
+
* got with it when it is startable (`progressOf`), and where each thing it
|
|
88
89
|
* names stands.
|
|
89
90
|
*/
|
|
90
91
|
const reportIssues = (
|
|
@@ -109,7 +110,7 @@ const reportIssues = (
|
|
|
109
110
|
...issue,
|
|
110
111
|
start: withProgress(
|
|
111
112
|
states.get(issue.number) ?? 'free',
|
|
112
|
-
worked.has(issue.number),
|
|
113
|
+
progressOf(issue.labels, worked.has(issue.number)),
|
|
113
114
|
),
|
|
114
115
|
named: issue.startAfter.map((number) => ({
|
|
115
116
|
number,
|
package/src/report.test.mts
CHANGED
|
@@ -379,6 +379,36 @@ describe(buildReport, () => {
|
|
|
379
379
|
|
|
380
380
|
assert.strictEqual(report.issues[0]?.start, 'attention');
|
|
381
381
|
});
|
|
382
|
+
|
|
383
|
+
test('reads the in-progress and planned labels of a startable issue', () => {
|
|
384
|
+
const report = buildReport({
|
|
385
|
+
repo: { owner: 'o', name: 'r' },
|
|
386
|
+
defaultBranch: 'main',
|
|
387
|
+
generatedAt: '2026-10-24T00:00:00Z',
|
|
388
|
+
required: [],
|
|
389
|
+
authenticated: true,
|
|
390
|
+
pulls: [],
|
|
391
|
+
merged: [],
|
|
392
|
+
mergedWithinDays: 7,
|
|
393
|
+
issues: [
|
|
394
|
+
labelled(1, [], 'in-progress'),
|
|
395
|
+
labelled(2, [], 'planned'),
|
|
396
|
+
// Blocked says so, whatever is planned for it.
|
|
397
|
+
labelled(3, [1], 'planned'),
|
|
398
|
+
],
|
|
399
|
+
issuesLimit: 30,
|
|
400
|
+
references: new Map<number, ReferenceStatus>(),
|
|
401
|
+
});
|
|
402
|
+
|
|
403
|
+
assert.deepStrictEqual(
|
|
404
|
+
report.issues.map(({ number, start }) => ({ number, start })),
|
|
405
|
+
[
|
|
406
|
+
{ number: 1, start: 'in-progress' },
|
|
407
|
+
{ number: 2, start: 'planned' },
|
|
408
|
+
{ number: 3, start: 'blocked' },
|
|
409
|
+
],
|
|
410
|
+
);
|
|
411
|
+
});
|
|
382
412
|
});
|
|
383
413
|
|
|
384
414
|
const issue = (
|
|
@@ -398,3 +428,13 @@ const issue = (
|
|
|
398
428
|
startAfter,
|
|
399
429
|
misplacedMergeAfter,
|
|
400
430
|
}) as const;
|
|
431
|
+
|
|
432
|
+
const labelled = (
|
|
433
|
+
number: number,
|
|
434
|
+
startAfter: readonly number[],
|
|
435
|
+
name: string,
|
|
436
|
+
): OpenIssue =>
|
|
437
|
+
({
|
|
438
|
+
...issue(number, startAfter),
|
|
439
|
+
labels: [{ name, color: 'cccccc', description: '' }],
|
|
440
|
+
}) as const;
|
package/src/start-after.mts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { Arr } from 'ts-data-forge';
|
|
8
|
+
import { IN_PROGRESS_LABEL, PLANNED_LABEL } from './labels.mjs';
|
|
8
9
|
import { findMergeAfterCycles, parseStartAfter } from './merge-after.mjs';
|
|
9
10
|
|
|
10
11
|
/**
|
|
@@ -48,19 +49,57 @@ export const waitsFor = (
|
|
|
48
49
|
): readonly number[] => Arr.uniq(parseStartAfter(body).concat(blockedBy));
|
|
49
50
|
|
|
50
51
|
/**
|
|
51
|
-
* How an issue is shown: its {@link StartState}, or
|
|
52
|
-
*
|
|
53
|
-
* state in the rules (`docs/issue-start-after.md`): one that is blocked
|
|
54
|
-
* on a cycle says so whether or not someone has started it.
|
|
52
|
+
* How an issue is shown: its {@link StartState}, or how far someone has got
|
|
53
|
+
* with it when it is startable ({@link IssueProgress}). Kept apart from the
|
|
54
|
+
* start state in the rules (`docs/issue-start-after.md`): one that is blocked
|
|
55
|
+
* or on a cycle says so whether or not someone has started it.
|
|
55
56
|
*/
|
|
56
|
-
export type IssueStartState = StartState | 'in-progress';
|
|
57
|
+
export type IssueStartState = StartState | 'in-progress' | 'planned';
|
|
57
58
|
|
|
58
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* How far someone has got with an issue, whatever it waits for:
|
|
61
|
+
*
|
|
62
|
+
* - `in-progress` — an open pull request closes it, or it is labelled
|
|
63
|
+
* `in-progress` (`labels.mts`), which is how it says so before there is one.
|
|
64
|
+
* - `planned` — it is labelled `planned`: someone means to start it next.
|
|
65
|
+
* - `none` — neither.
|
|
66
|
+
*/
|
|
67
|
+
export type IssueProgress = 'in-progress' | 'none' | 'planned';
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* The {@link IssueProgress} of an issue carrying `labels`, given whether an
|
|
71
|
+
* open pull request closes it. Being worked on wins over being planned: one
|
|
72
|
+
* carrying both was started without the plan being taken off.
|
|
73
|
+
*/
|
|
74
|
+
export const progressOf = (
|
|
75
|
+
labels: readonly Readonly<{ name: string }>[],
|
|
76
|
+
closedByOpenPull: boolean,
|
|
77
|
+
): IssueProgress =>
|
|
78
|
+
closedByOpenPull || hasLabel(labels, IN_PROGRESS_LABEL)
|
|
79
|
+
? 'in-progress'
|
|
80
|
+
: hasLabel(labels, PLANNED_LABEL)
|
|
81
|
+
? 'planned'
|
|
82
|
+
: 'none';
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Whether `labels` holds `name`, whatever its case. GitHub's label names
|
|
86
|
+
* are: adding `in-progress` to a repository that has `In-Progress` puts that
|
|
87
|
+
* one on, so an exact match would not see the label it just added.
|
|
88
|
+
*/
|
|
89
|
+
export const hasLabel = (
|
|
90
|
+
labels: readonly Readonly<{ name: string }>[],
|
|
91
|
+
name: string,
|
|
92
|
+
): boolean =>
|
|
93
|
+
labels.some((label) => label.name.toLowerCase() === name.toLowerCase());
|
|
94
|
+
|
|
95
|
+
/** The {@link IssueStartState} of an issue, given how far it has got. */
|
|
59
96
|
export const withProgress = (
|
|
60
97
|
state: StartState,
|
|
61
|
-
|
|
98
|
+
progress: IssueProgress,
|
|
62
99
|
): IssueStartState =>
|
|
63
|
-
|
|
100
|
+
progress !== 'none' && (state === 'free' || state === 'ready')
|
|
101
|
+
? progress
|
|
102
|
+
: state;
|
|
64
103
|
|
|
65
104
|
/** The issues an open pull request closes: the ones being worked on. */
|
|
66
105
|
export const issuesInProgress = (
|
package/src/start-after.test.mts
CHANGED
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
decideStartStates,
|
|
3
3
|
inheritStartAfter,
|
|
4
4
|
issuesInProgress,
|
|
5
|
+
progressOf,
|
|
5
6
|
referenceStatusOf,
|
|
6
7
|
waitsFor,
|
|
7
8
|
withProgress,
|
|
@@ -313,20 +314,66 @@ describe(waitsFor, () => {
|
|
|
313
314
|
});
|
|
314
315
|
|
|
315
316
|
describe(withProgress, () => {
|
|
316
|
-
test('a startable issue
|
|
317
|
-
assert.strictEqual(withProgress('free',
|
|
317
|
+
test('a startable issue someone has got to says how far', () => {
|
|
318
|
+
assert.strictEqual(withProgress('free', 'in-progress'), 'in-progress');
|
|
318
319
|
|
|
319
|
-
assert.strictEqual(withProgress('ready',
|
|
320
|
+
assert.strictEqual(withProgress('ready', 'in-progress'), 'in-progress');
|
|
320
321
|
|
|
321
|
-
assert.strictEqual(withProgress('
|
|
322
|
+
assert.strictEqual(withProgress('free', 'planned'), 'planned');
|
|
323
|
+
|
|
324
|
+
assert.strictEqual(withProgress('ready', 'none'), 'ready');
|
|
322
325
|
});
|
|
323
326
|
|
|
324
327
|
test('one that is not startable says why, worked on or not', () => {
|
|
325
|
-
assert.strictEqual(withProgress('blocked',
|
|
328
|
+
assert.strictEqual(withProgress('blocked', 'in-progress'), 'blocked');
|
|
329
|
+
|
|
330
|
+
assert.strictEqual(withProgress('cycle', 'in-progress'), 'cycle');
|
|
331
|
+
|
|
332
|
+
assert.strictEqual(withProgress('attention', 'planned'), 'attention');
|
|
333
|
+
});
|
|
334
|
+
});
|
|
335
|
+
|
|
336
|
+
describe(progressOf, () => {
|
|
337
|
+
test('an open pull request closing it is in progress', () => {
|
|
338
|
+
assert.strictEqual(progressOf([], true), 'in-progress');
|
|
339
|
+
});
|
|
340
|
+
|
|
341
|
+
test('so is the in-progress label, with no pull request yet', () => {
|
|
342
|
+
assert.strictEqual(
|
|
343
|
+
progressOf([{ name: 'bug' }, { name: 'in-progress' }], false),
|
|
344
|
+
'in-progress',
|
|
345
|
+
);
|
|
346
|
+
});
|
|
347
|
+
|
|
348
|
+
test('the planned label is planned', () => {
|
|
349
|
+
assert.strictEqual(progressOf([{ name: 'planned' }], false), 'planned');
|
|
350
|
+
});
|
|
326
351
|
|
|
327
|
-
|
|
352
|
+
test('being worked on wins over being planned', () => {
|
|
353
|
+
assert.strictEqual(progressOf([{ name: 'planned' }], true), 'in-progress');
|
|
354
|
+
|
|
355
|
+
assert.strictEqual(
|
|
356
|
+
progressOf([{ name: 'planned' }, { name: 'in-progress' }], false),
|
|
357
|
+
'in-progress',
|
|
358
|
+
);
|
|
359
|
+
});
|
|
360
|
+
|
|
361
|
+
test('neither, or a label only like them, is none', () => {
|
|
362
|
+
assert.strictEqual(progressOf([], false), 'none');
|
|
363
|
+
|
|
364
|
+
assert.strictEqual(
|
|
365
|
+
progressOf([{ name: 'in-progress-x' }, { name: 'planned-later' }], false),
|
|
366
|
+
'none',
|
|
367
|
+
);
|
|
368
|
+
});
|
|
369
|
+
|
|
370
|
+
test('reads a label whatever its case, as GitHub does', () => {
|
|
371
|
+
assert.strictEqual(
|
|
372
|
+
progressOf([{ name: 'In-Progress' }], false),
|
|
373
|
+
'in-progress',
|
|
374
|
+
);
|
|
328
375
|
|
|
329
|
-
assert.strictEqual(
|
|
376
|
+
assert.strictEqual(progressOf([{ name: 'Planned' }], false), 'planned');
|
|
330
377
|
});
|
|
331
378
|
});
|
|
332
379
|
|