fix(image): total count deduplication fix#1248
Open
tsim-sap wants to merge 1 commit into
Open
Conversation
tsim-sap
requested review from
MR2011,
copyonwrite,
dorneanu,
drochow and
michalkrzyz
as code owners
July 9, 2026 11:55
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a MariaDB migration that updates the refresh procedures behind the service-level issue severity count materializations to avoid overcounting when a service deploys multiple versions of the same image/component, and to align severity bucketing with IssueMatch.issuematch_rating.
Changes:
- Add new
refresh_mvCountIssueRatingsServiceId_procimplementation that deduplicates by(component_id, issue_id)and usesIssueMatch.issuematch_rating. - Add new
refresh_mvServiceIssueCounts_procimplementation with the same deduplication and rating source, using an atomic temp-table swap refresh pattern. - Add a matching down migration that restores the previous
IssueVariant.issuevariant_rating+component_version_id-based counting logic.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| internal/database/mariadb/migrations/20260708120000_fix_mv_service_issue_counts_use_issuematch_rating.up.sql | Updates service-level MV refresh procedures to dedup by component and use IssueMatch rating. |
| internal/database/mariadb/migrations/20260708120000_fix_mv_service_issue_counts_use_issuematch_rating.down.sql | Reverts the procedures back to the prior IssueVariant + component-version-based logic. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
Author
|
Do: after applying the dump. |
tsim-sap
force-pushed
the
tsim-sap/issue-1210/fix-image-list-total-count
branch
from
July 10, 2026 14:53
3226f48 to
ce5cacf
Compare
Signed-off-by: Valiantsin Tsimoshyk <v.tsimoshyk@sap.com>
tsim-sap
force-pushed
the
tsim-sap/issue-1210/fix-image-list-total-count
branch
from
July 10, 2026 15:07
ce5cacf to
12c3d1e
Compare
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.
Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.
What type of PR is this? (check all applicable)
Related Tickets & Documents
Added tests?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Added to documentation?
Checklist