RHINENG-26117: Add recompute infrastructure for account_advisory#2195
Merged
Conversation
Reviewer's GuideImplements recompute/backfill functions and indices for the workspace-scoped account_advisory aggregation, exposes a Go model plus DB test helpers, and adds integration tests to validate refresh and cleanup behavior. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2195 +/- ##
==========================================
- Coverage 59.21% 59.01% -0.21%
==========================================
Files 137 137
Lines 8798 8828 +30
==========================================
Hits 5210 5210
- Misses 3040 3070 +30
Partials 548 548
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
4d04534 to
efc5b2b
Compare
Add SQL functions that mirror advisory_account_data functions to populate account_advisory table
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The DDL for
account_advisoryindexes and the refresh/backfill functions is duplicated in bothcreate_schema.sqland157_account_advisory_queries.up.sql; consider centralizing this in migrations (and havingcreate_schemagenerated from them) to avoid future drift between fresh installs and upgraded environments. - The down migration
157_account_advisory_queries.down.sqltruncatesaccount_advisory, which is more destructive than a typical rollback; if this table contains any non-derivable or user-relevant data, consider dropping only the added indexes/functions and leaving the data intact.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The DDL for `account_advisory` indexes and the refresh/backfill functions is duplicated in both `create_schema.sql` and `157_account_advisory_queries.up.sql`; consider centralizing this in migrations (and having `create_schema` generated from them) to avoid future drift between fresh installs and upgraded environments.
- The down migration `157_account_advisory_queries.down.sql` truncates `account_advisory`, which is more destructive than a typical rollback; if this table contains any non-derivable or user-relevant data, consider dropping only the added indexes/functions and leaving the data intact.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
MichaelMraka
approved these changes
May 28, 2026
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
This adds recompute and trigger infrastructure for account_advisory. It's mostly modeled after the existing recompute and trigger for account_advisory_data. I also added a little bit of Go infrastructure so that I could add unit tests.
This is dependent on this PR: #2184
Secure Coding Practices Checklist GitHub Link
Secure Coding Checklist
Summary by Sourcery
Add database functions, indexes, models, and tests to support recomputing and backfilling account-level advisory aggregates.
New Features:
Enhancements:
Tests: