Repository navigation
Conversation
Reviewer's GuideSchema and migrationsDrop advisory_account_data and its cache-maintenance objects, and grant the aggregator ownership of account_advisory aggregation through migrations and the baseline schema.
Data structuresRemove the legacy advisory-account model, notification context types, and obsolete platform-event notification-suppression field.
APIRemove evaluator-owned notification publication and legacy advisory-cache updates, and narrow cache invalidation to package data.
Uses of the APIUpdate aggregator event processing and notification payloads to use the account-advisory refresh path without drift checks or legacy notification context.
ImplementationRemove database helpers and task implementations that exist only for legacy advisory-cache validation, refresh, backfill, cleanup, and recovery.
UIRemove the legacy advisory-account-data cache metric and its dashboard panel.
ConfigurationConfigure and deploy a dedicated aggregator database user, remove obsolete cache and recovery jobs, and update migration locking and credentials.
DocumentationRevise architecture, database, and migration guidance to describe the workspace-scoped aggregation model and remove legacy-cache workflows.
TestsUpdate tests and fixtures for aggregator-owned account-advisory aggregation, and remove assertions and helpers tied to the legacy cache and recovery behavior.
Lock files and vendored codeRemove the generated OpenAPI entries for the deleted cache-validation and cleanup endpoints.
Other changesFiles not grouped.
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 #2345 +/- ##
==========================================
+ Coverage 66.82% 68.16% +1.33%
==========================================
Files 157 151 -6
Lines 9080 8606 -474
==========================================
- Hits 6068 5866 -202
+ Misses 3010 2738 -272
Partials 2 2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="base/mqueue/platform_event.go" line_range="79" />
<code_context>
- if size <= 0 {
- size = BatchSize
- }
+func batchSize(grouped map[int][]uuid.UUID) int {
+ // compute how many batches we will create
var batches = 0
for _, ev := range grouped {
- batches += (len(ev) + size - 1) / size
+ batches += len(ev)/BatchSize + 1
}
return batches
</code_context>
<issue_to_address>
**nitpick (performance):** `batchSize` returns one extra batch whenever an account has an exact multiple of `BatchSize` systems; for example, 500 systems produces 2 instead of 1. `WriteEvents` still emits only the correct number of events, but it allocates an unnecessarily large `PlatformEvents` backing array for every such account, increasing memory usage during large event batches.
**Triggers:** When an account's inventory count is an exact multiple of `BatchSize`.
**Suggested fix:** Use `(len(ev) + BatchSize - 1) / BatchSize`, matching the previous calculation, and return zero for empty slices.
```suggestion
batches += (len(ev) + BatchSize - 1) / BatchSize
```
</issue_to_address>Sourcery assessment
Needs a human reviewer. The migration drops the production advisory_account_data table and its contents, while the down migration only recreates an empty table, so reverting cannot restore the deleted data. It also changes database roles and permissions, making an incorrect cutover potentially affect both data availability and component access.
|
The PR is ok to review, but wait with merging, |
|
Hi, please rebase. |
|
I've found 2 more unused variables |
Pretty much revert (RedHatInsights#2289).
Co-authored-by: Gemini <gemini@google.com>
Co-authored-by: Claude <noreply@anthropic.com>
|
Removed the two variables and rebased, but Konflux seems to be temporarily out |
Secure Coding Practices Checklist GitHub Link
Secure Coding Checklist
Summary by Sourcery
Remove advisory_account_data and rely on the workspace-scoped account_advisory aggregation path.
Enhancements:
Deployment:
Documentation:
Tests: