Repository navigation
feat(store): read noergler spend through a newest-rollup-per-PR view - #76
Merged
Merged
Conversation
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.
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.
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.