Skip to content

Display desired status unconditionally#6377

Merged
Karakatiza666 merged 1 commit into
mainfrom
show-desired
Jun 2, 2026
Merged

Display desired status unconditionally#6377
Karakatiza666 merged 1 commit into
mainfrom
show-desired

Conversation

@Karakatiza666

Copy link
Copy Markdown
Contributor

Tested: manually, updated the unit test

@Karakatiza666 Karakatiza666 requested a review from snkas June 2, 2026 13:16
expect(out).toContain('deployment_runtime_status: (none)')
expect(out).not.toContain('desired is')
expect(out).toContain('deployment_resources_status: Stopped (desired is undefined)')
expect(out).toContain('deployment_runtime_status: (none) (desired is null)')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you make it "desired is (none)" for both?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If it is not set.

@mythical-fred mythical-fred left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Removing the conditional is fine if the team wants the desired status always visible (good for debugging state transitions), but the new spec test pins behaviour I'd flag as a UX regression: when deployment_runtime_desired_status is null/missing in the API payload, the UI now renders the literal string (desired is null) or (desired is undefined). That's worse than the old "just hide it" path the previous version took, and it leaks JS coercion into user-visible text.

Two ways to keep the unconditional intent without the ugly string:

  1. Show (none) for nullish desired, matching how formatScalar already handles missing values: `${base} (desired is ${formatScalar(desired)})`.
  2. Or keep the always-append behaviour for present values but suppress only the nullish branch (a one-line guard), which preserves the "same as current" rendering that this PR is correctly trying to add back.

Either keeps the new "always shows desired even when it matches current" semantics that the PR title is going for, without paying the cost of String(undefined) ending up on screen. Not a blocker — your call which framing fits the UX you want — but the current spec test is effectively asserting a bug.

Also tiny: the new comment // Render a status, always appending the desired value:"Running (desired is Stopped)". is missing a space after the colon.

Signed-off-by: Karakatiza666 <bulakh.96@gmail.com>
@Karakatiza666

Copy link
Copy Markdown
Contributor Author

Changed to ", desired is X"

@Karakatiza666 Karakatiza666 enabled auto-merge June 2, 2026 17:40
@Karakatiza666 Karakatiza666 added this pull request to the merge queue Jun 2, 2026
return base
}
return `${base} (desired is ${String(desired)})`
return `${base}, desired is ${desired ?? `(none)`}`

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nit: this file already defines const NONE = '(none)' just above (line 229) and uses it in formatScalar/formatJson. Consider reusing it here for consistency, e.g. `${base}, desired is ${desired ?? NONE}`. Also the comment on line 235 still shows the old parenthesized example ("Running (desired is Stopped)") — worth updating to the new comma form ("Running, desired is Stopped").

Merged via the queue into main with commit 9b06b7f Jun 2, 2026
1 check passed
@Karakatiza666 Karakatiza666 deleted the show-desired branch June 2, 2026 19:24
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.

3 participants