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/README.md
CHANGED
|
@@ -57,8 +57,11 @@ assert.deepStrictEqual(cycles, [[12, 14]]);
|
|
|
57
57
|
forest they describe, and everything read arranged into a report.
|
|
58
58
|
- **`summarize.mts`** — the counts a report leads with.
|
|
59
59
|
- **`ruleset.mts`** — what a ruleset requires: the contexts, and whether code
|
|
60
|
-
owners have to approve. **`
|
|
61
|
-
|
|
60
|
+
owners have to approve. **`branch-rules.mts`** — the same read off GitHub for
|
|
61
|
+
a branch, its rulesets and a classic branch protection rule together, through
|
|
62
|
+
whatever transport the reader hands over. **`code-owners.mts`**,
|
|
63
|
+
**`review-hold.mts`** — who owns a change, and whether a review holds a pull
|
|
64
|
+
request.
|
|
62
65
|
- **`queue-owner.mts`**, **`queue-order.mts`** — who moves each queued pull
|
|
63
66
|
request next, and the order the queue picks them in.
|
|
64
67
|
- **`set-aside.mts`**, **`claim.mts`** — the comments `unblock-prs` and a
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What GitHub enforces on a branch, read the one way every reader reads it:
|
|
3
|
+
* every ruleset that applies to the branch
|
|
4
|
+
* (`GET /repos/{owner}/{repo}/rules/branches/{branch}`), and the contexts a
|
|
5
|
+
* classic branch protection rule requires
|
|
6
|
+
* (`GET /repos/{owner}/{repo}/branches/{branch}`). Neither wants more than
|
|
7
|
+
* reading the repository, where the endpoints that list a ruleset's own
|
|
8
|
+
* settings or a protection rule's whole want an admin.
|
|
9
|
+
*
|
|
10
|
+
* What a classic rule says about reviews is not among what the second answers,
|
|
11
|
+
* so a code owner's approval is waited for only where a ruleset asks for it.
|
|
12
|
+
*
|
|
13
|
+
* Nothing here talks to GitHub: the reader hands over its own way of asking.
|
|
14
|
+
*/
|
|
15
|
+
import { Result } from 'ts-data-forge';
|
|
16
|
+
import * as t from 'ts-fortress';
|
|
17
|
+
import { type RulesetRequirements } from './ruleset.mjs';
|
|
18
|
+
/**
|
|
19
|
+
* One `GET`, by the reader's own transport. `path` is relative to
|
|
20
|
+
* `/repos/{owner}/{repo}` and may carry a query string; `what` names the
|
|
21
|
+
* request for a message.
|
|
22
|
+
*/
|
|
23
|
+
export type BranchRulesGet = <A>(path: string, schema: t.Type<A>, what: string) => Promise<Result<A, string>>;
|
|
24
|
+
/**
|
|
25
|
+
* The requirements on `branch`, or why they could not be read. Either request
|
|
26
|
+
* failing fails it: a list of required contexts missing half of them would be
|
|
27
|
+
* read as the whole.
|
|
28
|
+
*/
|
|
29
|
+
export declare const readBranchRequirements: (branch: string, get: BranchRulesGet) => Promise<Result<RulesetRequirements, string>>;
|
|
30
|
+
//# sourceMappingURL=branch-rules.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branch-rules.d.mts","sourceRoot":"","sources":["../src/branch-rules.mts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAO,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EAAuB,KAAK,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAE9E;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,EAC7B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EACjB,IAAI,EAAE,MAAM,KACT,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;AAEhC;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,WACzB,MAAM,OACT,cAAc,KAClB,OAAO,CAAC,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAAC,CA2C7C,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
import { Arr, Result } from 'ts-data-forge';
|
|
16
|
+
import * as t from 'ts-fortress';
|
|
17
|
+
import { requirementsOfRules } from './ruleset.mjs';
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
export const readBranchRequirements = async (branch, get) => {
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
const segment = encodeURIComponent(branch);
|
|
28
|
+
const [rules, branchAnswer] = await Promise.all([
|
|
29
|
+
get(`/rules/branches/${segment}?per_page=${RULES_PER_PAGE}`, RulesSchema, `the rules on ${branch}`),
|
|
30
|
+
get(`/branches/${segment}`, BranchSchema, `the protection of ${branch}`),
|
|
31
|
+
]);
|
|
32
|
+
if (Result.isErr(rules)) {
|
|
33
|
+
return rules;
|
|
34
|
+
}
|
|
35
|
+
if (Result.isErr(branchAnswer)) {
|
|
36
|
+
return branchAnswer;
|
|
37
|
+
}
|
|
38
|
+
const fromRulesets = requirementsOfRules(rules.value);
|
|
39
|
+
const protection = branchAnswer.value.protection;
|
|
40
|
+
const classic = protection?.enabled === false
|
|
41
|
+
? undefined
|
|
42
|
+
: protection?.required_status_checks;
|
|
43
|
+
return Result.ok({
|
|
44
|
+
...fromRulesets,
|
|
45
|
+
requiredContexts: Arr.uniq([
|
|
46
|
+
...fromRulesets.requiredContexts,
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
...(classic === undefined || classic.enforcement_level === 'off'
|
|
50
|
+
? []
|
|
51
|
+
: classic.contexts),
|
|
52
|
+
]),
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
const RULES_PER_PAGE = 100;
|
|
61
|
+
const RulesSchema = t.array(t.unknown());
|
|
62
|
+
const BranchSchema = t.record({
|
|
63
|
+
protection: t.optional(t.record({
|
|
64
|
+
enabled: t.optional(t.boolean()),
|
|
65
|
+
required_status_checks: t.optional(t.record({
|
|
66
|
+
enforcement_level: t.optional(t.string()),
|
|
67
|
+
contexts: t.array(t.string()),
|
|
68
|
+
})),
|
|
69
|
+
})),
|
|
70
|
+
});
|
|
71
|
+
//# sourceMappingURL=branch-rules.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branch-rules.mjs","sourceRoot":"","sources":["../src/branch-rules.mts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAA4B,MAAM,eAAe,CAAC;AAa9E;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,EACzC,MAAc,EACd,GAAmB,EAC2B,EAAE;IAChD,yEAAyE;IACzE,gEAAgE;IAChE,iDAAiD;IACjD,MAAM,OAAO,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAE3C,MAAM,CAAC,KAAK,EAAE,YAAY,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC9C,GAAG,CACD,mBAAmB,OAAO,aAAa,cAAc,EAAE,EACvD,WAAW,EACX,gBAAgB,MAAM,EAAE,CACzB;QACD,GAAG,CAAC,aAAa,OAAO,EAAE,EAAE,YAAY,EAAE,qBAAqB,MAAM,EAAE,CAAC;KACzE,CAAC,CAAC;IAEH,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,MAAM,CAAC,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CACH;KACF,CAAC,CACH;CACF,CAAC,CAAC"}
|
package/dist/checks.d.mts
CHANGED
|
@@ -3,36 +3,36 @@ import type { ChecksSummary, ContextState } from './types.mjs';
|
|
|
3
3
|
/**
|
|
4
4
|
* What every context reported, from a head commit's check runs.
|
|
5
5
|
*
|
|
6
|
-
* A name appears more than once whenever two check suites reported it, and on
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
6
|
+
* A name appears more than once whenever two check suites reported it, and on a
|
|
7
|
+
* queued pull request that is the normal case rather than the odd one: the run
|
|
8
|
+
* the `opened` event starts is cancelled by the `labeled` event's, and both
|
|
9
|
+
* stay on the commit — the cancelled one leaving its `*-result` aggregate
|
|
10
|
+
* concluded `failure`, because an `if: always()` job that asserts on cancelled
|
|
11
|
+
* `needs` fails.
|
|
12
12
|
*
|
|
13
|
-
* **The newest check suite wins, and that is not the same as the newest
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
13
|
+
* **The newest check suite wins, and that is not the same as the newest run.**
|
|
14
|
+
* GitHub resolves a required context to the run in the suite with the greatest
|
|
15
|
+
* id, so where the cancelled suite happens to have been created after the one
|
|
16
|
+
* that superseded it, the stale red is what holds the merge — however much
|
|
17
|
+
* later the green one finished. Every suite of one push is created in the same
|
|
18
|
+
* second, so which of them got the higher id is not something the repository
|
|
19
|
+
* decides.
|
|
20
20
|
*
|
|
21
21
|
* This is why the rule is not "the newest `started_at`", which reads more
|
|
22
22
|
* natural and would call such a pull request green while GitHub blocks it.
|
|
23
|
-
* A report that says a blocked pull request will merge is worse than one
|
|
24
|
-
*
|
|
25
|
-
*
|
|
23
|
+
* A report that says a blocked pull request will merge is worse than one that
|
|
24
|
+
* says a green one will not: `CLAUDE.md`'s "Commits and pull requests" says to
|
|
25
|
+
* ignore the red the cancelled run leaves, and this is the case where
|
|
26
26
|
* GitHub does not.
|
|
27
27
|
*
|
|
28
28
|
* **A run whose workflow has a newer round still going is pending.** An
|
|
29
|
-
* aggregate has no run in a round until the jobs it waits on are done, so
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
29
|
+
* aggregate has no run in a round until the jobs it waits on are done, so until
|
|
30
|
+
* then the only run of its name is the previous round's — on a pull request
|
|
31
|
+
* whose label events started two rounds, the red the second left on the first
|
|
32
|
+
* (#2191). That run is what GitHub shows, but not what it will answer with: the
|
|
33
|
+
* newer round is in the suite with the greater id, and its aggregate will be
|
|
34
|
+
* the newest run of the name. Where the newer round has finished without one,
|
|
35
|
+
* the older run stands, as it does on GitHub.
|
|
36
36
|
*/
|
|
37
37
|
export declare const statesFromCheckRuns: (runs: readonly CheckRunReport[]) => ReadonlyMap<string, ContextState>;
|
|
38
38
|
/** One check run, in the terms the decision above is made in. */
|
|
@@ -47,9 +47,9 @@ export type CheckRunReport = Readonly<{
|
|
|
47
47
|
/**
|
|
48
48
|
* The workflow run its suite is, where it is one: the workflow, so that a
|
|
49
49
|
* newer round of it can be told from an unrelated suite, and whether the
|
|
50
|
-
* round has finished, which its runs alone do not say — an aggregate's run
|
|
51
|
-
*
|
|
52
|
-
*
|
|
50
|
+
* round has finished, which its runs alone do not say — an aggregate's run is
|
|
51
|
+
* created only once every job before it has completed. `undefined` for a run
|
|
52
|
+
* no workflow made, or where the workflow runs could not be read.
|
|
53
53
|
*/
|
|
54
54
|
round: Readonly<{
|
|
55
55
|
workflowId: number;
|
|
@@ -62,30 +62,30 @@ export type CheckRunReport = Readonly<{
|
|
|
62
62
|
* A run that has not completed is pending whatever it concluded last — the
|
|
63
63
|
* conclusion of a re-run is the previous verdict until the new one finishes.
|
|
64
64
|
* A `skipped` conclusion is reported as `skipped` and counted as met by
|
|
65
|
-
* {@link summarizeChecks}, because GitHub counts it as met: the gated jobs
|
|
66
|
-
*
|
|
67
|
-
*
|
|
65
|
+
* {@link summarizeChecks}, because GitHub counts it as met: the gated jobs skip
|
|
66
|
+
* on `skip-ci` and on a diff the workflow does not read, and reading that as a
|
|
67
|
+
* failure would call every gated pull request red.
|
|
68
68
|
* Everything else that finished — `cancelled`, `stale`, `timed_out`,
|
|
69
|
-
* `action_required` — is something a reader has to act on, so it is a
|
|
70
|
-
*
|
|
69
|
+
* `action_required` — is something a reader has to act on, so it is a failure
|
|
70
|
+
* here even where GitHub is vaguer about it.
|
|
71
71
|
*/
|
|
72
72
|
export declare const classifyCheckRun: (status: string, conclusion: string | undefined) => ContextState;
|
|
73
73
|
/**
|
|
74
74
|
* Whether any run on the head commit has not finished, or any round has not.
|
|
75
75
|
*
|
|
76
|
-
* Every run, not only the required ones: the aggregates are `if: always()`
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
76
|
+
* Every run, not only the required ones: the aggregates are `if: always()` and
|
|
77
|
+
* have no run in the newest round until the jobs they wait on are done, so
|
|
78
|
+
* "every required context has reported" is true of a commit halfway through a
|
|
79
|
+
* round — with the reports coming from the round before. And the round, not
|
|
80
|
+
* only its runs: between the last job finishing and the aggregate being
|
|
81
|
+
* created, every run there is has completed.
|
|
82
82
|
*/
|
|
83
83
|
export declare const anyRunInProgress: (runs: readonly CheckRunReport[]) => boolean;
|
|
84
84
|
/**
|
|
85
|
-
* What every context has reported on one commit, from both places GitHub
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
85
|
+
* What every context has reported on one commit, from both places GitHub keeps
|
|
86
|
+
* them. The aggregate jobs are check runs; `no-skip-ci-label` is a commit
|
|
87
|
+
* status, so reading only the first would report the context that holds every
|
|
88
|
+
* labelled pull request as missing.
|
|
89
89
|
*
|
|
90
90
|
* `state` is a commit status's as the REST API spells it, in lower case.
|
|
91
91
|
*/
|
|
@@ -96,18 +96,17 @@ export declare const reportedContexts: (runs: readonly CheckRunReport[], statuse
|
|
|
96
96
|
/**
|
|
97
97
|
* What a context reported that is both a check run and a commit status.
|
|
98
98
|
*
|
|
99
|
-
* Not "the status wins", which is what this used to assume. GitHub's own
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
* them ran.
|
|
99
|
+
* Not "the status wins", which is what this used to assume. GitHub's own answer
|
|
100
|
+
* is that neither does: "If a check and a commit status have the same name,
|
|
101
|
+
* both must pass when that name is required." So the stricter of the two is the
|
|
102
|
+
* verdict, and a green status cannot cover a red check run of the same name. A
|
|
103
|
+
* skip beside a pass is a skip: both are met, but only one of them ran.
|
|
105
104
|
*/
|
|
106
105
|
export declare const combineContextStates: (a: ContextState, b: ContextState) => ContextState;
|
|
107
106
|
/**
|
|
108
107
|
* What one commit status has reported. `no-skip-ci-label` is one of these
|
|
109
|
-
* rather than a check run, so a report that read only check runs would call
|
|
110
|
-
*
|
|
108
|
+
* rather than a check run, so a report that read only check runs would call the
|
|
109
|
+
* context that holds every labelled pull request "missing".
|
|
111
110
|
*/
|
|
112
111
|
export declare const classifyCommitStatus: (state: string) => ContextState;
|
|
113
112
|
/**
|
|
@@ -115,24 +114,24 @@ export declare const classifyCommitStatus: (state: string) => ContextState;
|
|
|
115
114
|
* requires and no others: a failing job nothing requires does not block a
|
|
116
115
|
* merge, and listing it would bury the one that does.
|
|
117
116
|
*
|
|
118
|
-
* `paused` outranks the rest. While `skip-ci` is on, the checks a reader
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
117
|
+
* `paused` outranks the rest. While `skip-ci` is on, the checks a reader sees
|
|
118
|
+
* are whatever survived from before the label went on — typically the red left
|
|
119
|
+
* by the `opened` run that the `labeled` run cancelled. Calling that "failing"
|
|
120
|
+
* would make every queued pull request look broken; the failures are still
|
|
121
|
+
* listed, because they are what a reader asks about.
|
|
123
122
|
*
|
|
124
123
|
* `running` is the third thing that makes a verdict provisional, beside a
|
|
125
|
-
* required context that is pending and one that has not reported. Without it
|
|
126
|
-
*
|
|
127
|
-
*
|
|
124
|
+
* required context that is pending and one that has not reported. Without it a
|
|
125
|
+
* commit mid-round reads as settled out of the round before — which is how a
|
|
126
|
+
* failing pull request (#2031) came to show a tick.
|
|
128
127
|
*
|
|
129
128
|
* **Off the covered base, a context that never reported is not awaited.**
|
|
130
129
|
* The contexts are the ones the ruleset asks of `main`, and a workflow that
|
|
131
|
-
* runs only on pull requests into `main` never reports on a stacked one —
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
130
|
+
* runs only on pull requests into `main` never reports on a stacked one — which
|
|
131
|
+
* kept #2103, every check of it green, "running" until it was moved onto
|
|
132
|
+
* `main`. Such a context is {@link ChecksSummary.notRun} instead, but only once
|
|
133
|
+
* some required context has reported: before the first check suite, nothing
|
|
134
|
+
* having come is not a pass over zero contexts.
|
|
136
135
|
*/
|
|
137
136
|
export declare const summarizeChecks: ({ required, reported, paused, running, baseCovered, }: Readonly<{
|
|
138
137
|
required: readonly string[];
|
package/dist/checks.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checks.d.mts","sourceRoot":"","sources":["../src/checks.mts"],"names":[],"mappings":"AAAA,kDAAkD;AAGlD,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,mBAAmB,SACxB,SAAS,cAAc,EAAE,KAC9B,WAAW,CAAC,MAAM,EAAE,YAAY,CAgDlC,CAAC;AAEF,iEAAiE;AACjE,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,yEAAyE;IACzE,YAAY,EAAE,MAAM,CAAC;IACrB,qEAAqE;IACrE,EA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AO;QACP,MAAM;QACN,QAAQ,EAAE,QAAQ,CAAC,MAAM;KAC1B,CAAC;AACJ,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,QAAQ,GAAG,CAAC,GAAmB,EAAE,QAAwB,EAAW,EAAE,CAC1E,GAAG,CAAC,YAAY,KAAK,QAAQ,CAAC,YAAY;IACxC,CAAC,CAAC,GAAG,CAAC,EAAE,GAAG,QAAQ,CAAC,EAAE;IACtB,CAAC,CAAC,GAAG,CAAC,YAAY,GAAG,QAAQ,CAAC,YAAY,CAAC"}
|
package/dist/claim.d.mts
CHANGED
|
@@ -3,26 +3,26 @@
|
|
|
3
3
|
* writer of the queue can read it.
|
|
4
4
|
*
|
|
5
5
|
* `unblock-prs` leaves a set-aside pull request alone until its head moves —
|
|
6
|
-
* or, for every reason but `checks-failed
|
|
7
|
-
* base does, when it tries the rebase again. A
|
|
8
|
-
* request is then racing the script, and a second
|
|
9
|
-
* opened the pull request and is woken by the
|
|
10
|
-
* fixing the same failure. The leases on every push
|
|
11
|
-
* overwriting another's work, but not from doing it
|
|
12
|
-
* on one says so first in a comment whose first line
|
|
13
|
-
* module writes and reads, and everyone else — the
|
|
14
|
-
* that pull request to it.
|
|
6
|
+
* or, for every reason but `checks-failed`, `awaiting-bypass` and
|
|
7
|
+
* `head-out-of-sync`, until the base does, when it tries the rebase again. A
|
|
8
|
+
* session fixing that pull request is then racing the script, and a second
|
|
9
|
+
* session, or the one that opened the pull request and is woken by the
|
|
10
|
+
* set-aside comment, may be fixing the same failure. The leases on every push
|
|
11
|
+
* keep any of them from overwriting another's work, but not from doing it
|
|
12
|
+
* twice. So whoever starts on one says so first in a comment whose first line
|
|
13
|
+
* is a hidden record this module writes and reads, and everyone else — the
|
|
14
|
+
* script included — leaves that pull request to it.
|
|
15
15
|
*
|
|
16
16
|
* **It lasts while the head is the one it claimed**, and for at most
|
|
17
17
|
* {@link CLAIM_LIFETIME_MINUTES}. The push that carries the fix moves the head
|
|
18
|
-
* and so ends the claim with nothing left to clean up; that push is what
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
18
|
+
* and so ends the claim with nothing left to clean up; that push is what hands
|
|
19
|
+
* the pull request back to the script, as it always was. The lifetime is for a
|
|
20
|
+
* claimant that stopped without pushing. A claimant that needs longer writes
|
|
21
|
+
* the claim again.
|
|
22
22
|
*
|
|
23
23
|
* **One comment per pull request, edited in place**, like the set-aside one;
|
|
24
|
-
* a claim that has ended is simply written over. Of several, the oldest is
|
|
25
|
-
*
|
|
24
|
+
* a claim that has ended is simply written over. Of several, the oldest is the
|
|
25
|
+
* one, so two claimants writing at once both read back the same answer.
|
|
26
26
|
*
|
|
27
27
|
* **Only the comments the reader's own account wrote count**, as for the
|
|
28
28
|
* set-aside comment (`set-aside.mts`): the repository is public. `by` is what
|
|
@@ -60,4 +60,10 @@ export declare const parseClaimComment: (body: string) => ClaimComment | undefin
|
|
|
60
60
|
* `headTip`, at `nowEpochMs`.
|
|
61
61
|
*/
|
|
62
62
|
export declare const claimApplies: (claim: Claim, headTip: string, nowEpochMs: number) => boolean;
|
|
63
|
+
/**
|
|
64
|
+
* How far ahead of the reader's clock a claim may be dated and still count.
|
|
65
|
+
* Further than that is a clock that would otherwise stretch the lifetime by
|
|
66
|
+
* however far ahead it ran.
|
|
67
|
+
*/
|
|
68
|
+
export declare const CLOCK_SKEW_MINUTES = 5;
|
|
63
69
|
//# sourceMappingURL=claim.d.mts.map
|
package/dist/claim.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claim.d.mts","sourceRoot":"","sources":["../src/claim.mts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAIH,gEAAgE;AAChE,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAE1C,MAAM,MAAM,KAAK,GAAG,QAAQ,CAAC;IAC3B,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,EAAE,E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MAAM,aAAa,GACjB,8HAA8H,CAAC"}
|
|
@@ -17,33 +17,32 @@ export type ClosingIssueNode = Readonly<{
|
|
|
17
17
|
/**
|
|
18
18
|
* The closing issues that belong to `repo`, in GitHub's order.
|
|
19
19
|
*
|
|
20
|
-
* **Only this repository's.** A pull request can close an issue anywhere,
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* same line.
|
|
20
|
+
* **Only this repository's.** A pull request can close an issue anywhere, and a
|
|
21
|
+
* report lists each as `#N` — which for another repository's issue names a
|
|
22
|
+
* different issue of this one, and for a private repository's may put a title
|
|
23
|
+
* the report's reader cannot see into a report someone else reads. The body
|
|
24
|
+
* parser `pr-report` falls back on without a token draws the same line.
|
|
26
25
|
*
|
|
27
|
-
* `null` entries are skipped rather than rejected: one issue the token may
|
|
28
|
-
*
|
|
26
|
+
* `null` entries are skipped rather than rejected: one issue the token may not
|
|
27
|
+
* see is no reason to lose the rest.
|
|
29
28
|
*/
|
|
30
29
|
export declare const closingIssuesIn: (repo: RepoRef, nodes: readonly ClosingIssueNode[]) => readonly LinkedIssue[];
|
|
31
30
|
/**
|
|
32
|
-
* The issues of `repo` a pull request body closes by keyword, as GitHub
|
|
33
|
-
*
|
|
31
|
+
* The issues of `repo` a pull request body closes by keyword, as GitHub itself
|
|
32
|
+
* read the body: first appearance order, each once.
|
|
34
33
|
*
|
|
35
34
|
* **Read from GitHub's rendering, not from the text.** GitHub wraps each
|
|
36
|
-
* closing keyword it recognized in `<span class="issue-keyword">` and puts
|
|
37
|
-
*
|
|
38
|
-
* `closingIssuesReferences` does not: it links a keyword only on a pull
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
35
|
+
* closing keyword it recognized in `<span class="issue-keyword">` and puts the
|
|
36
|
+
* reference right after it, and it does so whatever the base branch.
|
|
37
|
+
* `closingIssuesReferences` does not: it links a keyword only on a pull request
|
|
38
|
+
* into the default branch, so a stacked one lists nothing until the layers
|
|
39
|
+
* below it merge. Which spellings count, whether a reference inside code or
|
|
40
|
+
* after a comma is closed, is GitHub's to decide, and this takes its decision
|
|
41
|
+
* rather than copying the grammar. A body cannot forge the mark:
|
|
43
42
|
* GitHub strips `class` from HTML written in one.
|
|
44
43
|
*
|
|
45
|
-
* A reference to another repository's issue, or to a pull request, is left
|
|
46
|
-
*
|
|
44
|
+
* A reference to another repository's issue, or to a pull request, is left out,
|
|
45
|
+
* for the reasons {@link closingIssuesIn} gives.
|
|
47
46
|
*/
|
|
48
47
|
export declare const closingKeywordIssuesIn: (repo: RepoRef, bodyHtml: string) => readonly number[];
|
|
49
48
|
//# sourceMappingURL=closing-issues.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"closing-issues.d.mts","sourceRoot":"","sources":["../src/closing-issues.mts"],"names":[],"mappings":"AAAA,4EAA4E;AAG5E,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAExD;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,QAAQ,CAAC;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACjD,CAAC,GAAG,IAAI,CAAC;AAEV
|
|
1
|
+
{"version":3,"file":"closing-issues.d.mts","sourceRoot":"","sources":["../src/closing-issues.mts"],"names":[],"mappings":"AAAA,4EAA4E;AAG5E,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAExD;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,QAAQ,CAAC;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACjD,CAAC,GAAG,IAAI,CAAC;AAEV;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe,SACpB,OAAO,SACN,SAAS,gBAAgB,EAAE,KACjC,SAAS,WAAW,EAoBtB,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,sBAAsB,SAC3B,OAAO,YACH,MAAM,KACf,SAAS,MAAM,EAkBjB,CAAC"}
|
package/dist/closing-issues.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"closing-issues.mjs","sourceRoot":"","sources":["../src/closing-issues.mts"],"names":[],"mappings":"AAAA,4EAA4E;AAE5E,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAgBjD
|
|
1
|
+
{"version":3,"file":"closing-issues.mjs","sourceRoot":"","sources":["../src/closing-issues.mts"],"names":[],"mappings":"AAAA,4EAA4E;AAE5E,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAgBjD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,IAAa,EACb,KAAkC,EACV,EAAE;IAC1B,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAEvD,OAAO,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAC3B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,IAAI,IAAI,EAAE,UAAU,CAAC,aAAa,CAAC,WAAW,EAAE,KAAK,GAAG,EAAE,CAAC;gBACzD,MAAM;oBACJ,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,KAAK,EAAE,IAAI,CAAC,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,sEAAsE;AACtE,MAAM,YAAY,GAAG,CAAC,UAAkB,EAA+B,EAAE,CACvE,IAAI,GAAG,CACL,UAAU;KACP,QAAQ,CAAC,SAAS,CAAC;KACnB,GAAG,CACF,CAAC,KAAK,EAAE,EAAE,CACR;IACE,KAAK,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE;IAC5B,KAAK,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE;CACrB,CACb,CACJ,CAAC;AAEJ,MAAM,SAAS,GAAG,qCAAqC,CAAC;AAExD,MAAM,UAAU,GAAG,CAAC,GAAW,EAAqB,EAAE;IACpD,MAAM,MAAM,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAErC,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACnD,CAAC,CAAC"}
|
package/dist/code-owners.d.mts
CHANGED
|
@@ -3,49 +3,48 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Read because GitHub will not say. `main`'s ruleset has
|
|
5
5
|
* `require_code_owner_review` on, so a pull request touching an owned path
|
|
6
|
-
* waits for an owner to approve it — and nothing on a pull request reports
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* Pull Requests Manager page, to show the wait, and by `unblock-prs`, to
|
|
11
|
-
*
|
|
6
|
+
* waits for an owner to approve it — and nothing on a pull request reports that
|
|
7
|
+
* wait: `reviewDecision` answers `null` for every pull request here, owned
|
|
8
|
+
* paths or not, because it describes branch protection rather than a ruleset.
|
|
9
|
+
* So it is worked out the way GitHub does, from the file — by the
|
|
10
|
+
* Pull Requests Manager page, to show the wait, and by `unblock-prs`, to leave
|
|
11
|
+
* a pull request that waits in the queue rather than run its checks.
|
|
12
12
|
*
|
|
13
|
-
* The patterns are the subset of `.gitignore` syntax GitHub documents for
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
13
|
+
* The patterns are the subset of `.gitignore` syntax GitHub documents for this
|
|
14
|
+
* file: a leading `/` or a `/` in the middle anchors a pattern to the root, a
|
|
15
|
+
* trailing `/` makes it a directory, `*` and `?` stay inside one path segment
|
|
16
|
+
* and `**` crosses them. Negation and character ranges are not supported by
|
|
17
|
+
* GitHub here either.
|
|
18
18
|
*/
|
|
19
19
|
export type CodeOwnersRule = Readonly<{
|
|
20
20
|
pattern: string;
|
|
21
21
|
/**
|
|
22
|
-
* Without the leading `@`. Empty for a pattern that clears the owners of
|
|
23
|
-
*
|
|
22
|
+
* Without the leading `@`. Empty for a pattern that clears the owners of what
|
|
23
|
+
* an earlier line matched.
|
|
24
24
|
*/
|
|
25
25
|
owners: readonly string[];
|
|
26
26
|
}>;
|
|
27
27
|
export declare const parseCodeOwners: (text: string) => readonly CodeOwnersRule[];
|
|
28
28
|
/**
|
|
29
|
-
* The owners of one path: those of the **last** pattern that matches it,
|
|
30
|
-
*
|
|
31
|
-
*
|
|
29
|
+
* The owners of one path: those of the **last** pattern that matches it, which
|
|
30
|
+
* is how GitHub reads the file — a later line overrides an earlier one rather
|
|
31
|
+
* than adding to it.
|
|
32
32
|
*/
|
|
33
33
|
export declare const ownersOf: (path: string, rules: readonly CodeOwnersRule[]) => readonly string[];
|
|
34
34
|
/**
|
|
35
35
|
* What GitHub would say, worked out the way GitHub does: every changed path
|
|
36
|
-
* that has owners needs an approval from one of them. An approval is the
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
36
|
+
* that has owners needs an approval from one of them. An approval is the latest
|
|
37
|
+
* review of an owner that says so; one dismissed by a later push — the ruleset
|
|
38
|
+
* dismisses stale approvals — no longer counts, and GitHub has already stopped
|
|
39
|
+
* calling it an approval by the time this reads it.
|
|
40
40
|
*
|
|
41
|
-
* Owners are compared by login, case-insensitively, as GitHub compares
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
* team.
|
|
41
|
+
* Owners are compared by login, case-insensitively, as GitHub compares them. A
|
|
42
|
+
* team owner (`@org/team`) cannot be: telling who is on the team takes
|
|
43
|
+
* `read:org`, which neither reader asks for. So a path a team owns waits while
|
|
44
|
+
* nobody at all has approved, is approved by a person owning it beside the
|
|
45
|
+
* team, and otherwise — someone approved, and might be on the team — cannot be
|
|
46
|
+
* told, which makes the whole `unknown` unless another path is plainly still
|
|
47
|
+
* waiting. `CODEOWNERS` in this repository names no team.
|
|
49
48
|
*/
|
|
50
49
|
export declare const codeOwnerReview: ({ required, rules, files, filesComplete, approvers, author, }: Readonly<{
|
|
51
50
|
/** Whether the ruleset asks for code-owner review at all. */
|
|
@@ -62,12 +61,12 @@ export declare const codeOwnerReview: ({ required, rules, files, filesComplete,
|
|
|
62
61
|
* Where a pull request stands with the code owners.
|
|
63
62
|
*
|
|
64
63
|
* `required` lists what is still waiting — the owned paths no owner has
|
|
65
|
-
* approved yet, and who could approve them. `authorOwns` is the case that
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
64
|
+
* approved yet, and who could approve them. `authorOwns` is the case that waits
|
|
65
|
+
* for ever: GitHub does not let an author approve their own pull request, so
|
|
66
|
+
* when the author is the only owner nothing but a ruleset bypass will merge it.
|
|
67
|
+
* `unknown` is a pull request whose changed files were more than could be read,
|
|
68
|
+
* where the unread ones might be owned — or, with `teams`, one approved by
|
|
69
|
+
* someone these teams might have as a member.
|
|
71
70
|
*/
|
|
72
71
|
export type CodeOwnerReview = Readonly<{
|
|
73
72
|
state: 'approved';
|