Skip to content

refactor: remove target projection cache#25

Merged
dutifulbob merged 2 commits intomainfrom
feat/remove-target-projections
Apr 25, 2026
Merged

refactor: remove target projection cache#25
dutifulbob merged 2 commits intomainfrom
feat/remove-target-projections

Conversation

@dutifulbob
Copy link
Copy Markdown
Member

Summary

prtags no longer needs its own PR and issue metadata cache.
This change removes the target_projections table and the target_projection_refresh worker path, then reads PR and issue summaries directly from the shared ghreplica mirror tables.
That makes group metadata, search hydration, annotation filtering, and GitHub comment sync use one source of truth for GitHub object metadata.
It also updates the docs and tests so the repo describes the new shared-database architecture instead of the old projection-cache design.

What Changed

The runtime now asks the ghreplica mirror reader for batched PR and issue summaries when metadata is needed.
The local prtags database keeps curation state and derived search/comment state, but not duplicate PR/issue display rows.

  • Added batched mirror object summary reads in the internal ghreplica client.
  • Switched group metadata, filter results, search result hydration, search indexing, and comment body rendering to direct mirror summaries.
  • Removed TargetProjection, projection freshness responses, and all target projection refresh River workers and queue methods.
  • Added migration 000005_drop_target_projections to delete stale projection jobs/queues and drop target_projections safely.
  • Updated repository docs and the prtags skill instructions to reflect direct shared mirror reads.

Testing

I ran the local CI-shaped checks before opening this PR.
The release validation used go run because goreleaser was not installed as a local binary.

  • npx --yes @simpledoc/simpledoc@0.1.6 check
  • go vet ./...
  • go test ./...
  • ./scripts/check-go-coverage.sh
  • golangci-lint run --timeout=5m
  • go run github.com/goreleaser/goreleaser/v2@latest check
  • go run github.com/goreleaser/goreleaser/v2@latest release --snapshot --clean --skip=publish

Risks

The main risk is the schema cutover because the production table is dropped.
The migration deletes stale projection jobs first, and the new binary has no runtime references to the dropped table.

  • Deploy should stop/recreate the prtags process as one unit so old code cannot run after the table is dropped.
  • Rollback would require restoring or recreating the dropped derived table before running an older binary.
  • Direct mirror reads now depend on the shared ghreplica schema being available for metadata-bearing reads.

@dutifulbob
Copy link
Copy Markdown
Member Author

Final implementation-loop report:

  • Codex review against main: no blocking correctness findings after the target validation fix.
  • PR comments/review threads: none open.
  • GitHub CI: validate and lint are green.
  • Local validation passed:
    • npx --yes @simpledoc/simpledoc@0.1.6 check
    • go vet ./...
    • go test ./...
    • ./scripts/check-go-coverage.sh (total 82.7%; package floors satisfied)
    • /home/bob/go/bin/golangci-lint run --timeout=5m (0 issues)
    • go run github.com/goreleaser/goreleaser/v2@latest check

Ready to merge and deploy.

@dutifulbob dutifulbob merged commit 1b35056 into main Apr 25, 2026
2 checks passed
@dutifulbob dutifulbob deleted the feat/remove-target-projections branch April 25, 2026 09:24
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