kew sync¶
Backfill PR outcomes (merged/closed state, review cycles, diff stats) for past runs.
kew sync walks every run whose PR outcome isn't yet final — those with no persisted
outcome and those still marked open — and fetches the current state of each PR from
GitHub (so a merge or close that landed since the last sync is picked up here). Runs
already in a terminal state (merged/closed) are skipped. Results are written to the local
SQLite store so that kew report can read them without making live GitHub calls.
When to use¶
- After connectivity gaps — if kew was offline while PRs were merging, run
kew syncto catch up before generating a report. - Scheduled sweep — add
kew syncto cron to keep outcome data fresh without waiting for the nextkew reportrun. - CI/CD integration — call
kew syncin a post-merge workflow to record merge state close to the event.
Behaviour¶
- Fail-soft: individual fetch failures (missing PR, rate limit, network error) are silently skipped. The count returned reflects how many runs were successfully updated. Partial results are always persisted.
- Cron-friendly: exits 0 even when no runs need updating (count = 0).
- Deduplication: multiple runs that share a branch (e.g. retries on the same issue) count as one GitHub call.
- Repo resolution: uses
[project] repowhen set, otherwise auto-detects it viagh repo view(the same detectionkew reportand dispatch use). If no repo can be determined,kew syncwarns and skips rather than silently reportingsynced 0 run(s).
Note: kew report also syncs outcomes automatically before building the report, so
you only need to run kew sync explicitly when you want to update the store without
generating a report.