Repository navigation
Description
PostgreSQL parity for push storage and repository activity
The PostgreSQL sink in #1687 is merged, so this work is no longer blocked. The #1691 implementation is split by responsibility, with all three sinks covered in each PR:
- perf: reduce duplicate push audit storage #1795 reduces duplicate audit storage and aligns list/detail payloads across file, MongoDB, and PostgreSQL.
- perf: cache repository activity summaries #1801 maintains repository activity summaries across all three sinks and refreshes the UI after review actions. PostgreSQL schema migration 9 tracks committed audit changes and backfills summaries without rewriting historical audits.
Keep this issue open until both PRs merge. Together they cover the agreed #1691 scope. The Action.diff refactor in #1693 and #1701 remains separate.
Acceptance criteria
- New audit writes avoid redundant diff logs and an identical lastStep payload. Detail reads restore the complete reviewable audit.
- Push lists and user-profile activity return the same metadata fields across all sinks, without embedded diffs or processor payloads.
- Repository activity preserves status precedence, canonical URL matching, counts, and latest push/pending timestamps. Warm reads use saved summaries without scanning audit history.
- Repeated writes, approval, rejection, cancellation, deletion, and concurrent updates preserve correct counts and audits.
- Existing records remain readable. Initialization, interrupted refresh recovery, and rebuilding derived data are documented and tested.
- Real PostgreSQL tests verify parity with the file/MongoDB contracts. API and UI checks cover lists, diffs, repository badges, reviewer activity, and review transitions.
Verification
Both PRs have passed their unit and real-database integration suites. PostgreSQL-backed verification passed six real Git push/fetch scenarios and all 24 Cypress scenarios. Manual checks covered diff rendering, approval, immediate count refresh without reloading, timestamps, and reviewer profile activity.
The two branches were also combined locally, with 726 unit/service/processor tests, 89 MongoDB integration tests, and 100 PostgreSQL integration tests passing. Their adapter overlap must be reconciled in the second PR after the first merges; that resolution has been verified locally.
On a local synthetic PostgreSQL history of 10,000 pushes across 10 repositories, five-run median warm reads were 2.44 ms for summaries versus 11.27 ms for the previous history query. Initial backfill took 178.51 ms. A constructed audit with a 2 MiB final-step diff shrank from 8,389,308 to 2,097,722 serialized bytes after compaction. These examples are workload-specific.
Related: #1497 (sink), #1692 (earlier query/index improvements). Retention policies and moving diffs to a separate store are outside the agreed scope.
Activity
[-]Bring PostgreSQL push storage and activity rollups to parity after the sink merges[/-][+]Complete PostgreSQL push storage and activity parity[/+]