Skip to content

feat(api): add manual sync endpoint for on-demand refresh#1319

Open
jonnii wants to merge 1 commit into
jonnii/20260623025733/coalesce-webhook-driven-syncs-per-repofrom
jonnii/20260623030002/add-manual-sync-endpoint-for-on-demand-refresh
Open

feat(api): add manual sync endpoint for on-demand refresh#1319
jonnii wants to merge 1 commit into
jonnii/20260623025733/coalesce-webhook-driven-syncs-per-repofrom
jonnii/20260623030002/add-manual-sync-endpoint-for-on-demand-refresh

Conversation

@jonnii

@jonnii jonnii commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

POST /api/v1/repos/{repoID}/sync forces an immediate refresh of one repo. It is
the manual complement to the webhook and interval refreshes, and the primary way
to pull remote changes on a local server that GitHub cannot reach with a webhook
(webhooks are server-mode only; locally the fsnotify watcher covers local edits
and this covers on-demand remote pulls).

The refresh path is safety-aware:

  • Managed mirror: synchronous mirror-fetch + rebuild (detached HEAD, safe).
  • Local -cwd working repo: re-read on-disk refs only, never mirror-fetch — that
    would detach the operator working tree HEAD (safety-invariants.md).

The route is session-gated like submit and refused on a public read-only server,
so it is never an anonymous fetch trigger; on a local auth-disabled server it
stays reachable.


Stack

Auto-generated by Stackit

POST /api/v1/repos/{repoID}/sync forces an immediate refresh of one repo. It is
the manual complement to the webhook and interval refreshes, and the primary way
to pull remote changes on a local server that GitHub cannot reach with a webhook
(webhooks are server-mode only; locally the fsnotify watcher covers local edits
and this covers on-demand remote pulls).

The refresh path is safety-aware:
- Managed mirror: synchronous mirror-fetch + rebuild (detached HEAD, safe).
- Local -cwd working repo: re-read on-disk refs only, never mirror-fetch — that
  would detach the operator working tree HEAD (safety-invariants.md).

The route is session-gated like submit and refused on a public read-only server,
so it is never an anonymous fetch trigger; on a local auth-disabled server it
stays reachable.
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