[Alerting] Decouple rule-creation enablement from the datasource browse filter - #2835
Draft
lezzago wants to merge 2 commits into
Draft
[Alerting] Decouple rule-creation enablement from the datasource browse filter#2835lezzago wants to merge 2 commits into
lezzago wants to merge 2 commits into
Conversation
Contributor
PR Reviewer Guide 🔍(Review updated until commit d28d93b)Here are some key observations to aid the review process:
|
Rule-creation enablement was keyed off selectedDsIds (the datasource browse/facet filter): with an empty selection BOTH create branches were disabled, and otherwise each was disabled unless every selected datasource matched its type. This wrongly hid a capability based on an unrelated list filter — e.g. a user with a Prometheus datasource but no facet selection could not start creating a metrics rule. Derive logsCreateDisabled/metricsCreateDisabled from the datasources AVAILABLE to the user instead: metrics create is enabled when at least one Prometheus datasource exists, logs create when at least one OpenSearch datasource exists. The MonitorsMainPanel prop contract is unchanged; only the derivation moved. The user picks the specific datasource in the wizard. Audit ID: M8 (Major, flow heuristic AL3) Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
lezzago
force-pushed
the
fix/audit-rules-create-gating
branch
from
August 27, 2026 17:15
38446ca to
d28d93b
Compare
Contributor
|
Persistent review updated to latest commit d28d93b |
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.
What & why
The Create button's enablement was tied to the datasource browse facet, so selecting a browse facet could disable creation. Fixes the
useMemogating in this file only, leaving theMonitorsMainPanelprop contract intact.Findings: M8.
Before / after
Before / after — Create ▸ Logs alert rule with only Prometheus selected (disabled → enabled)
Before flow — narrowing the browse filter to only Prometheus wrongly DISABLES 'Create ▸ Logs alert rule'
After flow — same steps, 'Create ▸ Logs alert rule' stays ENABLED (gated on capability, not the browse filter)
Testing
Covered by test. Note: behavioural, not pixel-visible in the happy path.
Review
Independent review agent: APPROVE (review commit applied).
Regression check
The before/after above is a full-viewport capture, so adjacent components on the same surface are visible and unchanged — the diff is scoped to what's called out. Cross-component safety is also verified centrally: this change is file-disjoint from the other in-flight audit fixes (no file overlap, so it merges cleanly with them), and the affected plugin test suites pass with 0 new type errors vs
main. Aside from the merge-order note below, it can be reviewed, merged, and reverted independently.Dependency
No dependencies — can merge independently (file-disjoint from #2829's prop change).