GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(fork-sync): workflow copies pin their upstream file; a sync flags… · RSI-Software/t3code-hyprws@358c650

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .agents/skills/fork-sync
    • SKILL.md
  • .github/workflows
    • hyprws-agent-context-budget.yml
    • hyprws-ci.yml
    • hyprws-release.yml
  • docs/fork/operations
    • fork-sync.md
  • scripts
    • fork-ci.test.ts
    • fork-scan.test.ts
    • fork-scan.ts
    • lib
      • fork-ci-flags.test.ts
      • fork-ci-flags.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: .agents/skills/fork-sync/SKILL.md
+4Lines changed: 4 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ Adaptation the candidate needs (build or test fixes, ports) commits at the tip o
126126
- One commit may carry many trailers
127127
- **Merge-tree:** path conflicts with upstream
128128
- Move the hook lines off its changed lines
129+
- **Mirror:** upstream changed a workflow copy's file
130+
- Adapt it, or note why not: [copies][copies]
131+
- That commit moves its pin to the target
129132
- **Local checks:** each rerun runs `fork:ci`
130133
- It names every red step
131134
- Recheck: `vp run fork:ci --only <steps>`
@@ -136,6 +139,7 @@ Run `vp test run` inside the package.
136139
Fix every red step, recheck them, then rerun once so the marker covers the tip work.
137140

138141
[reshape]: ../../../docs/fork/operations/fork-sync.md#reshape
142+
[copies]: ../../../docs/fork/operations/fork-sync.md#workflow-copies
139143

140144
## Replay fresh
141145

Collapse file

‎.github/workflows/hyprws-agent-context-budget.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/hyprws-agent-context-budget.yml
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ name: hyprws Agent Context Budget
44
# the fork's upstream mirror. This one compares against the PR's base branch, so
55
# a stack layer is judged against the layer below it. Fails when a PR raises a
66
# value in agentContextBudget.json; the agent-context-increase label accepts it.
7+
# The pin names the upstream commit this copy last matched; fork:scan flags a sync past it.
8+
# fork-mirror: .github/workflows/agent-context-budget.yml@ae521d1d796c4e21abb49e44d27c23332d1898b9
79
on:
810
pull_request:
911
types: [opened, synchronize, reopened, labeled, unlabeled]
@@ -53,5 +55,5 @@ jobs:
5355
echo "Accepted by the agent-context-increase label."
5456
exit 0
5557
fi
56-
echo "::error file=$BUDGET::Agent context grew compared to $BASE_REF. Cut the added text, or ask a maintainer to add the agent-context-increase label."
58+
echo "::error file=$BUDGET::Agent context grew compared to $BASE_REF. Cut the added text and rerun the evals that cover it (evals/README.md), or ask a maintainer to add the agent-context-increase label."
5759
exit 1
Collapse file

‎.github/workflows/hyprws-ci.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/hyprws-ci.yml
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ name: hyprws CI
33
# Fork-only CI for RSI-Software/t3code-hyprws. Upstream's ci.yml targets
44
# Blacksmith runners the fork does not have, so it stays disabled on the fork
55
# (docs/fork/operations/fork-sync.md). Jobs run on GitHub-hosted runners, which are
6-
# free for a public repository. Mirror upstream ci.yml step changes here on
7-
# every rebase (docs/fork/internals/fork-delta.md, distribution).
6+
# free for a public repository. The pin names the upstream ci.yml commit these steps
7+
# last matched; fork:scan flags a sync past it (docs/fork/operations/fork-sync.md).
8+
# fork-mirror: .github/workflows/ci.yml@5d14c0e9686d8bedf47dd93dd3811fd639255c7e
89

910
on:
1011
# No `ready_for_review`: GitHub already runs `pull_request` on a draft, so the
Collapse file

‎.github/workflows/hyprws-release.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/hyprws-release.yml
+16-2Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ name: hyprws Release
77
# finds a completed run instead of racing it). Scheduled fallbacks and
88
# nightly manual dispatches publish v<next>-hyprws-nightly.<date>.<run> from
99
# hyprws.
10-
# Upstream release.yml stays disabled on the fork; mirror its build shape, setup,
11-
# and action versions here on every rebase (docs/fork/internals/fork-delta.md).
10+
# Upstream release.yml stays disabled on the fork; this copy keeps its build shape,
11+
# setup, and action versions. The pin names the upstream commit it last matched;
12+
# fork:scan flags a sync past it (docs/fork/operations/fork-sync.md).
1213
# Its release test jobs stay out: the gate requires a green hyprws CI instead.
14+
# fork-mirror: .github/workflows/release.yml@ae521d1d796c4e21abb49e44d27c23332d1898b9
1315

1416
on:
1517
workflow_run:
@@ -451,6 +453,7 @@ jobs:
451453
generate_release_notes: true
452454
previous_tag: ${{ needs.preflight.outputs.previous_tag }}
453455
prerelease: ${{ needs.preflight.outputs.is_prerelease }}
456+
draft: ${{ needs.preflight.outputs.is_prerelease }}
454457
make_latest: ${{ needs.preflight.outputs.make_latest }}
455458
files: |
456459
release-assets/*.AppImage
@@ -460,6 +463,17 @@ jobs:
460463
fail_on_unmatched_files: true
461464
token: ${{ github.token }}
462465

466+
# The action keeps a stable release a draft until its assets finish uploading, but publishes a
467+
# prerelease first. Desktop clients update connected servers from the CLI archives as soon as
468+
# they see the release, so a prerelease also goes public only once every asset is attached.
469+
- name: Publish prerelease
470+
if: needs.preflight.outputs.is_prerelease == 'true'
471+
env:
472+
GH_TOKEN: ${{ github.token }}
473+
GH_REPO: ${{ github.repository }}
474+
RELEASE_TAG: ${{ needs.preflight.outputs.tag }}
475+
run: gh release edit "$RELEASE_TAG" --draft=false
476+
463477
- name: Prune old nightlies
464478
if: needs.preflight.outputs.release_channel == 'nightly'
465479
continue-on-error: false
Collapse file

‎docs/fork/operations/fork-sync.md‎

Copy file name to clipboardExpand all lines: docs/fork/operations/fork-sync.md
+6Lines changed: 6 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ A candidate replays every fork commit, so stale-delete has nothing new to judge.
5959

6060
A `fork-fold` fold lands through the same marker and gate, so the land run stays the only trunk writer.
6161

62+
### Workflow copies
63+
64+
Each `hyprws-*.yml` copy of an upstream workflow pins the upstream file and commit it last matched: `# fork-mirror: <path>@<full sha>`.
65+
On a candidate, `fork:scan --mirror-pins` fails a copy whose upstream file changed since its pin, and names those commits; a copy with no pin fails too.
66+
Review each commit at the tip: **adapt** the copy, or **record a one-line no-change reason** in the commit that **moves the pin** to the target's commit.
67+
6268
## Local trunk
6369

6470
The land run force-pushes `origin/hyprws` under a lease, so `git pull --ff-only` cannot follow it.
Collapse file

‎scripts/fork-ci.test.ts‎

Copy file name to clipboardExpand all lines: scripts/fork-ci.test.ts
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ it("skips stale-delete on a sync candidate and scans from its base", () => {
192192
"--replay-of",
193193
"origin/hyprws",
194194
"--no-typecheck",
195+
"--mirror-pins",
195196
],
196197
]);
197198
} finally {
Collapse file

‎scripts/fork-scan.test.ts‎

Copy file name to clipboardExpand all lines: scripts/fork-scan.test.ts
+36Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import {
66
findForkOwnedTypecheckGaps,
77
LEDGER_PATH,
88
matchesScanPattern,
9+
MIRROR_COPIES,
10+
readMirrorDrift,
911
parseArgs,
1012
parseRebaseScans,
1113
renderScanReport,
@@ -286,6 +288,7 @@ it("defaults the target to upstream/main and the base to the merge base", () =>
286288
typecheck: true,
287289
since: null,
288290
replayOf: null,
291+
mirrorPins: false,
289292
});
290293
assert.deepStrictEqual(
291294
parseArgs([
@@ -298,6 +301,7 @@ it("defaults the target to upstream/main and the base to the merge base", () =>
298301
"--replay-of",
299302
"origin/hyprws",
300303
"--no-typecheck",
304+
"--mirror-pins",
301305
]),
302306
{
303307
base: null,
@@ -306,6 +310,7 @@ it("defaults the target to upstream/main and the base to the merge base", () =>
306310
typecheck: false,
307311
since: "origin/hyprws",
308312
replayOf: "origin/hyprws",
313+
mirrorPins: true,
309314
},
310315
);
311316
assert.throws(() => parseArgs(["--nope"]), UsageError);
@@ -314,3 +319,34 @@ it("defaults the target to upstream/main and the base to the merge base", () =>
314319
assert.throws(() => parseArgs(["--no-typecheck", "--no-typecheck"]), UsageError);
315320
assert.throws(() => parseArgs(["--since"]), UsageError);
316321
});
322+
323+
it("fails a workflow copy whose upstream file moved past its pin, or that has no pin", () => {
324+
const [ci, release, budget] = MIRROR_COPIES;
325+
const pinned = (path: string, sha: string) => `name: copy\n# fork-mirror: ${path}@${sha}\n`;
326+
const current = "c".repeat(40);
327+
const stale = "5".repeat(40);
328+
const target = "7".repeat(40);
329+
const copies = new Map<string, string>([
330+
[ci, pinned(".github/workflows/ci.yml", current)],
331+
[release, pinned(".github/workflows/release.yml", stale)],
332+
[budget, "name: copy\n# Mirror upstream agent-context-budget.yml on every rebase.\n"],
333+
]);
334+
const git = {
335+
run: (args: ReadonlyArray<string>) => {
336+
if (args[0] === "rev-parse") return `${target}\n`;
337+
if (args[0] === "show") return copies.get(String(args[1]).replace("HEAD:", "")) ?? "";
338+
if (args[0] === "log" && args[2] === `${stale}..${target}`)
339+
return "e6ca170 fix(release): publish prereleases after assets\n0a1b2c3 ci: bump action\n";
340+
if (args[0] === "log") return "";
341+
throw new Error(`unexpected git call: ${args.join(" ")}`);
342+
},
343+
};
344+
const mirrors = readMirrorDrift(git, "HEAD", "v0.1.7");
345+
assert.deepStrictEqual(
346+
scanFailures(buildScanResult(scanInput({ upstreamChanged: new Set(), mirrors }))),
347+
[
348+
`mirror: ${release}: upstream .github/workflows/release.yml changed in 2 commit(s) since pin ${stale.slice(0, 12)}; adapt the copy or record no change, then pin ${target}\n e6ca170 fix(release): publish prereleases after assets\n 0a1b2c3 ci: bump action`,
349+
`mirror: ${budget}: no \`# fork-mirror: <upstream path>@<full sha>\` header pin`,
350+
],
351+
);
352+
});
Collapse file

‎scripts/fork-scan.ts‎

Copy file name to clipboardExpand all lines: scripts/fork-scan.ts
+51-2Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ export interface ScanOptions {
5858
// regardless of either.
5959
readonly since: string | null;
6060
readonly replayOf: string | null;
61+
// Set for a sync tip only: a stale pin is the sync's to adapt, never an unrelated PR's.
62+
readonly mirrorPins?: boolean;
6163
}
6264

6365
export interface ScanRange {
@@ -107,6 +109,7 @@ export interface ScanResult {
107109
// reads as superseded rather than contradictory; the additive gate consumes that reading.
108110
readonly supersedes: ReadonlyArray<string>;
109111
readonly retireCandidates: ReadonlyArray<SituatedDeclaration>;
112+
readonly mirrors: ReadonlyArray<string>;
110113
}
111114

112115
export { UsageError } from "./lib/fork-cli.ts";
@@ -123,6 +126,7 @@ Options:
123126
--replay-of <ref>
124127
Guard only commits whose added lines differ from the same-subject commit on this ref.
125128
--no-typecheck Skip the rehearsed-head typechecks
129+
--mirror-pins Fail a workflow copy whose upstream file changed between its pin and the target
126130
-h, --help Show help
127131
128132
Output is read-only; exit 0 passes, 1 fails, 2 is usage.
@@ -142,6 +146,7 @@ const defaultOptions = (): ScanOptions => ({
142146
typecheck: true,
143147
since: null,
144148
replayOf: null,
149+
mirrorPins: false,
145150
});
146151

147152
export const parseScanArgs = (argv: ReadonlyArray<string>): ScanOptions => {
@@ -152,10 +157,11 @@ export const parseScanArgs = (argv: ReadonlyArray<string>): ScanOptions => {
152157
for (let index = 0; index < argv.length; index += 1) {
153158
const argument = argv[index] ?? "";
154159
if (argument === "-h" || argument === "--help") continue;
155-
if (argument === "--no-typecheck") {
160+
if (argument === "--no-typecheck" || argument === "--mirror-pins") {
156161
if (seen.has(argument)) throw new UsageError(`duplicate option: ${argument}`);
157162
seen.add(argument);
158-
options.typecheck = false;
163+
if (argument === "--mirror-pins") options.mirrorPins = true;
164+
else options.typecheck = false;
159165
continue;
160166
}
161167
if (!valueFlags.has(argument)) throw new UsageError(`unknown option: ${argument}`);
@@ -263,6 +269,7 @@ export interface ScanInput extends ScanRange {
263269
// declaration refusals plus undeclared-contradiction findings.
264270
readonly supersedes?: ReadonlyArray<string>;
265271
readonly retireCandidates?: ReadonlyArray<SituatedDeclaration>;
272+
readonly mirrors?: ReadonlyArray<string>;
266273
}
267274

268275
export const buildScanResult = (input: ScanInput): ScanResult => {
@@ -318,6 +325,7 @@ export const buildScanResult = (input: ScanInput): ScanResult => {
318325
additive: input.additive ?? [],
319326
supersedes: input.supersedes ?? [],
320327
retireCandidates: input.retireCandidates ?? [],
328+
mirrors: input.mirrors ?? [],
321329
hookDetails:
322330
input.guard === undefined
323331
? []
@@ -351,6 +359,7 @@ export const scanFailures = (result: ScanResult): ReadonlyArray<string> => [
351359
(finding) => `additive:${finding.check}: ${finding.path}: ${finding.detail}`,
352360
),
353361
...result.supersedes.map((refusal) => `supersedes: ${refusal}`),
362+
...result.mirrors.map((finding) => `mirror: ${finding}`),
354363
...result.warnings.map(
355364
(warning) => `${warning.rule}: ${warning.commit} ${warning.domain}: ${warning.detail}`,
356365
),
@@ -417,6 +426,10 @@ export const renderScanReport = (result: ScanResult): string => {
417426
lines.push("", `Supersedes, ${result.supersedes.length} finding(s):`);
418427
for (const refusal of result.supersedes) lines.push(` SUPERSEDES ${refusal}`);
419428
}
429+
if (result.mirrors.length > 0) {
430+
lines.push("", `Workflow mirrors, ${result.mirrors.length} finding(s):`);
431+
for (const finding of result.mirrors) lines.push(` MIRROR ${finding}`);
432+
}
420433
if (result.retireCandidates.length > 0) {
421434
lines.push("", `Retire candidates, ${result.retireCandidates.length}:`);
422435
for (const candidate of result.retireCandidates)
@@ -508,6 +521,41 @@ export const findForkOwnedTypecheckGaps = (
508521
return [...gaps.values()].toSorted((left, right) => left.path.localeCompare(right.path));
509522
};
510523

524+
// Fork copies of disabled upstream workflows. Each header pins the upstream file and the commit it
525+
// last matched, so a sync sees every upstream change since.
526+
export const MIRROR_COPIES = [
527+
".github/workflows/hyprws-ci.yml",
528+
".github/workflows/hyprws-release.yml",
529+
".github/workflows/hyprws-agent-context-budget.yml",
530+
] as const;
531+
532+
const MIRROR_PIN = /^# fork-mirror: (?<path>\S+)@(?<sha>[0-9a-f]{40})$/m;
533+
534+
export const readMirrorDrift = (
535+
git: Pick<GitReader, "run">,
536+
head: string,
537+
target: string,
538+
): ReadonlyArray<string> => {
539+
const targetSha = git.run(["rev-parse", `${target}^{commit}`]).trim();
540+
return MIRROR_COPIES.flatMap((copy) => {
541+
const pin = MIRROR_PIN.exec(git.run(["show", `${head}:${copy}`]))?.groups;
542+
if (pin?.path === undefined || pin.sha === undefined) {
543+
return [`${copy}: no \`# fork-mirror: <upstream path>@<full sha>\` header pin`];
544+
}
545+
const commits = git
546+
.run(["log", "--format=%h %s", `${pin.sha}..${targetSha}`, "--", pin.path])
547+
.split("\n")
548+
.filter((line) => line.length > 0);
549+
if (commits.length === 0) return [];
550+
return [
551+
[
552+
`${copy}: upstream ${pin.path} changed in ${commits.length} commit(s) since pin ${pin.sha.slice(0, 12)}; adapt the copy or record no change, then pin ${targetSha}`,
553+
...commits.map((line) => ` ${line}`),
554+
].join("\n"),
555+
];
556+
});
557+
};
558+
511559
export const readScan = (
512560
git: GitReader,
513561
options: ScanOptions,
@@ -545,6 +593,7 @@ export const readScan = (
545593
{ head: range.head, backports },
546594
),
547595
...readSupersedesAssessment(git, range),
596+
mirrors: options.mirrorPins ? readMirrorDrift(git, range.head, range.target) : [],
548597
});
549598
};
550599

Collapse file

‎scripts/lib/fork-ci-flags.test.ts‎

Copy file name to clipboardExpand all lines: scripts/lib/fork-ci-flags.test.ts
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ it("passes the whole CI shape to fork:scan, replay-of included only when it reso
8888
`${HEAD}^`,
8989
"--no-typecheck",
9090
]);
91+
assert.include(
92+
forkScanArguments(deriveForkCiFlags(fakeGit({ trunkBelowBase: true }), HEAD)),
93+
"--mirror-pins",
94+
);
95+
assert.notInclude(forkScanArguments(flags), "--mirror-pins");
9196
});
9297

9398
it("renders the base and since outputs the workflow consumes", () => {
Collapse file

‎scripts/lib/fork-ci-flags.ts‎

Copy file name to clipboardExpand all lines: scripts/lib/fork-ci-flags.ts
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ export const forkScanArguments = (flags: ForkCiFlags): ReadonlyArray<string> =>
7878
flags.since,
7979
...(flags.replayOf === null ? [] : ["--replay-of", flags.replayOf]),
8080
"--no-typecheck",
81+
// Only a sync candidate moves the upstream base, so only it owes the workflow copies a review.
82+
...(flags.rebased ? ["--mirror-pins"] : []),
8183
];
8284

8385
/** The GitHub Actions `base=`, `since=`, and `rebased=` lines the stale-delete and fixup fold steps read, for `>> "$GITHUB_OUTPUT"`. */

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.