@veda-hq/niyam 0.7.11 → 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 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.11/veda-hq-niyam-0.7.11.tgz
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veda-hq/niyam",
3
- "version": "0.7.11",
3
+ "version": "0.7.12",
4
4
  "description": "Work rules for repos that track work in GitHub Issues: setup, agent identity, push and PR checks.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -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;