Skip to content

Commit 10f7a3d

Browse files
donjorrsi-pr-agent
authored andcommitted
fix(upstream-fixes): fork scripts drop section dividers upstream's no-low-value-comments lint refuses
Fork-Domain: upstream-fixes Fork-Tier: bugfix Fork-Upstreamable: no
1 parent 7bec9b3 commit 10f7a3d

6 files changed

Lines changed: 1 addition & 89 deletions

File tree

‎scripts/fork-delta.test.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,8 +457,6 @@ it("diverges per-commit and per-domain overlap when a domain's commits share a f
457457
);
458458
});
459459

460-
// -- Inventory CLI -------------------------------------------------------------
461-
462460
/**
463461
* A repo whose stack carries two fork-meta commits, one of them on a file upstream also changes.
464462
*/

‎scripts/fork-delta.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,6 @@ export const renderMarkdown = (ledger: ForkLedger): string => {
273273
return lines.join("\n");
274274
};
275275

276-
// -- Inventory (`--inventory`) ------------------------------------------------
277-
278276
export const ForkInventoryCommit = Schema.Struct({
279277
short: Schema.String,
280278
domain: Schema.String,

‎scripts/fork-fold.test.ts‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -451,8 +451,6 @@ it("reads fork PR refs from a subject marker, a fork pull URL, and earlier Squas
451451
]);
452452
});
453453

454-
// -- Fixture repository ---------------------------------------------------------
455-
456454
const git = (root: string, args: ReadonlyArray<string>): string =>
457455
NodeChildProcess.execFileSync("git", args, {
458456
cwd: root,
@@ -954,7 +952,7 @@ it("proves tree equality, the delta check, and the replay scan, failing on any",
954952
assert.strictEqual(run(["prove", head], root, step), 2);
955953
}));
956954

957-
// -- Publish: a local bare origin, so tests never push to a real remote ----------
955+
// Publish tests use a local bare origin, so they never push to a real remote.
958956

959957
const remoteHyprws = (root: string): string =>
960958
git(root, ["rev-parse", "refs/remotes/origin/hyprws"]);

‎scripts/fork-fold.ts‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ export const systemFoldGit = (cwd: string): FoldGit => ({
8787
}),
8888
});
8989

90-
// -- list ---------------------------------------------------------------------
91-
9290
const commitMessageArguments = (shas: ReadonlyArray<string>) =>
9391
["log", "--no-walk", "--format=%H\u001f%B\u001e", ...shas] as const;
9492

@@ -147,8 +145,6 @@ export const renderList = (stack: FoldStack): string => {
147145
return `${lines.join("\n")}\n`;
148146
};
149147

150-
// -- apply --------------------------------------------------------------------
151-
152148
const readPlan = (path: string): string => {
153149
try {
154150
return NodeFS.readFileSync(path, "utf8");
@@ -491,8 +487,6 @@ export const replay = (
491487
return { status: "applied", tip };
492488
};
493489

494-
// -- prove --------------------------------------------------------------------
495-
496490
/**
497491
* Per-commit member guard: a new commit's members are the old commits its `Squashes:` lines name
498492
* plus the old commit sharing its subject. Flags unknown `Squashes:` shas, memberless commits, paths
@@ -614,8 +608,6 @@ const prove = (git: FoldGit, step: ProveStep, base: string, oldRef: string, newR
614608
return 0;
615609
};
616610

617-
// -- publish ------------------------------------------------------------------
618-
619611
/**
620612
* The worktree with hyprws checked out — usually the main checkout — or
621613
* undefined when checked out nowhere, so there is no worktree tree to dirty.
@@ -687,8 +679,6 @@ const publish = (git: FoldGit, step: ProveStep, base: string, oldRef: string, ne
687679
return 0;
688680
};
689681

690-
// -- CLI ----------------------------------------------------------------------
691-
692682
export const run = (
693683
argv: ReadonlyArray<string>,
694684
cwd = process.cwd(),

‎scripts/fork-sync.test.ts‎

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ import { FOLD_MESSAGES_ENV, placeFixups, sequenceEditor } from "./lib/fork-sync-
3737
const ok = (stdout = ""): CommandResult => ({ status: 0, stdout, stderr: "" });
3838
const refused = (stderr: string): CommandResult => ({ status: 1, stdout: "", stderr });
3939

40-
// ---------------------------------------------------------------------------
41-
// Fixture: one upstream remote, one origin remote, a fork trunk
42-
// ---------------------------------------------------------------------------
43-
4440
interface Fixture {
4541
readonly root: string;
4642
readonly worktree: string;
@@ -158,10 +154,6 @@ const withFixture = (
158154
}
159155
};
160156

161-
// ---------------------------------------------------------------------------
162-
// Runner stub: git is real, vp/gh are recorded, GitHub CI is faked
163-
// ---------------------------------------------------------------------------
164-
165157
interface Recording {
166158
readonly runner: CommandRunner;
167159
readonly calls: ReadonlyArray<{ readonly command: string; readonly args: ReadonlyArray<string> }>;
@@ -276,10 +268,6 @@ const forkShas = (f: Fixture): { readonly fork: string; readonly upstream: strin
276268
upstream: f.git(["rev-parse", "upstream/main"], f.root),
277269
});
278270

279-
// ---------------------------------------------------------------------------
280-
// The blocked → resolve → rerun loop
281-
// ---------------------------------------------------------------------------
282-
283271
it("stops at a conflict rerere and hooks cannot resolve, then applies after a hand resolution", () => {
284272
withFixture(
285273
{
@@ -866,10 +854,6 @@ it("still blocks when the fork side deleted the path and upstream modified it",
866854
);
867855
});
868856

869-
// ---------------------------------------------------------------------------
870-
// Regenerable files
871-
// ---------------------------------------------------------------------------
872-
873857
const LOCKFILE = "pnpm-lock.yaml";
874858

875859
const lockfileFixture = (shared: { readonly fork: string; readonly upstream: string }) =>
@@ -1145,10 +1129,6 @@ it("refuses a target that is not a release tag on upstream", () => {
11451129
);
11461130
});
11471131

1148-
// ---------------------------------------------------------------------------
1149-
// Blocked publication through gh
1150-
// ---------------------------------------------------------------------------
1151-
11521132
const blockedReport = (blockingSha: string): ForkSyncReport => ({
11531133
schema: "fork.sync-report.v2",
11541134
outcome: "blocked",
@@ -1530,10 +1510,6 @@ it("records a refused close per issue and still closes the others", () => {
15301510
);
15311511
});
15321512

1533-
// ---------------------------------------------------------------------------
1534-
// Failure publication for a non-blocked failed run
1535-
// ---------------------------------------------------------------------------
1536-
15371513
const checkRedFixture = {
15381514
forkContent: "fork line1\nline2\nline3\n",
15391515
upstreamContent: "line1\nline2\nline3 upstream\n",
@@ -1729,10 +1705,6 @@ it("renders the report and the issue body as pure output of the typed report", (
17291705
assert.match(body, /git -C \/tmp\/fork-sync\/worktree add/);
17301706
});
17311707

1732-
// ---------------------------------------------------------------------------
1733-
// The clean run closing the block issues it filed
1734-
// ---------------------------------------------------------------------------
1735-
17361708
const appliedFixture = {
17371709
forkContent: "fork line1\nline2\nline3\n",
17381710
upstreamContent: "line1\nline2\nline3 upstream\n",
@@ -1847,10 +1819,6 @@ it("an already-applied run fails and records the refusal when the block close is
18471819
});
18481820
});
18491821

1850-
// ---------------------------------------------------------------------------
1851-
// Fold at sync: fixup! landings autosquash onto the tag (RSI-Software/t3code-hyprws#1179)
1852-
// ---------------------------------------------------------------------------
1853-
18541822
/** A fork stack carrying one owner plus its fixup; the sync must fold the pair. */
18551823
const foldFixture = (fixupSubject = "fixup! feat(fork): owned change"): Fixture => {
18561824
const base = NodeFS.mkdtempSync(NodePath.join(NodeOS.tmpdir(), "fork-sync-fold-"));

‎scripts/fork-sync.ts‎

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,6 @@ import {
7979
import { FIXUP_OWNERS_ENV, FOLD_MESSAGES_ENV, sequenceEditor } from "./lib/fork-sync-todo.ts";
8080
import { splitTrailerBlock } from "./lib/fork-trailers.ts";
8181

82-
// ---------------------------------------------------------------------------
83-
// Constants
84-
// ---------------------------------------------------------------------------
85-
8682
const SYNC_DIR = ".t3/fork-sync";
8783
const WORKTREE_DIR = "worktree";
8884
/** `gh` files and lists block issues only under this label; the title search does the rest. */
@@ -104,10 +100,6 @@ const failureIssueTitle = (step: string, key: string): string =>
104100
export const failureMarker = (step: string, key: string): string =>
105101
`<!-- sync-failure:${step}:${key} -->`;
106102

107-
// ---------------------------------------------------------------------------
108-
// Command runner
109-
// ---------------------------------------------------------------------------
110-
111103
export interface CommandSpec {
112104
readonly cwd: string;
113105
readonly env?: NodeJS.ProcessEnv;
@@ -171,10 +163,6 @@ const trunkSha = (runner: CommandRunner, root: string): string => {
171163
: "unknown";
172164
};
173165

174-
// ---------------------------------------------------------------------------
175-
// Typed report
176-
// ---------------------------------------------------------------------------
177-
178166
/** How a conflict row resolved: hook re-apply, an accepted net-zero delete, regeneration, or a manual resolution. */
179167
export const ConflictVia = Schema.Literals(["hook", "manual", "net-zero-delete", "regenerate"]);
180168

@@ -316,10 +304,6 @@ const writeReport = (root: string, report: ForkSyncReport): string => {
316304
export const readReport = (root: string, tag: string): ForkSyncReport =>
317305
decodeForkSyncReport(JSON.parse(NodeFS.readFileSync(reportPath(root, tag), "utf8")));
318306

319-
// ---------------------------------------------------------------------------
320-
// Target
321-
// ---------------------------------------------------------------------------
322-
323307
/**
324308
* The release tags upstream published onto `upstream/main`'s first-parent lane,
325309
* oldest first (`--reverse`), since `positionUpstreamReleaseTags` and
@@ -358,10 +342,6 @@ export const resolveTarget = (
358342
return newest;
359343
};
360344

361-
// ---------------------------------------------------------------------------
362-
// Rebase
363-
// ---------------------------------------------------------------------------
364-
365345
/**
366346
* `maintenance.auto=false`: every `git commit` the sequencer runs would
367347
* otherwise detach a `git maintenance run --auto` whose `rerere gc` holds
@@ -996,10 +976,6 @@ export const rebaseOnto = (
996976
return { ...outcome, recorded: mergeStops(carried, outcome.conflicts) };
997977
};
998978

999-
// ---------------------------------------------------------------------------
1000-
// Scrubbed environment
1001-
// ---------------------------------------------------------------------------
1002-
1003979
const VERIFICATION_ENV_KEYS = new Set([
1004980
// Vite+'s `node_modules/.bin/vp` shim exports an absolute NODE_PATH into the
1005981
// store of the checkout it belongs to; inherited, it pins module resolution
@@ -1065,10 +1041,6 @@ export const checkFailureDetail = (
10651041
return `${text.split("\n").slice(-tail).join("\n")} (exit ${result.status})`;
10661042
};
10671043

1068-
// ---------------------------------------------------------------------------
1069-
// Candidate CI
1070-
// ---------------------------------------------------------------------------
1071-
10721044
const CI_WORKFLOW = NodePath.basename(FORK_CI_WORKFLOW_PATH);
10731045
const CI_POLL_SECONDS = 30;
10741046
/** A push that has no run this long after it never will. */
@@ -1171,10 +1143,6 @@ const ciMark = (conclusion: string): string =>
11711143
const redJobs = (ci: CandidateCi): ReadonlyArray<CiJob> =>
11721144
ci.jobs.filter((job) => job.conclusion !== "success" && job.conclusion !== "skipped");
11731145

1174-
// ---------------------------------------------------------------------------
1175-
// Issue publication
1176-
// ---------------------------------------------------------------------------
1177-
11781146
export const blockingShaOf = (conflicts: ReadonlyArray<ConflictRow>): string | null =>
11791147
conflicts.find((row) => row.via === "manual")?.upstreamCommit ??
11801148
conflicts[0]?.upstreamCommit ??
@@ -1607,10 +1575,6 @@ export const closeBlocks = (
16071575
return closures;
16081576
};
16091577

1610-
// ---------------------------------------------------------------------------
1611-
// Rendering — output only, never read back
1612-
// ---------------------------------------------------------------------------
1613-
16141578
export const renderReport = (report: ForkSyncReport): string => {
16151579
const head = {
16161580
applied: "✅ applied",
@@ -1678,10 +1642,6 @@ export const renderReport = (report: ForkSyncReport): string => {
16781642
return [...rows, ...conflictTable, ...ci, ...blocks, ...decision, ...failure].join("\n");
16791643
};
16801644

1681-
// ---------------------------------------------------------------------------
1682-
// The run
1683-
// ---------------------------------------------------------------------------
1684-
16851645
export interface RunOptions {
16861646
readonly runner?: CommandRunner;
16871647
readonly root?: string;

0 commit comments

Comments
 (0)