Skip to content

fix(swiss): show a held scale step on the scaler card and deploy page - #105

Merged
aceforeverd merged 2 commits into
modelsphere:mainfrom
huskcass:fix/swiss-scaler-hold
Oct 26, 2026
Merged

aceforeverd merged 2 commits into
modelsphere:mainfrom
huskcass:fix/swiss-scaler-hold

Conversation

@huskcass

@huskcass huskcass commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

What type of PR is this?

  • bug fix

What this PR does and why

Follow-up to #104. A scaler hold is AbleToScale=True with reason RolloutInProgress, ScaleDownSettling or ScaleDownStabilized. It is not a state of its own: a scaler is either ok or bad.

Surface While held
Overview Scaling tile (inferences) ok, "N replicas, steady"
Deploy page Scaling step (swiss) ok, "N replicas, steady"
Scaler card badge success "steady"
Scaler card condition list the AbleToScale dot is yellow (bg-warning)
  • A hold reports as steady even when desired and current replicas differ. A failure (AbleToScale=False or ScalingActive=False) still wins.
  • Conditions takes an optional warn list of condition types. Only the scaler card passes one (["AbleToScale"], while held); other callers are unchanged.
  • web/src/modules/swiss/lib/scaler.ts holds the failing, hold and neutral rules (scalerFailing, scalerHold, scalerNeutral), shared by the scaler card, the deploy page and the inferences scalerStep.
  • The unused steps.scaler.deferred locale strings are removed.

Which issue(s) this PR fixes

Refs #104

How it was tested

  • inferences/lib.test.ts and swiss/lib/scaler.test.ts: each of the three hold reasons is ok/steady with current 3, desired 1; a hold together with ScalingActive=False is bad.
  • swiss/lib/scaler.test.ts (replaces components/scaler-conditions.test.ts): scalerFailing, scalerHold, scalerNeutral, and the deploy page's scalerStep for steady, failing, a healthy 0.5.0 object (DecisionAvailable=True) and a Prometheus object with no conditions.
  • swiss/components/Conditions.test.tsx: renders Conditions and checks that the AbleToScale dot is bg-warning only when it is listed in warn.
  • npm test (49 files, 446 tests), npm run typecheck, npm run build and npm run build:swiss pass in web/.

Checks

  • go test ./... and gofmt -l . is empty (no Go change)
  • npm run typecheck && npm test && npm run build in web/ (if web/ changed)
  • helm lint --strict helm/console (if the chart changed)
  • Docs updated where behaviour, a config key or a chart value moved
  • No internal hostnames, IPs, registries or credentials

Notes for reviewers

scalerStep in routes/DeploymentDetail.tsx is now exported so it can be tested.

Release note

A held autoscaler step now shows as steady, with only its AbleToScale condition marked in the cluster resources.

The scaler card and the standalone deploy page's Scaling step showed
AbleToScale=True with RolloutInProgress, ScaleDownSettling or
ScaleDownStabilized as steady, while the Overview tile showed it as
waiting. Both now show "holding: <reason>" in the existing waiting style.

- scalerFailing, scalerHold and scalerNeutral move to swiss/lib/scaler.ts
- the inferences Scaling step, the scaler card and the deploy page's
  Scaling step all use them; the inferences step behaves as before
- tests for the helpers and the deploy page's Scaling step

Co-authored-by: aceforeverd <11715200+aceforeverd@users.noreply.github.com>

@huskcass huskcass left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

No blockers.

Verdict: rules now live once in swiss/lib/scaler.ts, Overview output is unchanged, and holds read the same on the card, deploy page and Overview; good to merge.

— Review Golden

A hold (AbleToScale=True with RolloutInProgress, ScaleDownSettling or
ScaleDownStabilized) is not a state of its own: the scaler is ok or bad.

- the Overview tile, the deploy page's Scaling step and the scaler card
  report a hold as steady, even before the replica count catches up
- the only sign of a hold is a warning dot on the AbleToScale condition,
  through a new warn list on Conditions; other callers are unchanged
- drop the unused "deferred" locale strings

Co-authored-by: aceforeverd <11715200+aceforeverd@users.noreply.github.com>

@huskcass huskcass left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

No blockers.

Verdict: holds now read as steady on the Overview, deploy page and scaler card with only a yellow AbleToScale dot, failure still wins, and the bad rule is unchanged; good to merge.

— Review Golden

@aceforeverd
aceforeverd merged commit b7c1745 into modelsphere:main Oct 26, 2026
4 checks passed
@huskcass
huskcass deleted the fix/swiss-scaler-hold branch October 26, 2026 09:55
aceforeverd added a commit that referenced this pull request Oct 26, 2026
…#105)

* fix(swiss): show a held scale step on the scaler card and deploy page

The scaler card and the standalone deploy page's Scaling step showed
AbleToScale=True with RolloutInProgress, ScaleDownSettling or
ScaleDownStabilized as steady, while the Overview tile showed it as
waiting. Both now show "holding: <reason>" in the existing waiting style.

- scalerFailing, scalerHold and scalerNeutral move to swiss/lib/scaler.ts
- the inferences Scaling step, the scaler card and the deploy page's
  Scaling step all use them; the inferences step behaves as before
- tests for the helpers and the deploy page's Scaling step

Co-authored-by: aceforeverd <11715200+aceforeverd@users.noreply.github.com>

* fix(swiss): report a scaler hold as steady

A hold (AbleToScale=True with RolloutInProgress, ScaleDownSettling or
ScaleDownStabilized) is not a state of its own: the scaler is ok or bad.

- the Overview tile, the deploy page's Scaling step and the scaler card
  report a hold as steady, even before the replica count catches up
- the only sign of a hold is a warning dot on the AbleToScale condition,
  through a new warn list on Conditions; other callers are unchanged
- drop the unused "deferred" locale strings

Co-authored-by: aceforeverd <11715200+aceforeverd@users.noreply.github.com>

---------

Co-authored-by: huskcass <333684917+huskcass@users.noreply.github.com>
Co-authored-by: aceforeverd <11715200+aceforeverd@users.noreply.github.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.

2 participants