neosourceDocs
Search docs

Get a repository's GitHub metadata sync status

GET/api/repos/{owner}/{repo}/github-sync

getGithubSyncStatus

Returns the repo's metadata-sync posture (mode, lifecycle state, last sync, last error) plus the latest backfill's issue counters (`issues_done` / `issues_total`; `issues_total` is the repo's max GitHub issue number — an upper bound — and `0` while unknown). 404 when the repository has no metadata sync configured. The SPA reads this for active issues-page backfill progress and the repo settings sync card; the repository-detail issue policy owns the ordinary create affordance.

Authentication optional — this operation also accepts anonymous requests. When authenticating, use a bearer token or a session cookie.

curl

curl -X GET 'https://neosource.dev/api/repos/OWNER/REPO/github-sync' \
  -H 'Authorization: Bearer $NEOSOURCE_TOKEN'

fetch

fetch("https://neosource.dev/api/repos/OWNER/REPO/github-sync", {
  method: "GET",
  headers: {
    Authorization: "Bearer $NEOSOURCE_TOKEN",
  },
});

Path parameters

ownerrequired

Repository owner or organization slug.

string

reporequired

Repository name.

string

Responses

200Sync status

application/json

GithubSyncStatusResponse

object

Response body for both github-sync endpoints: the repo's metadata-sync posture plus the latest backfill counters.

full_namerequired

string

GitHub `owner/name` the metadata is synced from.

issues_donerequired

integerint32

Issues upserted by the latest backfill run. Resets on a cursor-resumed re-run; `0` when no backfill job exists yet.

issues_totalrequired

integerint32

Approximate total for the backfill progress bar — the repo's max GitHub issue number (PR numbers included, so an upper bound). `0` = unknown / no backfill job yet.

last_error

string | null

Most recent sync/backfill error, if any (also present while retries are still within the failure budget).

last_synced_at

integer | nullint64

Millis since the Unix epoch of the last successful poll/page.

moderequired

GithubRelationshipMode

string

Which forge owns an imported repository's refs and provider-shaped data. The ONLY relationship vocabulary, in the database (`github_repo_sync.mode`), in Rust, on the wire and in the SPA. The legacy `synced` / `mirror_readonly` pair it replaced was collapsed onto [`Self::NeosourceReadonlyMirror`] by `migrations/20260902120000_github_relationship_contract.sql`.

"github_managed""neosource_readonly_mirror""neosource_managed""github_backup"

staterequired

GithubSyncState

string

Lifecycle of a repo's metadata sync (`github_repo_sync.state`).

"backfilling""live""error"

Standard errors

Bodies documented once for the whole API — see standard errors.

  • 400Bad Request — one of: invalid_input
  • 403Forbidden — one of: forbidden
  • 404Not Found — one of: not_found
  • 423Locked — one of: busy
  • 429Rate limited — retry after the `Retry-After` header
  • 500Internal server error
  • 503Service temporarily unavailable / at capacity — retry after the `Retry-After` header
  • 504Gateway timeout — the request exceeded the server's handling budget