Skip to content

Commit 8246d92

Browse files
committed
refactor: drop the leftovers of the old workflow packages
1 parent 4e01e1b commit 8246d92

10 files changed

Lines changed: 21 additions & 22 deletions

File tree

‎apps/hub/src/audit-log.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ const DO_OUTCOMES: Record<string, string> = { done: "Ran", satisfied: "Found don
3535

3636
type Entry = Omit<AuditEntry, "time"> & { at: Date };
3737

38-
/** `people` is whether the caller may read the workspace's principals, which emails and members need. */
3938
/** The reason the hub gave when it replaced a busy deployment with a fresh copy, which earlier entries carry. */
4039
export const ROTATION_REASON = "Replaced by a fresh deployment of the same workflow";
4140

41+
/** `people` is whether the caller may read the workspace's principals, which emails and members need. */
4242
type Window = { tenantId: string; repo?: string; since?: Date; limit: number; people: boolean };
4343

4444
export type AuditLogDeps = {

‎apps/hub/src/integrations/app.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ export function createIntegrationsApp(guards: IntegrationGuards, handlers: Integ
636636
`${WORKFLOW_VERSIONS_PATH}/:tenantId`,
637637
describeRoute({
638638
summary: "Package versions of the workspace's live workflow deployments",
639-
description: "Each live deployment, newest first, with the workflow package it pinned and the packages its frozen closure carries. `package` is null for a deployment not pinned from a package registry; `source` is the asset and commit a source-format deployment runs, else null.",
639+
description: "Each live deployment, newest first, with the workflow package it pinned and the packages its frozen closure carries. `package` is null for a deployment without a frozen closure; `source` is the asset and commit a source-format deployment runs, else null.",
640640
tags: TAGS,
641641
responses: { 200: json("Live deployments and their versions", DeployedVersions), 401: failures[401], 403: failures[403] },
642642
}),

‎apps/web/src/components/settings/SupportVersions.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function versionLine(deployments: readonly DeployedWorkflow[], sources: readonly
1212
parts.push(`${workflow} not deployed`);
1313
continue;
1414
}
15-
parts.push(`${workflow} ${deployment.package?.version ?? "not from the package registry"}${deployment.live ? "" : " (not running)"}`);
15+
parts.push(`${workflow} ${deployment.package?.version ?? "version unknown"}${deployment.live ? "" : " (not running)"}`);
1616
if (deployment.tools) for (const tool of deployment.tools) tools.add(`${tool.name} ${tool.version}`);
1717
}
1818
return [...parts, ...tools].join(" · ");

‎packages/triage-contracts/src/index.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ export * from "./rule-prose.js";
2121
export * from "./step-when.js";
2222
export * from "./policy-rules.js";
2323
export { BLOCK_KINDS, blockCleanSchema, decideOf, kindsOf, policyWorkflowSchema, SEVERITIES, type BlockKind, type DecideRule, type PolicyWorkflow } from "./policy-workflow.js";
24-
export * from "./tarball.js";
2524
export * from "./code-review-models.js";
2625
export * from "./code-review.js";
2726
export * from "./stage-result.js";

‎packages/triage-contracts/src/policy-workflow.test.ts‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { describe, expect, test } from "bun:test";
22
import type { Type } from "arktype";
33
import { readCheckPack } from "./check-pack.ts";
4-
import { decide } from "./decide.ts";
54
import { exportPolicyFile, policyDifferences } from "./policy-export.ts";
65
import { checkPolicyFile, readPolicyFile } from "./policy-file.ts";
76
import { policyWorkflowSchema } from "./policy-workflow.ts";
@@ -95,11 +94,17 @@ describe("policy file v4", () => {
9594
});
9695
});
9796

98-
test("schema 3 actions beside a block that is on never approve or merge when every block was skipped", () => {
99-
const checked = checkPolicyFile(`${RULES}code-review: { on: true }\nactions:\n pass: [{ do: approve }, { do: merge }]\n`, REPO);
100-
if (!checked.ok) throw new Error("the policy file must read");
101-
const input = { triage: "pass", events: ["opened"], on: ["code-review"], outcomes: { "code-review": { outcome: "skipped" } }, author: ["everyone"] } as const;
102-
expect(decide(checked.workflow!.decide!, input)).toEqual({ do: [{ do: "nothing" }, { do: "nothing" }], rule: 1 });
97+
test("schema 3 actions beside a block that is on approve or merge only when every block is clean", () => {
98+
expect(checkPolicyFile(`${RULES}code-review: { on: true }\nactions:\n pass: [{ do: approve }, { do: merge }]\n`, REPO)).toMatchObject({
99+
ok: true,
100+
workflow: {
101+
decide: [
102+
{ if: { triage: "pass", all: "clean" }, do: [{ do: "approve" }, { do: "merge" }] },
103+
{ if: { triage: "pass" }, do: [{ do: "nothing" }, { do: "nothing" }] },
104+
{ if: { triage: "fail" }, do: "nothing" },
105+
],
106+
},
107+
});
103108
});
104109

105110
test("a file that extends another holds no v4 key, and reads with no decide", () => {

‎packages/triage-contracts/src/tarball.ts‎

Lines changed: 0 additions & 4 deletions
This file was deleted.

‎packages/triage-workflows/package.json‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77
"./*": "./src/*.ts",
88
"./evals/*": "./evals/*.ts"
99
},
10-
"interchange": {
11-
"workflow": "./src/pr-triage.ts",
12-
"directors": "./src/directors.ts",
13-
"actions": "./src/actions/index.ts"
14-
},
1510
"scripts": {
1611
"eval": "bun --conditions=intx-src evals/judge.eval.ts",
1712
"eval:scan": "bun --conditions=intx-src evals/scan.eval.ts",

‎packages/triage-workflows/src/actions/facts.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ interface Stamp {
8181
source?: PolicySource;
8282
repoSource: RepoSource;
8383
noWait: boolean;
84-
/** The policy turns a block on, so `decide` chooses the Dos once the blocks have run. */
84+
/** The mail names blocks, so the comment lists no Dos and approve and merge wait in Needs you. */
8585
blocksOn: boolean;
8686
/** The head the mail names for each pull request. */
8787
heads: Map<number, string>;

‎packages/triage-workflows/src/logic/item.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export interface Item {
2020
repoSource?: RepoSource;
2121
/** The hub waits no longer for the host's checks. */
2222
noWait?: true;
23-
/** The policy turns a block on, so `decide` chooses the Dos once the blocks have run and the comment names none. */
23+
/** The mail names blocks, so the comment lists no Dos and approve and merge wait in Needs you. */
2424
blocksOn?: true;
2525
/** The App's bot account on GitHub, whose comments and reviews are triage's own. */
2626
appLogin?: string;

‎tooling/pack-tarball.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@ import { promises as fs } from "node:fs";
33
import { tmpdir } from "node:os";
44
import path from "node:path";
55
import * as tar from "tar";
6-
import { tarballFilename } from "../packages/triage-contracts/src/tarball.js";
76

87
// npm tarballs root every file under this directory.
98
const STAGE = "package";
109

1110
type PackageManifest = { name: string; version: string } & Record<string, unknown>;
1211
export type PackedTarball = { name: string; version: string; filename: string; path: string; integrity: string };
1312

13+
/** The file name `npm pack` gives a package version. */
14+
function tarballFilename(pkg: { name: string; version: string }): string {
15+
return `${pkg.name.replace("/", "-")}-${pkg.version}.tgz`;
16+
}
17+
1418
function byName(a: { name: string }, b: { name: string }): number {
1519
if (a.name < b.name) return -1;
1620
if (a.name > b.name) return 1;

0 commit comments

Comments
 (0)