Skip to content

ci(winget): stop swallowing the fork-sync failure, and record the real cause - #118

Merged
AThraen merged 1 commit into
mainfrom
ci/winget-sync-must-not-fail-silently
Sep 6, 2026
Merged

ci(winget): stop swallowing the fork-sync failure, and record the real cause#118
AThraen merged 1 commit into
mainfrom
ci/winget-sync-must-not-fail-silently

Conversation

@AThraen

@AThraen AThraen commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Why

The fork-sync step in winget.yml was continue-on-error: true. That flag is why the same winget failure has been diagnosed from scratch three releases running — the sync failed silently every time, and the only error anyone ever saw was the misleading one from the submit step.

The actual chain

WINGET_TOKEN lacks `workflow` scope
  -> merge-upstream returns HTTP 422, because upstream winget-pkgs contains
     .github/workflows/*.yml and syncing means writing them
  -> our fork stays stale
  -> SUBMIT reports "does not have the correct permissions to execute CreateRef"

Nothing in that final message mentions the sync, the fork, or the scope — which is exactly how it kept sending the investigation after the wrong thing.

Changes

  • Drop continue-on-error from the sync step. The original rationale ("a hiccup shouldn't block a submit that might still succeed") doesn't hold: a stale fork is the one condition that guarantees the submit will fail. Failing here surfaces the honest error instead of the confusing one.
  • Document the real token requirement — classic PAT with both public_repo and workflow — in the workflow header, at the sync step, and in CLAUDE.md.
  • Correct two wrong claims in CLAUDE.md. It said "this is almost never a token problem" and "public_repo is sufficient". Both were written in good faith after v0.6.0; both are wrong, and both steered the v0.7.0 diagnosis away from the answer. The warning against widening to full repo stays — that remains the wrong fix.

Risk

None for a correctly-scoped token: merge-upstream on an up-to-date fork returns none/"not behind" and exits 0. With a wrongly-scoped token the job now fails loudly at the step that is actually broken, which is the point.

Not verifiable by re-dispatch right now without duplicating the open winget-pkgs#430424 for v0.7.0 — the real test is the v0.7.1 release.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NDsEfog5kVkT5NmX1Ya5be

…l cause

The sync step was `continue-on-error: true`. The reasoning at the time was
"a sync hiccup must not block a submit that might still succeed" — but a
stale fork is the one thing that guarantees the submit will NOT succeed, so
the flag only ever hid the honest error and left the misleading one.

That is why the same failure was rediagnosed from scratch three releases
running. The full chain, verified this time:

    WINGET_TOKEN lacks `workflow` scope
      -> merge-upstream returns HTTP 422, because upstream winget-pkgs
         contains .github/workflows/*.yml and syncing means writing them
      -> the fork stays stale
      -> the SUBMIT step reports "does not have the correct permissions
         to execute CreateRef"

Nothing in that final message mentions the sync, the fork, or the scope.

So: drop continue-on-error, and correct the docs. CLAUDE.md said
"`public_repo` is sufficient" and "this is almost never a token problem" —
both written in good faith after v0.6.0, both wrong, and both actively
steered the v0.7.0 diagnosis away from the answer. It IS partly a token
problem; it just isn't the scope anyone reaches for first. Widening to full
`repo` remains the wrong fix and that warning stays.

No release behaviour changes for a correctly-scoped token.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NDsEfog5kVkT5NmX1Ya5be
@AThraen
AThraen merged commit e8706f1 into main Sep 6, 2026
1 check passed
@AThraen
AThraen deleted the ci/winget-sync-must-not-fail-silently branch September 6, 2026 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant