mirror of
https://github.com/storytold/autocraft.git
synced 2026-12-01 10:33:55 +01:00
Guard PR writes: gates and guard, Guarded argument on merge, push, review, ask comment and CI run writes, merge pinned to the reviewed head
This commit is contained in:
1 parent
8f3862b53c
commit
df653e52be
28 files changed
+431
-150
No files matched your search
@@ -1,4 +1,5 @@
|
||||
// Every text-posting wrapper in src/github/write.ts puts the note line first, then a blank line, then the text.
|
||||
import { guarded } from "./guarded.ts";
|
||||
import assert from "node:assert/strict";
|
||||
import { mkdtempSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
@@ -27,8 +28,8 @@ test("each posting wrapper sends the note as the first line and records the text
|
||||
const vars: Record<string, unknown>[] = [];
|
||||
const q = { spent: 0, remaining: null, async query(_q: string, v: Record<string, unknown>) { vars.push(v); return { addComment: {}, addPullRequestReview: { pullRequestReview: { id: "R1" } } }; } } as Querier;
|
||||
await commentOn(w, q, "act-comment", item, note, "The text.");
|
||||
await postReview(w, q, item, "abc", note, "The text.");
|
||||
await editReview(w, q, "app", 7, "R1", "abc", note, "The text.");
|
||||
await postReview(w, q, guarded("app", 7, "abc"), "N7", note, "The text.");
|
||||
await editReview(w, q, guarded("app", 7, "abc"), "R1", note, "The text.");
|
||||
assert.deepEqual(vars.map((v) => v.body), [want, want, want]);
|
||||
|
||||
const calls: { args: string[]; input?: string }[] = [];
|
||||
|
||||
Reference in new issue
Block a user