Skip to content

feat(cli): resolve a workload into the describe view - #325

Draft
rogirun wants to merge 1 commit into
mainfrom
feat/cli-describe-view
Draft

feat(cli): resolve a workload into the describe view#325
rogirun wants to merge 1 commit into
mainfrom
feat/cli-describe-view

Conversation

@rogirun

@rogirun rogirun commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds DescribeView, the single struct every describe section renders from. Values are typed: replicas are {desired, current, ready} numbers rather than a "3/4" a consumer re-parses. Pods are narrowed top-down through the definition's own selectors. Passing no pods yields the same struct with live fields empty, which is what file mode renders.

Part of a seven-PR stack implementing kli describe (#206). Targets feat/cli-describe-pod-attribution, which must merge first.

Related issue(s)

Refs #206

Checklist

  • All commits are signed off with DCO (git commit -s)
  • New/modified files have SPDX license and copyright headers
  • Documentation updated (if applicable)
  • Tests pass (make check)
  • No proprietary or internal information included

🤖 Generated with Claude Code

@rogirun
rogirun force-pushed the feat/cli-describe-pod-attribution branch from 7fb7e92 to 1367acb Compare September 6, 2026 12:27
@rogirun
rogirun force-pushed the feat/cli-describe-view branch from c300c49 to 7bb0144 Compare September 6, 2026 12:59
Base automatically changed from feat/cli-describe-pod-attribution to main September 7, 2026 10:36
@rogirun
rogirun force-pushed the feat/cli-describe-view branch from 7bb0144 to b7ee02d Compare September 7, 2026 10:43
Every describe section - header, tree, phase, resources - has to agree, and a
machine consumer has to read the same picture a human does. One struct is what
guarantees that, so DescribeView carries the whole workload and each rendering
is a projection of it.

Values are typed: replicas are {desired, current, ready} numbers rather than a
"3/4" a consumer re-parses and that breaks silently when the rendering changes.
An unscheduled pod has a null node, not an empty string standing in for one.

ResolveDescribe builds the spec-only tree, then narrows the pods handed to it
top-down through the definition's own PodSelector: ComponentTypeSelector picks
the role, ComponentInstanceSelector and ReplicaSelector split a multi-instance
component into one child per instance. Passing no pods yields the same struct
with every live field empty, which is what file mode will render.

Requested resources come from the spec times the desired scale, so they do not
move when a replica is missing; cpu is millicores and memory bytes, so a
consumer sums integers. tree.Build drops the root, so a root-hosted pod
template (Deployment, Job, StatefulSet, Pod) is rebuilt from the root component
and goes through the same path. An intermediate component the workload never
populates, such as a Deployment's ReplicaSet, is collapsed rather than rendered
as an empty row.

Refs #206

Signed-off-by: Roee Gil <roee.gil@run.ai>
@rogirun
rogirun force-pushed the feat/cli-describe-view branch from b7ee02d to 5dcd00c Compare September 7, 2026 12:20
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.

1 participant