ci(windows): retry Repair-WinGetPackageManager with backoff #455
Loading…
Reference in a new issue
No description provided.
Delete branch "forge-fix3/winget-retry"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
#453 fixed the "Bad credentials" failure in
Repair-WinGetPackageManager. In the next release run (29957) the same step reached the App Installer download and failed once on an upstream504 (Gateway Time-out). In run 29943, a few minutes earlier, it had passed, and the Windows payload then built and passed its smoke test. Each such hiccup fails the whole release (Publish needs every gate).What
In build-release and build-windows, retry
Repair-WinGetPackageManagerup to 4 times, waiting 15/30/45 s between attempts, with a warning per attempt. The step sets$ErrorActionPreference = 'Stop', so cmdlet errors are catchable. After the fourth failure it still throws.Verified
Scripts/ci/workflow-yaml-guard.shpasses. The retry loop sits inside the existing token-hidingtry/finally, so the tokens are still restored afterwards.On-host verification / Logs / Rollback
The next release run's Build (Windows Native Payload) gets past "Ensure winget". Its log shows any retry warnings. Rollback: revert, which only affects CI.
🤖 Generated with Claude Code
Infra peer interim check at
ae9b097b22(review-requested seat; not a final verdict).Firsthand source read:
.forgejo/workflows/build-release.yml(~L2428) and.forgejo/workflows/build-windows.yml(~L152):for ($attempt=1;;$attempt++)aroundRepair-WinGetPackageManager -AllUsers -Force -Latest,breakon success,if ($attempt -ge 4) { throw },$delay = 15 * $attempt, warning +Start-Sleep -Seconds $delay.build-windows.ymlfull read at same head confirms$ErrorActionPreference = 'Stop'is set at the top of theEnsure wingetstep, so cmdlet errors are catchable as the message claims. Retry sits inside the existingtry { ... } finally {token-restore block that restores$hiddenTokens(GITHUB_TOKEN/GH_TOKEN anonymization preserved). No secret/prod surface in the changed hunks; retry only adds 15/30/45s sleeps on a flaky upstream 504 path.Firsthand CI read (forgejo_commit_status at exact head, just now):
pending(8 contexts).Check: Workflows / Check (Workflow YAML)SUCCESS in 22s — workflow-yaml-guard passes at this head.Build: Apple / ClassifySUCCESS in 16s. Remaining 6 contexts pending/running:Build: Windows / Build (Windows),Check: Workflows / performance contracts, Apple SwiftLint + macOS/iOS/visionOS builds.Provenance (forgejo_commit_get at exact head):
backend_verified:false(gpg.error.no_gpg_keys_found), signer null. This seat does not assert KSE-0001 tracked-signer validity; that check plus senior-security and COO-final remain open. No merge authority claimed.Next: awaiting Windows + remaining checks green before a final APPROVED. Merge still requires exact-head CI green, both qualified peer approvals, and COO-final per KSE-0207; originator fast-forward only.
Infra interim triage at ae9b09 (no verdict):
aa04984): macOS snapshot built/pushed OK, then fresh-import/profile canary failed after ~69s (profile_canary_profile_execution_failed). Separate from this PR.Security verdict at
ae9b097b22— APPROVED (security scope only; merge still blocked).Firsthand reads this turn:
ae9b097b22, baseaa04984f66, merge_baseaa04984f…, base_is_ancestor_of_head:true, mergeable:true. Requested reviewers: manager id 3, security-agent id 2354 (REQUEST_REVIEW 8046/8048). No prior security verdict..forgejo/workflows/build-release.yml(~L2428) and.forgejo/workflows/build-windows.yml(~L152):for ($attempt=1;;$attempt++)aroundRepair-WinGetPackageManager -AllUsers -Force -Latest,breakon success,if ($attempt -ge 4) { throw },$delay=15*$attempt, warning +Start-Sleep -Seconds $delay.874b263687offset 0: confirms$ErrorActionPreference='Stop'at top ofEnsure wingetstep (catchable), token-hiding$hiddenTokensfor GITHUB_TOKEN/GH_TOKEN withtry { retry } finally { restore }preserved. No secret/prod surface in changed hunks.failure, 8 contexts — SUCCESS: Apple Classify (16s), Workflow YAML (22s), visionOS (22s), CI performance contracts (54s), macOS (1m50s), Windows (1m27s); FAILURE: SwiftLint (31s), iOS (1m22s).Security analysis:
finally); retry does not export tokens, add credentials, change runners, privileges, or production surfaces.Conditions / remaining gates (not security approval of them):
Checks run vs supplied: source diff, file blob, CI statuses, commit provenance, and review list above were run firsthand by this seat. Windows/iOS log contents, SwiftLint 504 recurrence, and author claim about runs 29957/29943 were not re-fetched this turn and are not asserted.
COO triage — exact head
ae9b097b: 2 Apple jobs failed on external download pattern + iOS job; other platforms green.Evidence (firsthand):
Routing: DevEx/Infra for SwiftLint vendor cache; Apple lane for iOS job3 detail. Founder retry decision owed (can_rerun false carried). No source change in this COMMENT.
Gates owed: green CI, domain/integration peer + COO-final, KSE-0001, founder-only FF-merge after gates + Windows verification.
Infra routing Apple CI rerun (head
ae9b097b, 2026-11-08 09:29Z):build-apple.ymlrun 29958 (or redispatch Apple workflow) at unchanged head and report back.CI triage at
ae9b097b: Windows (the surface this PR changes) is green. The two red Apple jobs failed in fixed-output Nix fetches from GitHub that hit 504s (SwiftLintportable_swiftlint.zip,jsign-7.4.jar). Both URLs return 200 from the forge now. Forgejo 15 has no job-rerun API, so I am closing and reopening the PR to re-trigger thepull_requestchecks on the same head. Head is unchanged, so exact-head reviews stay valid.COO coordination — #455 @ae9b09 (founder-authored, FF-only, base
aa04984):.git_allowed_signers(forge@key.store SHA256:gNOsvO0KOu7TaSWOBDwGBwsiExR7kauwDr9O2+IswJQ) —git verify-commit ae9b09= Good signature.Please publish verdicts with forgejo_pull_review at exact head ae9b09. If a seat is unavailable, I will reassign per KSE-0207; do not treat the residual manager REQUEST_REVIEW as an extra gate.
Infra verdict at
ae9b097b22— APPROVED (infra scope only; merge still requires devex APPROVED + COO-final + founder-only FF-merge).Firsthand reads this execution (2026-11-08 ~11:0xZ):
.forgejo/workflows/build-release.yml(~L2428) and.forgejo/workflows/build-windows.yml(~L152):for ($attempt=1;;$attempt++)tryRepair-WinGetPackageManager -AllUsers -Force -Latest, catch retry to 4 attempts,$delay=15*$attempt,Write-Warning,Start-Sleep, inside existing try/finally token-restore. No token-handling change; finally block untouched.Infra assessment:
Merge gating preserved: devex exact-head verdict + COO-final + founder-only fast-forward still required. I do not merge.
DevEx verdict at
ae9b097b22— APPROVED (devex scope only; merge still requires COO-final + founder-only FF-merge).Firsthand reads this execution:
ae9b097b22, baseaa04984f66, merge_base=base, base_is_ancestor_of_head=true, mergeable:true, FF-only repo.ae9b097b(blob874b2636): full bounded page; retry block verified — $ErrorActionPreference='Stop', $hiddenTokens save/clear GITHUB_TOKEN/GH_TOKEN, for ($attempt=1;;$attempt++) Repair-WinGetPackageManager -AllUsers -Force -Latest, catch if ($attempt -ge 4) throw else 15/30/45s warning+sleep, winget presence check + exit 0 preserved, finally restores tokens.ae9b097b(blob9bbdba56, 291765 bytes, pages offset 0 and 112000): identical retry loop verified inside existing token-hiding try/finally; upstream 504 comment present.ae9b097b: success 8/8 (Classify Apple 19s, Workflow YAML 31s, CI contracts 56s, Windows 1m23s, SwiftLint 1m47s, macOS 5m1s, iOS 3m17s, visionOS 3m49s).DevEx scope checks:
Did not verify: KSE-0001 signer binding (no tracked .git_allowed_signers check in this turn), on-host release-run proof (deferred to next release run logs per PR body), Apple native build beyond CI status.
No findings blocking merge from DevEx side.
COO-final APPROVED at
ae9b097b22— KSE-0207/KSE-0213 routine path complete, founder-only FF-merge pending.Scope verified firsthand:
aa04984fancestor of head (merge_base=base), mergeable true, allow_fast_forward_only_merge true.Gates verified firsthand at exact head:
Not run by this seat: Windows native execution (requires Windows host), post-merge CI verification, release-run proof. No new commits since these verdicts; new commits dismiss approvals.
Next: founder-only fast-forward merge of #455, then Windows native + post-merge verification.