Skip to content

NO-JIRA: job-run-aggregator: remove relaxing in disruption aggregation#4899

Open
petr-muller wants to merge 1 commit intoopenshift:mainfrom
petr-muller:trt-2487-disruption-agg-adjustment
Open

NO-JIRA: job-run-aggregator: remove relaxing in disruption aggregation#4899
petr-muller wants to merge 1 commit intoopenshift:mainfrom
petr-muller:trt-2487-disruption-agg-adjustment

Conversation

@petr-muller
Copy link
Member

@petr-muller petr-muller commented Jan 14, 2026

I do not entirely understand why the relaxation for disruption tests exists here but the TODO exists this may be worth tightening. The pityFactor will relax the threshold in some cases (high attempts, high pass rate) so the additional relaxation would only apply in the remaining cases.

Summary by CodeRabbit

Bug Fixes

  • Corrected job run pass/fail requirement calculation by removing an inconsistent relaxation adjustment at equality boundaries. This ensures stricter and more consistent pass/fail determination in edge cases where requirements previously had an unintended one-off reduction.

Copilot AI review requested due to automatic review settings January 14, 2026 16:40
@openshift-ci-robot
Copy link
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: automatic mode

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

@petr-muller: This pull request explicitly references no jira issue.

Details

In response to this:

I do not entirely understand why the relaxation for disruption tests exists
here but the TODO exists this may be worth tightening. The pityFactor will
relax the threshold in some cases (high attempts, high pass rate) so the
additional relaxation would only apply in the remaining cases.

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.

@coderabbitai
Copy link

coderabbitai bot commented Jan 14, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between f180675 and ebabeb6.

📒 Files selected for processing (2)
  • pkg/jobrunaggregator/jobrunaggregatoranalyzer/pass_fail.go
  • pkg/jobrunaggregator/jobrunaggregatoranalyzer/pass_fail_test.go
💤 Files with no reviewable changes (1)
  • pkg/jobrunaggregator/jobrunaggregatoranalyzer/pass_fail.go

Walkthrough

Removed a one-off decrement that tightened required pass counts when equality held; pity-factor relaxation remains. Tests updated to reflect the new boundary behavior where equality no longer reduces the requiredNumberOfPasses by one.

Changes

Cohort / File(s) Summary
Pass-fail logic
pkg/jobrunaggregator/jobrunaggregatoranalyzer/pass_fail.go
Removed the post-adjustment that subtracted 1 from requiredNumberOfPasses when it equaled strictRequiredNumberOfPasses. Retains existing pity-factor relaxation; boundary-equality no longer tightens required passes.
Tests updated
pkg/jobrunaggregator/jobrunaggregatoranalyzer/pass_fail_test.go
Adjusted expected minimum pass values and test descriptions to reflect the removed -1 adjustment. Updated multiple test cases to increase expected passes where equality previously caused a -1 relaxation.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'remove relaxing in disruption aggregation' accurately describes the main change: removal of a relaxation mechanism in the pass_fail logic for job-run-aggregator.
Stable And Deterministic Test Names ✅ Passed All test names in pass_fail_test.go are static, descriptive strings with no dynamic information such as generated identifiers, timestamps, or pod names.
Test Structure And Quality ✅ Passed Test file demonstrates good structure with meaningful assertion messages, consistent subtable-driven pattern using t.Run(), and appropriate absence of BeforeEach/AfterEach for synchronous unit tests.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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

@petr-muller
Copy link
Member Author

/hold

Needs #4894

@petr-muller petr-muller marked this pull request as draft January 14, 2026 16:41
@openshift-ci openshift-ci bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Jan 14, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 14, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: petr-muller

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

The pull request process is described 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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 14, 2026
@petr-muller
Copy link
Member Author

/uncc @danilo-gemoli @droslean
/cc @neisw @xueqzhan

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request removes the simple -1 relaxation for disruption tests and replaces it with a more sophisticated pityFactor function that allows up to 2 failures regardless of the strict pass requirement. The change affects both disruption percentile checks and regular test failure checks.

Changes:

  • Replaced the -1 adjustment with a pityFactor function that allows up to 2 failures
  • Updated test cases to reflect new expected pass requirements (7 instead of 6, 5 instead of 4)
  • Added comprehensive test coverage for the pity factor behavior

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
pkg/jobrunaggregator/jobrunaggregatoranalyzer/pass_fail.go Removed -1 relaxation, added pityFactor function, integrated pity factor into disruption and regular checks, updated summary messages
pkg/jobrunaggregator/jobrunaggregatoranalyzer/pass_fail_test.go Updated existing test expectations, added comprehensive tests for CheckFailedWithPityFactor and innerCheckPercentileDisruptionWithPityFactor

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@petr-muller
Copy link
Member Author

/test all

I do not _entirely_ understand why the relaxation for disruption tests
exists here but the TODO exists this may be worth tightening. The
`pityFactor` will relax the threshold in some cases (high attempts,
high pass rate) so the additional relaxation would only apply in the
remaining cases.
@petr-muller petr-muller force-pushed the trt-2487-disruption-agg-adjustment branch from f180675 to ebabeb6 Compare March 2, 2026 15:18
@petr-muller petr-muller marked this pull request as ready for review March 2, 2026 15:20
Copilot AI review requested due to automatic review settings March 2, 2026 15:20
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 2, 2026
@openshift-ci openshift-ci bot requested a review from deepsm007 March 2, 2026 15:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@openshift-ci-robot
Copy link
Contributor

Scheduling required tests:
/test e2e

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 2, 2026

@petr-muller: 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 ebabeb6 link true /test e2e
ci/prow/breaking-changes ebabeb6 link false /test breaking-changes

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

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. 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.

3 participants