Skip to content

chore: expose more conditions in component status#10032

Open
cjc7373 wants to merge 8 commits intomainfrom
support/refactor-comp-status
Open

chore: expose more conditions in component status#10032
cjc7373 wants to merge 8 commits intomainfrom
support/refactor-comp-status

Conversation

@cjc7373
Copy link
Contributor

@cjc7373 cjc7373 commented Jan 29, 2026

The current component condition provides very little information about why the component is not healthy.

@github-actions github-actions bot added the size/L Denotes a PR that changes 100-499 lines. label Jan 29, 2026
@apecloud-bot
Copy link
Collaborator

Auto Cherry-pick Instructions

Usage:
  - /nopick: Not auto cherry-pick when PR merged.
  - /pick: release-x.x [release-x.x]: Auto cherry-pick to the specified branch when PR merged.

Example:
  - /nopick
  - /pick release-1.1

@cjc7373 cjc7373 added the pick-1.1 Auto cherry-pick to release-1.1 when PR merged label Jan 29, 2026
@cjc7373 cjc7373 force-pushed the support/refactor-comp-status branch from eae9b69 to 88b0496 Compare January 30, 2026 09:50
@codecov
Copy link

codecov bot commented Jan 30, 2026

Codecov Report

❌ Patch coverage is 54.82234% with 89 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.45%. Comparing base (a7ee586) to head (3e4beef).

Files with missing lines Patch % Lines
...ers/apps/component/transformer_component_status.go 54.25% 31 Missing and 12 partials ⚠️
...rollers/apps/cluster/transformer_cluster_status.go 48.38% 24 Missing and 8 partials ⚠️
controllers/apps/cluster/utils.go 74.28% 6 Missing and 3 partials ⚠️
pkg/controller/component/available.go 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10032      +/-   ##
==========================================
- Coverage   51.45%   51.45%   -0.01%     
==========================================
  Files         530      530              
  Lines       58295    58385      +90     
==========================================
+ Hits        29998    30043      +45     
- Misses      25362    25392      +30     
- Partials     2935     2950      +15     
Flag Coverage Δ
unittests 51.45% <54.82%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

// TODO: replicas == 0, stopped, updating, abnormal?
WithPhases: pointer.String(string(appsv1.RunningComponentPhase)),
WithPhases: pointer.String(strings.Join(
[]string{string(appsv1.RunningComponentPhase), string(appsv1.UpdatingComponentPhase)},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updating is added as a default available phase, because any pod fail (such as a node down) can cause the phase to become Updating

@cjc7373 cjc7373 force-pushed the support/refactor-comp-status branch from a001419 to 8038a82 Compare February 3, 2026 07:45
@cjc7373 cjc7373 marked this pull request as ready for review February 3, 2026 07:46
@cjc7373 cjc7373 requested a review from a team as a code owner February 3, 2026 07:46
FailedComponentPhase ComponentPhase = "Failed"
)

// component conditions
Copy link
Contributor

Choose a reason for hiding this comment

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

Recommend a set of condition definitions:

const (
    // ConditionTypeProvisioned indicates whether the required resources have been provisioned
    ConditionTypeProvisioned = "Provisioned"

    // ConditionTypeReady indicates whether the Component is ready to provide service
    ConditionTypeReady = "Ready"

    // ConditionTypeHealthy indicates whether the Component is healthy
    ConditionTypeHealthy = "Healthy"

    // ConditionTypeAvailable indicates whether the Component is available (based on availability policy)
    ConditionTypeAvailable = "Available"

    // ConditionTypeProgressing indicates whether the Component is undergoing changes
    ConditionTypeProgressing = "Progressing" // or Reconciling

    // ConditionTypeTerminating indicates whether the Component is being terminated
    ConditionTypeTerminating = "Terminating"
)

@leon-ape leon-ape marked this pull request as draft February 10, 2026 02:17
@cjc7373 cjc7373 marked this pull request as ready for review March 6, 2026 09:49
@cjc7373 cjc7373 requested a review from leon-ape March 6, 2026 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pick-1.1 Auto cherry-pick to release-1.1 when PR merged size/L Denotes a PR that changes 100-499 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants