Skip to content

ROX-33596: Use view for failingDeployments#19420

Open
dashrews78 wants to merge 2 commits intomasterfrom
dashrews/failingdeployment-33596
Open

ROX-33596: Use view for failingDeployments#19420
dashrews78 wants to merge 2 commits intomasterfrom
dashrews/failingdeployment-33596

Conversation

@dashrews78
Copy link
Contributor

@dashrews78 dashrews78 commented Mar 13, 2026

Description

failingDeployments called SearchListAlerts to get full Alert blobs (~40KB
each) only to extract deployment IDs. Replace with a SQL column projection
that reads only the deployment_id inline column, avoiding TOAST I/O.

  • Add DeploymentIDResult view struct with nullable pointer and getter
  • Add SearchAlertDeploymentIDs to DataStore interface and implementation
  • Update failingDeployments resolver to use the new projection method
  • Remove unnecessary violation time sort and manual ID extraction loop
  • Add integration tests: basic flow, deduplication, multiple deployments,
    and NULL handling for resource alerts

Partially generated by AI.

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

User-facing documentation

Testing and quality

  • the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag
  • CI results are inspected

Automated testing

  • added unit tests
  • added e2e tests
  • added regression tests
  • added compatibility tests
  • modified existing tests

How I validated my change

CI and UT should be good for this one.

…ents

failingDeployments called SearchListAlerts to get full Alert blobs (~40KB
each) only to extract deployment IDs. Replace with a SQL column projection
that reads only the deployment_id inline column, avoiding TOAST I/O.

- Add DeploymentIDResult view struct with nullable pointer and getter
- Add SearchAlertDeploymentIDs to DataStore interface and implementation
- Update failingDeployments resolver to use the new projection method
- Remove unnecessary violation time sort and manual ID extraction loop
- Add integration tests: basic flow, deduplication, multiple deployments,
  and NULL handling for resource alerts

Partially generated by AI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dashrews78
Copy link
Contributor Author

dashrews78 commented Mar 13, 2026

This change is part of the following stack:

Change managed by git-spice.

Use Distinct() on the query select so Postgres handles deduplication
instead of maintaining a seen-map in Go.

Partially generated by AI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rhacs-bot
Copy link
Contributor

rhacs-bot commented Mar 13, 2026

Images are ready for the commit at c55c085.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.11.x-320-gc55c085cb5.

@codecov
Copy link

codecov bot commented Mar 13, 2026

Codecov Report

❌ Patch coverage is 83.33333% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.72%. Comparing base (66a258b) to head (c55c085).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
central/alert/datastore/datastore_impl.go 86.95% 2 Missing and 1 partial ⚠️
central/graphql/resolvers/policies.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #19420      +/-   ##
==========================================
+ Coverage   49.70%   49.72%   +0.01%     
==========================================
  Files        2701     2701              
  Lines      203453   203471      +18     
==========================================
+ Hits       101134   101170      +36     
+ Misses      94790    94776      -14     
+ Partials     7529     7525       -4     
Flag Coverage Δ
go-unit-tests 49.72% <83.33%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants