Skip to content

WIP OU-1400: increase alert window padding for matching incidents#967

Open
tremes wants to merge 1 commit into
openshift:mainfrom
tremes:ou-1400
Open

WIP OU-1400: increase alert window padding for matching incidents#967
tremes wants to merge 1 commit into
openshift:mainfrom
tremes:ou-1400

Conversation

@tremes
Copy link
Copy Markdown
Contributor

@tremes tremes commented Jun 1, 2026

Summary by CodeRabbit

  • Bug Fixes

    • Adjusted the alert filtering window to correctly include alerts that fire shortly before an incident metric appears, expanding the set of alerts associated with incidents.
  • Tests

    • Added test case to verify alerts are properly included when their evaluation timing is just outside the previous threshold.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jun 1, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Jun 1, 2026

@tremes: This pull request references OU-1400 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 1, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jun 1, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: tremes
Once this PR has been reviewed and has the lgtm label, please assign etmurasaki for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 67998f3e-e045-4dd7-bef8-026b443048c0

📥 Commits

Reviewing files that changed from the base of the PR and between f9b2b03 and f412653.

📒 Files selected for processing (2)
  • web/src/components/Incidents/processAlerts.spec.ts
  • web/src/components/Incidents/processAlerts.ts

Walkthrough

This PR adjusts the alert window padding logic in incident alert processing. The padding constant ALERT_WINDOW_PADDING_SECONDS is increased from half the query interval to the full interval, expanding the time window of alert samples considered within an incident's time range. A test case validates the new behavior by confirming alerts are retained when fired exactly one step before an incident metric appears.

Changes

Alert window padding and time-window filtering

Layer / File(s) Summary
Alert window padding constant and time-window filtering test
web/src/components/Incidents/processAlerts.ts, web/src/components/Incidents/processAlerts.spec.ts
ALERT_WINDOW_PADDING_SECONDS is updated from PROMETHEUS_QUERY_INTERVAL_SECONDS / 2 to PROMETHEUS_QUERY_INTERVAL_SECONDS. A new test case verifies alerts are retained when their eval point occurs exactly one query step before the incident metric's eval point.

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly describes the main change: increasing alert window padding to better match incidents with alerts that fire slightly before the incident is detected.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed Test name is static and deterministic, containing no dynamic information like pods, timestamps, UUIDs, nodes, or IP addresses. All values are properly placed in test body.
Test Structure And Quality ✅ Passed The custom check targets Ginkgo (Go testing framework), but the PR contains TypeScript/Jest tests. The check is not applicable to this codebase, so it passes by default.
Microshift Test Compatibility ✅ Passed No Ginkgo e2e tests added. PR modifies only Jest unit tests in web/src/components/Incidents/processAlerts.spec.ts (TypeScript frontend component test), not Kubernetes e2e tests.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No Ginkgo e2e tests added. The PR contains only TypeScript Jest/Jasmine unit tests for a web component, not Ginkgo e2e tests. The check is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed PR modifies alert processing logic in a monitoring UI plugin, not deployment manifests or operator code. No scheduling constraints or topology-aware configurations are introduced.
Ote Binary Stdout Contract ✅ Passed Not an OTE binary project. This is a monitoring plugin with TypeScript/Go web server code, not an OTE test binary that communicates with openshift-tests.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR contains TypeScript unit tests (Jest/Jasmine), not Ginkgo e2e tests. The custom check applies only to Ginkgo e2e tests, which are Go-based tests for Kubernetes environments.
No-Weak-Crypto ✅ Passed No weak cryptography detected: PR modifies alert processing logic with time-window padding adjustments, no crypto imports, algorithms, or security-sensitive comparisons.
Container-Privileges ✅ Passed PR contains only TypeScript application code changes to alert windowing logic; no container/K8s manifests with privileged settings were added or modified.
No-Sensitive-Data-In-Logs ✅ Passed No logging statements found in the PR changes. Files contain only a constant adjustment and test additions with no console or logger calls.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jun 1, 2026

@tremes: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-ovn f412653 link true /test e2e-aws-ovn
ci/prow/okd-scos-images f412653 link true /test okd-scos-images
ci/prow/periodics-images f412653 link true /test periodics-images

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

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

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants