Skip to content

RHOAIENG-57401: fix fragile if/elif chain in Cluster.status()#1038

Merged
openshift-merge-bot[bot] merged 1 commit into
project-codeflare:mainfrom
chipspeak:RHOAIENG-54701
Mar 30, 2026
Merged

RHOAIENG-57401: fix fragile if/elif chain in Cluster.status()#1038
openshift-merge-bot[bot] merged 1 commit into
project-codeflare:mainfrom
chipspeak:RHOAIENG-54701

Conversation

@chipspeak

@chipspeak chipspeak commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Refactored the mixed if/elif chain in Cluster.status() (lines 354-368) into a proper if/elif/elif/elif chain so that only one branch executes per call, eliminating redundant evaluations and preventing latent bugs from future edits.
  • Added a missing test case for RayClusterStatus.SUSPENDED in test_cluster_status.

Test plan

  • Existing test_cluster_status tests pass (UNKNOWN, FAILED, UNHEALTHY, READY)
  • New SUSPENDED test case passes
  • black formatting check passes
  • Pre-commit hooks pass

Resolves: RHOAIENG-54701

Made with Cursor

Refactor mixed if/elif chain to a proper if/elif/elif chain so
that only one branch executes per call. Add missing SUSPENDED
status test case.

Resolves: RHOAIENG-54701
Made-with: Cursor
@codecov

codecov Bot commented Mar 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.24%. Comparing base (d87aac4) to head (0458bc3).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1038      +/-   ##
==========================================
+ Coverage   96.15%   96.24%   +0.08%     
==========================================
  Files          23       23              
  Lines        2238     2238              
==========================================
+ Hits         2152     2154       +2     
+ Misses         86       84       -2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@chipspeak chipspeak changed the title fix fragile if/elif chain in Cluster.status() RHOAIENG-57401: fix fragile if/elif chain in Cluster.status() Mar 25, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Collaborator

@chipspeak: No Jira issue with key RHOAIENG-57401 exists in the tracker at https://redhat.atlassian.net.
Once a valid jira issue is referenced in the title of this pull request, request a refresh with /jira refresh.

Details

In response to this:

Summary

  • Refactored the mixed if/elif chain in Cluster.status() (lines 354-368) into a proper if/elif/elif/elif chain so that only one branch executes per call, eliminating redundant evaluations and preventing latent bugs from future edits.
  • Added a missing test case for RayClusterStatus.SUSPENDED in test_cluster_status.

Test plan

  • Existing test_cluster_status tests pass (UNKNOWN, FAILED, UNHEALTHY, READY)
  • New SUSPENDED test case passes
  • black formatting check passes
  • Pre-commit hooks pass

Resolves: RHOAIENG-54701

Made with Cursor

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.

@laurafitzgerald

Copy link
Copy Markdown
Contributor

/lgtm
/approve

Refactor looks correct — READY now leads the chain and SUSPENDED/UNKNOWN are proper elif branches. Good addition of the SUSPENDED test case which was missing. Minor note: PR title has a typo (57401 vs 54701) but doesn't affect merge.

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Mar 30, 2026
@openshift-ci

openshift-ci Bot commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: laurafitzgerald

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 Mar 30, 2026
@openshift-merge-bot openshift-merge-bot Bot merged commit 9c686c9 into project-codeflare:main Mar 30, 2026
26 checks passed
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. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants