Skip to content

fix: implement stronger status logic for getPipelineStatus#3416

Draft
suryapratap-01 wants to merge 2 commits intonumaproj:mainfrom
suryapratap-01:refactor/3414-pipeline-health-status
Draft

fix: implement stronger status logic for getPipelineStatus#3416
suryapratap-01 wants to merge 2 commits intonumaproj:mainfrom
suryapratap-01:refactor/3414-pipeline-health-status

Conversation

@suryapratap-01
Copy link
Copy Markdown
Contributor

What this PR does / why we need it

getPipelineStatus was using GetDesiredPhase() (user intent) with only 3 cases and a default of Healthy — weak logic that could misreport pipeline health. This
refactors it to switch on pipeline.Status.Phase (actual state) with explicit handling for all phases, matching the stronger pattern introduced for getMonoVertexStatus in #3408. Also fixes GetClusterSummary to count Unknown and Deleting pipelines as inactive rather than active.

Related issues

Fixes #3414

Testing

Unit tests added for all 8 phase cases (Running/healthy, Running/unhealthy vertices, Running/pausing-in-progress, Paused, Pausing, Failed, Deleting,
Unknown):

go test -v -race -short -timeout 60s ./server/apis/v1/ -run TestGetPipelineStatus

All pass.

Special notes for reviewers

This is a direct follow-up to #3408 — the logic mirrors getMonoVertexStatus exactly. Key behavioral changes vs. the old code:

  • Pausing phase now correctly returns Inactive (was falling through to Healthy)
  • Deleting phase now returns Deleting (was falling through to Healthy)
  • Unknown phase now returns Unknown (was defaulting to Healthy)
  • Status is derived from actual phase, not desired phase

  Refactor getPipelineStatus to switch on pipeline.Status.Phase (actual
· state) instead of GetDesiredPhase() (user intent), matching the pattern
  established for getMonoVertexStatus. Covers all phases explicitly:
  Unknown, Failed, Paused, Pausing, Running (with pausing-in-progress and
  IsHealthy checks), Deleting, and a safe default fallback to Unknown.

  Also update GetClusterSummary to count Unknown and Deleting statuses as
  inactive rather than active.

  Fixes numaproj#3414

Signed-off-by: suryapratap-01 <suryapratap.personal@gmail.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 8, 2026

Codecov Report

❌ Patch coverage is 77.27273% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.70%. Comparing base (e07240b) to head (b1e6b16).

Files with missing lines Patch % Lines
server/apis/v1/handler.go 77.27% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3416      +/-   ##
==========================================
+ Coverage   82.64%   82.70%   +0.06%     
==========================================
  Files         307      307              
  Lines       76051    76064      +13     
==========================================
+ Hits        62853    62911      +58     
+ Misses      12645    12595      -50     
- Partials      553      558       +5     

☔ 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.

@adarsh0728 adarsh0728 changed the title refactor: implement stronger status logic for getPipelineStatus fix: implement stronger status logic for getPipelineStatus May 8, 2026
@adarsh0728
Copy link
Copy Markdown
Member

  getPipelineStatus now checks actual conditions via IsHealthy(), so
  pipelines in Running phase may not immediately report Healthy on CI.
  Add an Eventually wait for both pipelines — same pattern used for
  the MonoVertex wait added in numaproj#3408.

  Fixes numaproj#3414

Signed-off-by: suryapratap-01 <suryapratap.personal@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor getPipelineStatus to have a stronger status logic

2 participants