Skip to content

feat(store): read noergler spend through a newest-rollup-per-PR view - #76

Merged
trick77 merged 4 commits into
masterfrom
pr-rollup-latest
Oct 9, 2026
Merged

trick77 merged 4 commits into
masterfrom
pr-rollup-latest

Conversation

@trick77

@trick77 trick77 commented Oct 8, 2026

Copy link
Copy Markdown
Owner

A noergler rollup is cumulative, and a PR reopened after a decline emits again when it closes, so summing noergler_events double-counts it. New view noergler_pr_rollups keeps the newest pr_completed per pr_key; docs and README queries read it. Raw rows stay append-only.

Known gap: declined twice repeats the delivery id, so the second rollup is deduped.

Deploy before the noergler change that re-emits on reopen.

A noergler rollup is cumulative over the PR's life, and a PR reopened after a decline emits again when it closes, so one PR can land two pr_completed rows. Summing noergler_events counted the earlier spend twice. noergler_pr_rollups keeps the newest row per pr_key; raw rows stay append-only. Docs, README and the verify queries read the view.

Known gap: declined, reopened, declined again repeats the delivery id, so the second rollup is deduped and the spend between the two declines is missing.
…ough it

SELECT * froze the column list silently; the partial index serves DISTINCT ON without a sort over every rollup ever stored; PR size still read noergler_events and counted a reopened PR twice. The test now has an older rollup arriving last.
noergler clears its sent mark on the first merge, so a PR declined or deleted again after a reopen sends nothing. The known gap is that, not a deduped key.
A deleted rollup carries 0 lines and 0 files; newest-wins let it wipe the declined row's diff size. Counter-type check now covers the view. Tests pin the id tie-break and the declined-then-deleted pair.
@trick77
trick77 merged commit 563c44c into master Oct 9, 2026
4 checks passed
@trick77
trick77 deleted the pr-rollup-latest branch October 9, 2026 06:31
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