Skip to content

Commit 0d463ba

Browse files
donjor-agent[bot]donjor
authored andcommitted
fix(fork-sync): the driver adds the upstream remote, and the skill allows its kept worktree (#1897)
## Problem The first job run on #1896 blocked in 2.5 minutes on two setup gaps: - **No `upstream`:** the clone lacks it; fetch fails - **Skill:** forbids the driver's kept worktree ## Change - **Driver:** adds a missing `upstream` remote - **Sync job:** drops its `Add upstream` step - **Skill Job block:** drops the remote-add line - **Skill disk rule:** allows the kept worktree ## Scope and approval Blockers found by the rsi-pr-agent job run for #1886. Refs #1886 ## Verification - **New test:** a clone with no `upstream` syncs - **Without the fix:** fails as the job did - `vp run fork:ci` → exit 0 Claude Opus 5.5 via Claude Code. ## Fork trailers Fork-Domain: fork-meta Fork-Tier: bugfix Fork-Upstreamable: no Co-authored-by: donjor <[email protected]>
1 parent 9701f0c commit 0d463ba

4 files changed

Lines changed: 38 additions & 6 deletions

File tree

‎.agents/skills/fork-sync/SKILL.md‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ The `rsi:fork-sync` label starts it on the attention issue.
172172
No human reviews it: candidate CI gates the landing.
173173

174174
```sh
175-
git remote get-url upstream || git remote add upstream https://github.com/pingdotgg/t3code.git
176175
mkdir -p /tmp/fork-bin && ln -sf "$PWD/node_modules/.bin/vp" /tmp/fork-bin/vp
177176
PATH=/tmp/fork-bin:$PATH vp run fork:sync <tag>
178177
```
@@ -186,8 +185,8 @@ PATH=/tmp/fork-bin:$PATH vp run fork:sync <tag>
186185

187186
The summary ends with `Verify:` and those items: behaviour to exercise once the sync lands.
188187

189-
**One checkout.** The job's disk holds one install, about 8 GiB.
190-
Never clone, copy, or add a worktree.
188+
**Disk.** The job's disk holds one install, about 8 GiB.
189+
The driver's kept worktree is the only other checkout; never clone, copy, add another, or run a second install.
191190

192191
**Budget.** The job has 45 minutes, and a killed job saves nothing.
193192

‎.github/workflows/hyprws-upstream-sync.yml‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,6 @@ jobs:
135135
cache: true
136136
run-install: true
137137

138-
- name: Add upstream
139-
run: git remote add upstream https://github.com/pingdotgg/t3code.git
140-
141138
- name: Configure Git identity and rerere
142139
run: |
143140
git config user.name "github-actions[bot]"

‎scripts/fork-sync.test.ts‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,6 +1357,33 @@ it("exits 0 with already applied when the fork sits on the tag", () => {
13571357
);
13581358
});
13591359

1360+
it("adds the upstream remote a fresh clone lacks, then syncs", () => {
1361+
withFixture(
1362+
{
1363+
forkContent: "line1\nline2 fork\nline3\n",
1364+
upstreamContent: "line1\nline2 upstream\nline3\n",
1365+
forkOnTag: true,
1366+
},
1367+
(f) => {
1368+
const local = f.git(["remote", "get-url", "upstream"], f.root);
1369+
f.git(["remote", "remove", "upstream"], f.root);
1370+
// Route the real upstream URL to the fixture's bare repository.
1371+
f.git(
1372+
["config", `url.${local}.insteadOf`, "https://github.com/pingdotgg/t3code.git"],
1373+
f.root,
1374+
);
1375+
const { runner } = exec();
1376+
const code = capture(() => run(["v1.0.0"], { runner, root: f.root })).value;
1377+
assert.strictEqual(code, 0);
1378+
assert.strictEqual(readReport(f.root, "v1.0.0").outcome, "already-applied");
1379+
assert.strictEqual(
1380+
f.git(["config", "remote.upstream.url"], f.root),
1381+
"https://github.com/pingdotgg/t3code.git",
1382+
);
1383+
},
1384+
);
1385+
});
1386+
13601387
it("picks the newest upstream release tag when no tag is given", () => {
13611388
withFixture(
13621389
{

‎scripts/fork-sync.ts‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import {
3939
selectNewestReleaseTag,
4040
SYNC_CANDIDATE_BRANCH,
4141
SYNC_RESOLUTION_BRANCH,
42+
UPSTREAM_REPOSITORY,
4243
} from "./lib/fork-policy.ts";
4344
import {
4445
git,
@@ -1949,6 +1950,14 @@ export const run = (argv: ReadonlyArray<string>, options: RunOptions = {}): numb
19491950

19501951
try {
19511952
// fetch — the tag list, the trunk lease, and the marker all come from the remotes
1953+
// A fresh clone (the job's, Actions') has no upstream remote; an existing one is the session's.
1954+
if (gitResult(runner, root, ["remote", "get-url", "upstream"]).status !== 0)
1955+
git(runner, root, [
1956+
"remote",
1957+
"add",
1958+
"upstream",
1959+
`https://github.com/${UPSTREAM_REPOSITORY}.git`,
1960+
]);
19521961
git(runner, root, ["fetch", "--tags", "--force", "upstream"]);
19531962
git(runner, root, ["fetch", "origin", HYPRWS_BRANCH]);
19541963
const expectedOld = git(runner, root, ["rev-parse", `origin/${HYPRWS_BRANCH}`]);

0 commit comments

Comments
 (0)