refactor: read ghreplica mirror data directly#24
Merged
dutifulbob merged 4 commits intomainfrom Apr 25, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PRtags no longer calls the ghreplica HTTP API for internal mirror metadata reads.
It now reads mirrored GitHub repositories, issues, and pull requests through the shared
ghreplica/mirrorGo package.This is the code path needed for the shared Postgres database cutover, where PRtags keeps its own schema but reads mirror data directly from the same database.
What Changed
The internal ghreplica adapter is now a direct database reader instead of an HTTP client.
The service still keeps the product boundary: ghreplica owns mirror data, and PRtags owns groups, annotations, projections, jobs, and comment sync.
prtags -> ghreplica HTTPclient with a wrapper aroundmirror.Reader.PRTAGS_SCHEMAandGHREPLICA_SCHEMAsettings.search_path.Testing
The local code path is covered before production cutover.
The production data copy has already passed a transaction-wrapped dry run, but the real copy will be done during deployment so writes are not missed.
go test ./...tmpdir=$(mktemp -d); env -u GITHUB_TOKEN -u GH_TOKEN -u PRTAGS_GITHUB_TOKEN PRTAGS_CONFIG_DIR="$tmpdir" ./scripts/check-go-coverage.shgolangci-lint run --timeout=5mnpx --yes @simpledoc/simpledoc@0.1.6 checkgit diff --checkRisks
The main rollout risk is database topology, not the code adapter.
PRtags must be pointed at the shared database with
PRTAGS_SCHEMA=prtagsafter the old PRtags data is restored into that schema.