Repository navigation
fix: relax git auto-pull polling only once the webhook has delivered - #12532
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
/review |
|
Claude finished @hugocasa's task in 1m 52s —— View job cc @hugocasa Mergeable, but should ideally address nits: the first pull of a newly enabled repo or newly tracked ref clears the ping verification (
FindingsP2: an initial pull is counted as a missed webhook delivery ( The poller clears This happens on the most common path. When auto-pull is newly enabled, This only costs extra polling, never a missed change, but it cancels most of what the ping buys. The fix is to also require Checked and found correct:
Not verified: the EE receivers. The AGENTS.md complianceNo violations found. Comments record constraints rather than narration, the sqlx cache is updated for the new query, and Test coverage
Manual verification still worth doing: enable auto-pull on a GitHub repo whose instance is reachable, and wait past the first poll tick. The card should still read "Syncing instantly via webhook", and the backend log should not show "moved without a webhook delivery". Today I expect it to fall back to the every-minute text. |
| Ok(Some(_)) | ||
| if auto_pull.webhook_verified() | ||
| && auto_pull | ||
| .last_pull_status | ||
| .as_ref() | ||
| .map_or(true, |s| s.success) => | ||
| { |
There was a problem hiding this comment.
P2: a ref with no synced sha yet is treated as a missed delivery. Ok(Some(_)) here also covers the first pull of a ref that has never synced. last_synced_sha has no entry for it, so should_pull is true, but no webhook ever had a chance to bring that head.
Common path: auto-pull is enabled on a GitHub repo. sanitize_client_auto_pull leaves last_synced_sha empty, the hook is created after the commit, and the ping sets webhook_verified_id within seconds. The poller's first tick for the repo comes up to ~60s later and enqueues the initial pull. webhook_verified() is true and last_pull_status is None, so the id is cleared and the log says "moved without a webhook delivery". The ping verification is undone, and the repo polls every minute until its first real push delivery. Changing the tracked branch (a new git_ref key) has the same effect.
This only costs extra polling, never a missed change. But it cancels the "ping verifies within seconds" benefit for most new repos. Suggested guard: demote only when a previous synced sha exists for this ref:
Ok(Some(_))
if auto_pull.webhook_verified()
&& auto_pull.last_synced_sha.contains_key(&git_ref)
&& auto_pull.last_pull_status.as_ref().map_or(true, |s| s.success) =>(git_ref is moved into the call above, so bind the check to a local before calling reconcile_and_enqueue_pull.)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
/codex |
|
/review |
|
Claude finished @hugocasa's task in 34s —— View job Good to merge
What changed since the last reviewOne new commit, This resolves the earlier P2. Before this change, the initial pull after enabling auto-pull or switching the tracked branch cleared the GitHub ping's verification and logged "moved without a webhook delivery". Now that pull has no
My other conclusions from the previous review still hold: the field is server-owned on every save and export path, the AGENTS.md complianceNo violations found. Test coverage
Manual verification still worth doing: enable auto-pull on a GitHub repo whose instance GitHub can reach, and wait past the first poll tick (about 60s). The card should keep reading "Syncing instantly via webhook", the backend log should not show "moved without a webhook delivery", and |
…ook-polling-fallback # Conflicts: # backend/ee-repo-ref.txt
|
/review |
|
Claude finished @hugocasa's task in 32s —— View job Good to merge
What changed since the last reviewOnly the merge of
None of them touches the auto-pull verification logic. The PR's own diff is the same as at My earlier conclusions still hold. The field is server-owned on every save and export path. The AGENTS.md complianceNo violations found. Test coverage
Manual verification still worth doing: enable auto-pull on a GitHub repo whose instance GitHub can reach, then wait past the first poll tick (about 60s). The card should still read "Syncing instantly via webhook" and the backend log should not show "moved without a webhook delivery". |
Codex ReviewGood to merge No issues found. Reviewed the polling logic, settings sanitization/preservation/export paths, and authenticated GitHub/GitLab receivers at the exact pinned EE revision, Test coverageThe Rust interval test covers unverified hooks, stale verification IDs, verified hooks, and explicit interval overrides. No new integration tests cover receiver verification, the JSONB update, or poller demotion. The frontend change only updates template text; component tests are unnecessary. Ran Before merge, enable auto-pull for a reachable GitHub repository and wait through its first poll. Verification should remain set and the card should continue showing webhook sync. For GitLab, confirm an authenticated push verifies the hook. Then prevent deliveries and push another commit: the safety-net poll should deploy it, clear verification, and restore minute polling. Invalid-token deliveries should leave verification unchanged. |
Pi ReviewGood to merge I reviewed the full diff ( Considered and dismissedEach candidate from my first pass, with the reason it is not a finding:
Test coverage
Manual verification still worth doing: enable auto-pull on a GitHub repo whose instance GitHub can actually reach, and wait past the first poll tick (~60s) — the card should keep reading "Syncing instantly via webhook", the backend log should not print "moved without a webhook delivery", and |
This commit updates the EE repository reference after PR #996 was merged in windmill-ee-private. Previous ee-repo-ref: 095ef5033bff64ed5b2d08c84bb0037b83449d88 New ee-repo-ref: 6c06d688fe435630e2827bc177f066d2646bb768 Automated by sync-ee-ref workflow.
|
🤖 Updated |
Summary
Git auto-pull relaxed its safety-net poll from ~1 min to ~10 min as soon as a repository webhook was registered. Registering only proves Windmill can reach the git host; it says nothing about the host reaching Windmill. On an instance that can call GitHub but that GitHub cannot call back (a typical air-gapped setup), the hook was created, every delivery failed, and new commits took up to 10 minutes to deploy, while the card claimed "Syncing instantly via webhook".
Polling now relaxes only once the hook has actually delivered to this instance, and drops back to every minute when a poll finds a head no delivery brought.
Changes
AutoPullSettings.webhook_verified_id: thewebhook_ida delivery last arrived for. It is server-owned: sanitized from client saves, carried across settings saves, and stripped from the settings export. A newly registered hook has a new id, so it starts unverified without touching the hook create/delete paths.effective_poll_interval_srelaxes to 600s only whenwebhook_verified_id == webhook_id.pingon hook creation verifies a reachable instance within seconds. GitLab sends no ping, so a GitLab repo polls every minute until its first push delivery.set_auto_pull_webhook_verified_iddoes a targeted jsonb write, guarded againstjsonb_setNULLinggit_sync.Known ceilings:
Test plan
test_effective_poll_intervalcovers an unverified hook, a stale verified id from an older hook, and a verified hook.quickjs,enterprise,private), local smart-HTTP git remote, with state planted by SQL:pingwith a bad signature returns 401 and leaves the id unset.pingreturns 200 and setswebhook_verified_id=777.moved without a webhook delivery. The rest ofgit_syncis intact.Screenshots
Hook registered, no delivery yet:

Hook verified:

Follow-up (separate PR): remove
AutoPullMode. No UI ever set it, and with polling now a reliable baseline every repo can create a hook when it can hold one and always poll.🤖 Generated with Claude Code
Summary by cubic
Git auto-pull now relaxes its polling interval only after the webhook has actually delivered to the instance, not when the webhook is registered. This prevents a 10-minute deployment delay on air-gapped setups where the host can reach Windmill but not the reverse.
webhook_verified_idtoAutoPullSettings, sanitized from client saves and stripped from settings exports. Polling stays at every minute until the currentwebhook_idmatches it.Written for commit e7802da. Summary will update on new commits.