Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions pm-stack/dispatch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Flow:
issue, task, or session created (issue #2903).
1. Create the tracking GitHub issue (`source/dispatch` label; body = the
prompt + a dispatch footer). Skipped with a `warnings` entry for
dezren39/nix, where the pm-stack GitHub App is not installed.
developing-today/zettel, where the pm-stack GitHub App is not installed.
2. Enqueue a repo-task/v1 queue task (`small_fix` with the canonical
`repo-health:v1:fix:<repo>:issue:<n>` dedupe key when an issue exists,
else `triage` with a unique `repo-health:v1:triage:<repo>:dispatch:<rand8>`
Expand Down Expand Up @@ -117,10 +117,10 @@ comment naming the task id plus the `queue/queued` and
`source/dispatch` labels. The response is `201 {task_id,
issue_number, issue_url, queue}`, where `issue_url` is
`https://github.com/<repo>/issues/<issue_number>`. `issue_number`
takes precedence over `issue` when both are sent. For dezren39/nix,
where the GitHub App is not installed, the attach is skipped with a
`warnings` entry; the task is still enqueued and `issue_number` is
still returned.
takes precedence over `issue` when both are sent. For
developing-today/zettel, where the GitHub App is not installed, the
attach is skipped with a `warnings` entry; the task is still enqueued
and `issue_number` is still returned.

### `GET /v1/tasks/:id` — task status (issue #5555)

Expand Down Expand Up @@ -518,7 +518,7 @@ touching any caller.
| `GITHUB_APP_ID` / `GITHUB_APP_PRIVATE_KEY_BASE64` | — | rendered by install.sh from `~/secrets/pm-stack.sops.yaml` |

GitHub issue creation uses the pm-stack GitHub App (installed on code,
opencode, openchamber and dezren39/nix — **not** developing-today/zettel
opencode, openchamber and dezren39/darwin-nix — **not** developing-today/zettel
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
or dezren39/dezren39, where issue creation is skipped with a warning).
If the app route is unusable, the laptop's
authenticated `gh` CLI is the fallback; if both fail, the request
Expand Down
2 changes: 1 addition & 1 deletion pm-stack/dispatch/src/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// the app id + private key rendered into the service env from
// ~/secrets/pm-stack.sops.yaml — the same material connect-repo.sh uses).
// The installations cover developing-today/code, developing-today-forks/opencode
// and dezren39/nix; callers skip repos with no
// and dezren39/darwin-nix; callers skip repos with no
// installation (developing-today/zettel, dezren39/dezren39) before reaching
// here.
//
Expand Down
10 changes: 6 additions & 4 deletions pm-stack/dispatch/test/auth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ describe("OIDC verification", () => {
});

test("rejects a repo outside the allowlist", async () => {
// The pre-rename spelling is exactly such a repo now (#6940):
// only the canonical dezren39/darwin-nix is allowlisted.
const token = signJwt({ ...baseClaims, repository: "dezren39/nix" });
await expect(verifyOidcToken(token, oidcOpts)).rejects.toThrow(/allowlist/);
});
Expand All @@ -144,7 +146,7 @@ describe("cross-repo grants (assertCallerRepo)", () => {
"developing-today/code",
"developing-today/opencode",
"developing-today/openchamber",
"dezren39/nix",
"dezren39/darwin-nix",
"developing-today/zettel",
"dezren39/dezren39",
];
Expand All @@ -158,10 +160,10 @@ describe("cross-repo grants (assertCallerRepo)", () => {
expect(() => assertCallerRepo(openchamberCaller, "developing-today/opencode", allowlist)).not.toThrow();
});

test("cross-repo allowed: a zettel token may target dezren39/dezren39 and dezren39/nix", () => {
test("cross-repo allowed: a zettel token may target dezren39/dezren39 and dezren39/darwin-nix", () => {
const zettelCaller = { type: "oidc" as const, repository: "developing-today/zettel", actor: "dezren39" };
expect(() => assertCallerRepo(zettelCaller, "dezren39/dezren39", allowlist)).not.toThrow();
expect(() => assertCallerRepo(zettelCaller, "dezren39/nix", allowlist)).not.toThrow();
expect(() => assertCallerRepo(zettelCaller, "dezren39/darwin-nix", allowlist)).not.toThrow();
});

test("same-repo still allowed", () => {
Expand All @@ -179,7 +181,7 @@ describe("cross-repo grants (assertCallerRepo)", () => {

test("bearer callers are unaffected by caller/target repo pairing: an allowlisted target passes", () => {
expect(() => assertCallerRepo({ type: "bearer" }, "developing-today/opencode", allowlist)).not.toThrow();
expect(() => assertCallerRepo({ type: "bearer" }, "dezren39/nix", allowlist)).not.toThrow();
expect(() => assertCallerRepo({ type: "bearer" }, "dezren39/darwin-nix", allowlist)).not.toThrow();
});

test("bearer callers are rejected for a non-allowlisted target", () => {
Expand Down
4 changes: 2 additions & 2 deletions pm-stack/dispatch/test/packet.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ describe("dedupe keys", () => {
expect(canonicalDedupeKey("triage", "developing-today/opencode", 7)).toBe(
"repo-health:v1:triage:developing-today/opencode:issue:7",
);
expect(canonicalDedupeKey("ci_investigation", "dezren39/nix", 9)).toBe(
"repo-health:v1:triage:dezren39/nix:issue:9",
expect(canonicalDedupeKey("ci_investigation", "dezren39/darwin-nix", 9)).toBe(
"repo-health:v1:triage:dezren39/darwin-nix:issue:9",
);
expect(canonicalDedupeKey("pr_shepherd", "developing-today/code", 3)).toBeNull();
});
Expand Down
Loading