Skip to content

Persist open PR inventory for backfill#11

Merged
dutifulbob merged 1 commit intomainfrom
feat/open-pr-inventory
Apr 15, 2026
Merged

Persist open PR inventory for backfill#11
dutifulbob merged 1 commit intomainfrom
feat/open-pr-inventory

Conversation

@dutifulbob
Copy link
Copy Markdown
Member

Summary

  • persist the fetched open-PR set in a durable inventory table instead of rescanning GitHub every backfill batch
  • drive open-PR backfill from that inventory and update repo counters/cursor after each PR
  • add regression coverage that proves the open-PR listing endpoint is only hit during fetch passes

Why

The backfill worker was still walking the full open-PR list before and after every batch. That made openclaw/openclaw needlessly expensive to backfill and left repo status counters lagging until the batch finished.

Validation

  • go test ./internal/githubsync/...
  • go test ./...
  • go vet ./...
  • go build ./cmd/ghreplica && go build ./cmd/ghr
  • npm run docs:check

@dutifulbob
Copy link
Copy Markdown
Member Author

Final report:

  • Persisted a durable repo_open_pull_inventories table and wired the fetch pass to refresh it from the open-PR list.
  • Switched open-PR backfill to walk that stored inventory instead of relisting all open PRs before and after every batch.
  • Moved repo counters forward per PR during backfill by updating the sync-state row transactionally with each visited inventory item.
  • Added regression coverage that proves multi-batch backfill only hits the open-PR listing endpoint during the fetch pass.

Validation:

  • go test ./internal/githubsync/...
  • go test ./...
  • go vet ./...
  • go build ./cmd/ghreplica && go build ./cmd/ghr
  • npm run docs:check

GitHub review status:

  • codex review --base main was run against this head. It traversed the diff locally but did not surface actionable findings or leave GitHub comments.
  • PR issue comments: none
  • PR inline review comments: none
  • CI: validate passed

@dutifulbob dutifulbob marked this pull request as ready for review April 15, 2026 16:40
@dutifulbob dutifulbob merged commit fd6f0ce into main Apr 15, 2026
1 check passed
@dutifulbob dutifulbob deleted the feat/open-pr-inventory branch April 15, 2026 16:40
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