@veda-hq/niyam 0.7.10 → 0.7.12
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/package.json +1 -1
- package/scripts/merge-queue.mjs +9 -0
package/README.md
CHANGED
|
@@ -1741,7 +1741,7 @@ tag and the commit. Install the attached package on each machine with pnpm,
|
|
|
1741
1741
|
once; nothing is built on install:
|
|
1742
1742
|
|
|
1743
1743
|
```bash
|
|
1744
|
-
pnpm add -g https://github.com/veda-hq/niyam/releases/download/v0.7.
|
|
1744
|
+
pnpm add -g https://github.com/veda-hq/niyam/releases/download/v0.7.12/veda-hq-niyam-0.7.12.tgz
|
|
1745
1745
|
```
|
|
1746
1746
|
|
|
1747
1747
|
The package puts one command on `PATH`, `niyam`. Since P-57 a release
|
|
@@ -1863,7 +1863,8 @@ goes on. Any other failure to read it fails closed.
|
|
|
1863
1863
|
- opened as `mergify[bot]` on a `mergify/merge-queue/` branch of the repository;
|
|
1864
1864
|
- titled `merge queue: checking #A on main (sha)`, or `#A + #B together` for a batch (#524);
|
|
1865
1865
|
- with `, stacked on #B` when it tests several;
|
|
1866
|
-
- or, from four ahead, `, stacked on N pull requests ahead`, whose numbers come from the body's `### Queued ahead of this batch` list, only when it names exactly N
|
|
1866
|
+
- or, from four ahead, `, stacked on N pull requests ahead`, whose numbers come from the body's `### Queued ahead of this batch` list, only when it names exactly N;
|
|
1867
|
+
- once it has merged #A and closed the draft, retitled `merge queue: merged #A: <A's title>`, read as testing #A alone (#532). Only the number after `merged #` is read: the rest is #A's own title. That edit runs Guard and PR identity again, and they judge the closed draft as they did while it was checking #A.
|
|
1867
1868
|
|
|
1868
1869
|
`scripts/merge-queue.mjs`, a guard file that imports nothing, reads this for Guard and for PR identity alike.
|
|
1869
1870
|
|
|
@@ -1871,6 +1872,8 @@ Guard judges that draft's own diff once with each tested pull request's title, a
|
|
|
1871
1872
|
|
|
1872
1873
|
Any other draft, or one whose title names no pull request, is judged as itself, and so is any draft where work rules are off. A tested pull request GitHub cannot give fails closed.
|
|
1873
1874
|
|
|
1875
|
+
On a pull request, Guard's newer run cancels its older one. On Mergify's draft it does not: each run there has a concurrency group of its own, and every run reaches a verdict. This holds for any draft by `mergify[bot]` on a `mergify/merge-queue/` branch of the repository, whatever its title. Mergify edits the draft's body many times a minute. A cancelled required check makes it drop the pull request it tests ("checks interrupted"). Guard does not judge the draft's body, so the verdicts agree.
|
|
1876
|
+
|
|
1874
1877
|
A name is a path, a folder ending in `/`, or a pattern where `*` matches
|
|
1875
1878
|
within one folder and `**` across them. The guard files are a floor every
|
|
1876
1879
|
repository has, everything under `.github/`, `.githooks/` and `.husky/`,
|
package/package.json
CHANGED
package/scripts/merge-queue.mjs
CHANGED
|
@@ -19,6 +19,13 @@ export const MERGE_QUEUE_SIGNER = 'mergify-commit-signer';
|
|
|
19
19
|
*/
|
|
20
20
|
const MERGE_QUEUE_TITLE =
|
|
21
21
|
/^merge queue: checking (#\d+(?: \+ #\d+)*)(?: together)? on \S+ \([0-9a-f]+\)(?:, stacked on (?:(#\d+(?:(?:,\s*|\s+and\s+)#\d+)*)|(\d+) pull requests ahead))?$/;
|
|
22
|
+
/**
|
|
23
|
+
* The title Mergify gives the draft once it has merged the pull request it
|
|
24
|
+
* tested and closed the draft: `merge queue: merged #A: <A's title>`, as on
|
|
25
|
+
* athya_mono#3839. The group is the tested pull request; the rest is A's own
|
|
26
|
+
* title, which A's author writes, so nothing in it is read.
|
|
27
|
+
*/
|
|
28
|
+
const MERGED_TITLE = /^merge queue: merged #(\d+): /;
|
|
22
29
|
/** The body's list of the pull requests queued ahead, which a deep stack's title only counts. */
|
|
23
30
|
const QUEUED_AHEAD = /^### Queued ahead of this batch\n([\s\S]*?)(?=^#{1,3} |^<details>|(?![\s\S]))/m;
|
|
24
31
|
/** Mergify's merge of a tested pull request into its draft. */
|
|
@@ -46,6 +53,8 @@ export function isMergifyDraft(pull, repo) {
|
|
|
46
53
|
*/
|
|
47
54
|
export function mergifyTests(pull, repo, pr) {
|
|
48
55
|
if (!isMergifyDraft(pull, repo)) return undefined;
|
|
56
|
+
const merged = MERGED_TITLE.exec(pull.title ?? '')?.[1];
|
|
57
|
+
if (merged !== undefined) return Number(merged) === pr ? undefined : [Number(merged)];
|
|
49
58
|
const title = MERGE_QUEUE_TITLE.exec(pull.title ?? '');
|
|
50
59
|
if (!title) return undefined;
|
|
51
60
|
const [, batch = '', stacked = '', ahead] = title;
|