@kud/gh 0.7.1 → 0.8.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/health.d.ts +1 -0
- package/dist/health.d.ts.map +1 -1
- package/dist/health.js +44 -4
- package/dist/health.js.map +1 -1
- package/package.json +1 -1
package/dist/health.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ export type PrHealthData = {
|
|
|
28
28
|
};
|
|
29
29
|
export declare const isFailCheck: (c: PrCheck) => boolean;
|
|
30
30
|
export declare const isPendingCheck: (c: PrCheck) => boolean;
|
|
31
|
+
export declare const isInconclusiveCheck: (c: PrCheck) => boolean;
|
|
31
32
|
export declare const isPassCheck: (c: PrCheck) => boolean;
|
|
32
33
|
export declare const latestChecks: (checks: PrCheck[]) => PrCheck[];
|
|
33
34
|
export type ComputeHealthInput = {
|
package/dist/health.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../src/health.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,MAAM,GACd,SAAS,GACT,UAAU,GACV,aAAa,GACb,SAAS,GACT,SAAS,GACT,UAAU,GACV,SAAS,GACT,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,MAAM,CAAA;AAMV,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG;IAAE,MAAM,EAAE;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AQ,EAAE,CAAA;IACnB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,SAAS,EAAE,MAAM,CAAA;IACjB,gBAAgB,EAAE,MAAM,CAAA;IACxB,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;CACjC,CAAA;AAiCD,eAAO,MAAM,WAAW,GAAI,GAAG,OAAO,KAAG,OAKpB,CAAA;AAErB,eAAO,MAAM,cAAc,GAAI,GAAG,OAAO,KAAG,OACS,CAAA;AAIrD,eAAO,MAAM,mBAAmB,GAAI,GAAG,OAAO,KAAG,OACI,CAAA;AAErD,eAAO,MAAM,WAAW,GAAI,GAAG,OAAO,KAAG,OAKf,CAAA;AAM1B,eAAO,MAAM,YAAY,GAAI,QAAQ,OAAO,EAAE,KAAG,OAAO,EAavD,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAE/B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,MAAM,EAAE,OAAO,EAAE,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,CAAA;AAeD,eAAO,MAAM,aAAa,GAAI,OAAO,kBAAkB,KAAG,MAkBzD,CAAA;AAID,eAAO,MAAM,WAAW,GACtB,MAAM,MAAM,EACZ,QAAQ,MAAM,KACb,OAAO,CAAC,YAAY,CAWtB,CAAA"}
|
package/dist/health.js
CHANGED
|
@@ -1,14 +1,45 @@
|
|
|
1
1
|
import { execa } from "execa";
|
|
2
2
|
// The canonical check classifiers — one source of truth, unifying the two
|
|
3
|
-
// hand-maintained copies that had drifted (glance vs panel).
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
|
|
3
|
+
// hand-maintained copies that had drifted (glance vs panel). Four readings, and
|
|
4
|
+
// together they partition GitHub's CheckConclusionState rather than sampling it:
|
|
5
|
+
// a check FAILED when it reached a bad verdict, is PENDING while it is still
|
|
6
|
+
// running, is INCONCLUSIVE when it reached no verdict at all, and PASSED on an
|
|
7
|
+
// explicit success signal.
|
|
8
|
+
//
|
|
9
|
+
// The fail/inconclusive line is the one that matters, and it is about whether a
|
|
10
|
+
// judgement was ever reached — not about whether the check is green. FAILURE,
|
|
11
|
+
// TIMED_OUT and STARTUP_FAILURE are verdicts: the code, the run or the workflow
|
|
12
|
+
// file was examined and found wanting. CANCELLED and STALE are the absence of a
|
|
13
|
+
// verdict: the run was killed or abandoned, and nothing was learnt about the
|
|
14
|
+
// code either way.
|
|
15
|
+
//
|
|
16
|
+
// CANCELLED sat under fail until 2026-08-28, which is a claim the token cannot
|
|
17
|
+
// support. gnachman/iTerm2#731 banded under "Your move" with a red ✗ against a
|
|
18
|
+
// PR whose only sin was that its xcode-tests job waited six hours for a macOS
|
|
19
|
+
// runner on somebody else's infrastructure and was killed by Actions. A verdict
|
|
20
|
+
// was never reached, so there was nothing there for the author to fix — and a
|
|
21
|
+
// band that says otherwise is exactly the over-claiming the whose-move split
|
|
22
|
+
// exists to prevent.
|
|
23
|
+
//
|
|
24
|
+
// A cancelled run is still worth retriggering, so `isInconclusiveCheck` is not
|
|
25
|
+
// merely "not a failure": the health panel's `r` action finds its target through
|
|
26
|
+
// these predicates, and dropping CANCELLED from the fail set without a second
|
|
27
|
+
// home for it would have silently removed the one affordance that fixes this.
|
|
28
|
+
//
|
|
29
|
+
// STARTUP_FAILURE was in no set at all, which is the same bug pointing the other
|
|
30
|
+
// way: a workflow file too broken to start read as neither failing nor pending
|
|
31
|
+
// nor passing, so it rendered quiet. It is a verdict on the code and belongs
|
|
32
|
+
// with the failures.
|
|
33
|
+
export const isFailCheck = (c) => ["FAILURE", "TIMED_OUT", "STARTUP_FAILURE", "ACTION_REQUIRED"].includes(c.conclusion ?? "") ||
|
|
7
34
|
c.state === "FAILURE" ||
|
|
8
35
|
c.state === "ERROR";
|
|
9
36
|
export const isPendingCheck = (c) => c.status === "IN_PROGRESS" || c.state === "PENDING";
|
|
37
|
+
// A terminal check that reached no verdict. Deliberately conclusion-only: there
|
|
38
|
+
// is no StatusContext state that means this, and inventing one would guess.
|
|
39
|
+
export const isInconclusiveCheck = (c) => ["CANCELLED", "STALE"].includes(c.conclusion ?? "");
|
|
10
40
|
export const isPassCheck = (c) => !isFailCheck(c) &&
|
|
11
41
|
!isPendingCheck(c) &&
|
|
42
|
+
!isInconclusiveCheck(c) &&
|
|
12
43
|
(["SUCCESS", "NEUTRAL", "SKIPPED"].includes(c.conclusion ?? "") ||
|
|
13
44
|
c.state === "SUCCESS");
|
|
14
45
|
// Collapse a rollup to the latest run per check name and drop SKIPPED ones: a
|
|
@@ -31,6 +62,15 @@ export const latestChecks = (checks) => {
|
|
|
31
62
|
// first, then the urgent actionable states, then unresolved threads (which
|
|
32
63
|
// outrank the passive pending/approved/waiting — an otherwise-quiet PR with open
|
|
33
64
|
// threads still needs your reply), then the passive states.
|
|
65
|
+
//
|
|
66
|
+
// An INCONCLUSIVE check gets no token of its own, and that is a decision rather
|
|
67
|
+
// than an omission. A health token earns its keep by changing whose move it is,
|
|
68
|
+
// and a "stale" one would band identically to `waiting` from all three standings
|
|
69
|
+
// — a token that flips no outcome is a label, and labels belong in the panel
|
|
70
|
+
// beside the check that earned them. So a PR whose only unfinished check was
|
|
71
|
+
// cancelled falls through to `waiting`, which is what it is: nothing is running,
|
|
72
|
+
// nothing is red, and nobody has reviewed it. The cancelled run is still named
|
|
73
|
+
// in the check list and still retriggerable from the health panel.
|
|
34
74
|
export const computeHealth = (input) => {
|
|
35
75
|
if (input.state === "MERGED")
|
|
36
76
|
return "merged";
|
package/dist/health.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"health.js","sourceRoot":"","sources":["../src/health.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AA+C7B,0EAA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