Skip to content

ROX-32721: Add deployment_type and enforcement_count columns to alerts#20030

Draft
dashrews78 wants to merge 3 commits intodashrews/list-alert-v2-32721from
dashrews/add-columns-32721
Draft

ROX-32721: Add deployment_type and enforcement_count columns to alerts#20030
dashrews78 wants to merge 3 commits intodashrews/list-alert-v2-32721from
dashrews/add-columns-32721

Conversation

@dashrews78
Copy link
Copy Markdown
Contributor

Add search tags to Alert.Deployment.type and Alert.Enforcement.action,
and add a new enforcement_count field (tag 25) to the Alert proto.
This promotes deployment_type to a queryable column and caches the
computed enforcement count so ListAlert queries can avoid deserializing
the full alert blob.

Write path (updateAlertNoLock) now computes enforcement_count on every
upsert to keep the column and serialized blob consistent. The store
INSERT and COPY statements include both new columns.

The search tag on Enforcement.action is renamed from "Enforcement" to
"Enforcement Action" for clarity. The old "Enforcement" label is
retained for backward compatibility.

Partially generated by AI.

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

Description

change me!

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

change me!

Add search tags to Alert.Deployment.type and Alert.Enforcement.action,
and add a new enforcement_count field (tag 25) to the Alert proto.
This promotes deployment_type to a queryable column and caches the
computed enforcement count so ListAlert queries can avoid deserializing
the full alert blob.

Write path (updateAlertNoLock) now computes enforcement_count on every
upsert to keep the column and serialized blob consistent. The store
INSERT and COPY statements include both new columns.

The search tag on Enforcement.action is renamed from "Enforcement" to
"Enforcement Action" for clarity. The old "Enforcement" label is
retained for backward compatibility.

Partially generated by AI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Apr 15, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@dashrews78
Copy link
Copy Markdown
Contributor Author

dashrews78 commented Apr 15, 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 15, 2026

🚀 Build Images Ready

Images are ready for commit 9287d8c. To use with deploy scripts:

export MAIN_IMAGE_TAG=4.11.x-662-g9287d8cb91

Add enforcement_count to proto.lock (was missing from initial commit)
and update GetJSONSerializedTestAlertWithDefaults fixture to include
the new enforcementCount field in the expected JSON output.

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

codecov bot commented Apr 15, 2026

Codecov Report

❌ Patch coverage is 60.00000% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.61%. Comparing base (acc538d) to head (9287d8c).

Files with missing lines Patch % Lines
central/graphql/resolvers/generated.go 14.28% 6 Missing ⚠️
pkg/alert/convert/convert.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@                      Coverage Diff                      @@
##           dashrews/list-alert-v2-32721   #20030   +/-   ##
=============================================================
  Coverage                         49.61%   49.61%           
=============================================================
  Files                              2765     2765           
  Lines                            208686   208707   +21     
=============================================================
+ Hits                             103535   103548   +13     
- Misses                            97487    97497   +10     
+ Partials                           7664     7662    -2     
Flag Coverage Δ
go-unit-tests 49.61% <60.00%> (+<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.

1 participant