FLT-322 brief: wire the smoke gate into sync-push in shadow (Susie Franny)¶
sync-push.ps1 runs on every push in the fleet. Today a failure in this wiring would stop the whole family's work, so the first rule is that nothing this adds may change whether, or how, the push and the peer pulls happen. The gate observes only.
Working directory: C:\Users\fives\source\repos\fleet-repo-sync-wt\WT-0cdb-FLT-322, branch wt/WT-0cdb/FLT-322. Edit sync-push.ps1, add tests/sync-push-shadow.Tests.ps1, write docs/flt-322-sync-push-report.md. Do not push.
Change sync-push.ps1¶
Before the git push at line 39, when -NoPush is not set, run the gate best effort:
- New param
[string]$ForgeSmokePath, default$HOME\.forge\smoke\bin\forge-smoke.exe. New switch-SkipPeers, which skips the peerschtasksloop. It exists so tests can never trigger real machines. Test-Paththe binary. Absent: logSkipped, reasonabsent, go straight to the push.- Run
verify --repo <path> --commit <HEAD sha> --base <base>with a 5 second limit, then, for the same commit,publish --repo <path> --commit <sha> --remote <origin url>with a 15 second limit.<base>isorigin/HEADif it resolves, otherwiseorigin/<branch>. If neither resolves, use forty zeros, which the gate reads as the full tree. - Start each with
Start-Process -WindowStyle Hidden -PassThru, redirecting stdout and stderr to temp files, never pipes, so a grandchild holding a pipe cannot hang the push. Bound the wait withWaitForExit(ms). On timeout, kill by the PID this script started, withtaskkill /T /F /PID, hidden. This script runs under Windows PowerShell 5.1, whereProcess.Kill($true)does not exist. It must also run underpwsh. - Wrap everything in one
try/catch. Any throw logsSkippedwith the reason, and the push proceeds. Restore the current directory. Do not leave$LASTEXITCODEfrom the gate visible to the push line, and do not touch$ErrorActionPreference. - Append one JSON line per run to
$HOME\.forge\smoke\sync-push-shadow.jsonl: UTC time, repo, branch, sha, gate result (Pass,Block,CannotRun, orSkippedwith a reason),wouldBlock, reason codes, and wall milliseconds for each call. A failure writing this line is itself swallowed.FORGE_SMOKE_HOMErelocates this file if set. Never writePassfor anything the gate did not report as a pass. - Print one line, such as
forge-smoke (shadow): Block wouldBlock=true Missing, 412 ms. Never make it look like a push failure. - The gate's exit code never affects this script's. Shadow means exit 0 from the gate anyway, but treat any exit the same.
Keep the existing output lines unchanged. Keep the edit small: one helper function plus one call.
Tests: tests/sync-push-shadow.Tests.ps1¶
Follow tests/fleet-repo-sync.Tests.ps1: real bare origin, real clone, the script run as a child process under $env:FRS_TEST_HOST. Always pass -SkipPeers -SkipMacs. No test may reach a real machine or the real ~/.forge: set FORGE_SMOKE_HOME. Stand-in gates are small .cmd scripts in $TestDrive, passed through -ForgeSmokePath.
Each case asserts that the origin branch moved to the new commit, as well as the log line:
Absent binary: pushes, logsSkippedabsent.Gate exits 1 with garbage output: pushes, logsSkippedwith a parse reason, notPass.Gate hangs: a script that sleeps 120 seconds. Pushes, logsSkippedtimeout, whole run bounded under 40 seconds, and the stand-in process is gone afterward.Gate holds stdout with a detached grandchild: pushes, bounded the same way.Gate reports Block: pushes, logsBlock,wouldBlocktrue.Gate reports Pass: pushes, logsPass.Log directory not writable: pushes.-NoPush: the gate does not run.
Check¶
powershell -NoProfile -Command "$env:FRS_TEST_HOST='powershell'; Invoke-Pester tests/sync-push-shadow.Tests.ps1 -Output Detailed"
Run it under pwsh as well if your sandbox allows. Keep every window hidden. If your sandbox refuses a call, state exactly which one and stop on that case. Do not substitute an edited test or a private runner and call the result a pass. The orchestrator re-runs everything in a normal shell.
Report¶
docs/flt-322-sync-push-report.md: real output, anything that does not pass, and any way this could still stop or delay a push beyond the 20 second bound. Commit by exact path. Message starts FLT-322: and ends with Co-Authored-By: Susie Franny (Muse) <noreply@meta.com>.