diff --git a/app/claims/claim.ts b/app/claims/claim.ts index 6944073..2eec774 100644 --- a/app/claims/claim.ts +++ b/app/claims/claim.ts @@ -160,7 +160,7 @@ class ClaimedRun implements Claim { /** A rejected trigger never held the claim; setStatus keeps its record from replacing a real run's. */ async reject(): Promise> { const summary = `@${this.#opts.actor} needs \`${config.minimumPermission}\` permission on this repository to start it.`; - await finishStatus(this.#status("rejected", summary), { rootFinished: this.#opts.mode !== "continue" }); + await finishStatus(this.#status("rejected", summary)); return this.#record("rejected", "permission_denied", summary); } @@ -235,7 +235,7 @@ class ClaimedRun implements Claim { /** Writes a final state while this run still holds the claim; false once another run's status is showing. */ async #publish(state: TaskResult["state"], summary: string, links?: StatusLink[]): Promise { if (!(await this.#holdsClaim())) return false; - return await finishStatus(this.#status(state, summary, links), { rootFinished: this.#opts.mode !== "continue" }); + return await finishStatus(this.#status(state, summary, links)); } #record( diff --git a/factory.config.ts b/factory.config.ts index 5594ecc..d09a23c 100644 --- a/factory.config.ts +++ b/factory.config.ts @@ -39,10 +39,10 @@ export function defineFactoryConfig(config: FactoryConfig): FactoryConfig { export default defineFactoryConfig({ repos: { - "render-examples/render-factory-example-target": { + "jacobprall/software-factory-demo": { baseBranch: "main", install: "npm ci", - verify: ["npm run build", "npm test"], + verify: ["npm run build", "npm test -- --watchAll=false"], }, }, labels: { diff --git a/tests/claims.test.ts b/tests/claims.test.ts index 346f670..53ac5f3 100644 --- a/tests/claims.test.ts +++ b/tests/claims.test.ts @@ -239,7 +239,7 @@ describe("setStatus and finishStatus", () => { }); describe("withClaim", () => { - const ctx = { metadata: { taskRunId: "trn-run", rootTaskRunId: "trn-root" } }; + const ctx = { metadata: { taskRunId: "trn-run", rootTaskRunId: "trn-run" } }; it("rejects an actor without permission before taking over", async () => { const gh = new FakeGitHub(); @@ -248,11 +248,11 @@ describe("withClaim", () => { const fn = vi.fn(); const outcome = await withClaim(ctx, { repo: REPO, subject, task: "triage", title: "Triage", actor: "reader", gh: gh.asClient(), runs }, fn); expect(fn).not.toHaveBeenCalled(); - expect(outcome).toMatchObject({ state: "rejected", outcome: "permission_denied", traceId: "trn-root", runId: "trn-run" }); + expect(outcome).toMatchObject({ state: "rejected", outcome: "permission_denied", traceId: "trn-run", runId: "trn-run" }); expect(gh.comments[0]?.body).toContain("did not run: @reader needs `write` permission"); expect(parseMarker(gh.comments[0]?.body ?? "", "status")?.state).toBe("rejected"); expect(gh.labels.has(WORKING_LABEL)).toBe(false); - expect(events).toMatchObject([{ type: "run.finished", traceId: "trn-root", runId: "trn-run", payload: { state: "rejected" } }]); + expect(events).toMatchObject([{ type: "run.finished", traceId: "trn-run", runId: "trn-run", payload: { state: "rejected" } }]); }); it("runs the work and records events with the trace id and outcome", async () => { @@ -274,7 +274,7 @@ describe("withClaim", () => { ); expect(runs.cancelled).toEqual(["trn-prev"]); expect(parseMarker(gh.comments[0]?.body ?? "", "status")?.sandboxId).toBeUndefined(); - expect(outcome).toEqual({ state: "done", outcome: "asked-questions", summary: "asked 2 questions", traceId: "trn-root", runId: "trn-run" }); + expect(outcome).toEqual({ state: "done", outcome: "asked-questions", summary: "asked 2 questions", traceId: "trn-run", runId: "trn-run" }); expect(gh.comments).toHaveLength(1); expect(gh.comments[0]?.body).toContain("**Triage** finished: asked 2 questions"); expect(gh.labels.has(WORKING_LABEL)).toBe(false); @@ -282,7 +282,7 @@ describe("withClaim", () => { { type: "run.finished", traceId: "trn-prev", payload: { state: "cancelled", outcome: "superseded", stoppedBy: "trn-run" } }, { type: "run.finished", - traceId: "trn-root", + traceId: "trn-run", runId: "trn-run", repo: REPO.fullName, subject: "issue#12",