Skip to content

feat: expose culling config on workspace list item#1204

Open
Bhavd33p wants to merge 3 commits into
kubeflow:notebooks-v2from
Bhavd33p:feat/expose-culling-config-on-workspace-list-item
Open

feat: expose culling config on workspace list item#1204
Bhavd33p wants to merge 3 commits into
kubeflow:notebooks-v2from
Bhavd33p:feat/expose-culling-config-on-workspace-list-item

Conversation

@Bhavd33p

@Bhavd33p Bhavd33p commented Jun 21, 2026

Copy link
Copy Markdown

Summary

Partially implements #1202 (remaining ACs blocked on #867, #1123, #868)

This PR delivers the backend model change and frontend scaffolding for workspace activity status display. Full acceptance-criteria compliance requires the upstream controller and CRD issues (#867, #1123) to merge first.

What this PR does

Backend

  • Add CullingConfig struct and cullingConfig field to WorkspaceKindInfo API model
  • Populate via buildCullingConfig() from wsk.Spec.PodTemplate.Culling; returns nil when the WorkspaceKind is missing or culling is disabled; defaults maxInactiveSeconds to 86400 when unset
  • Update OpenAPI schema (swagger.json + docs.go) with the new workspaces.CullingConfig type

Frontend

  • Regenerate data-contracts.ts with WorkspacesCullingConfig and updated WorkspacesWorkspaceKindInfo
  • Add cullingUtils.ts with getMsUntilCull and formatTimeUntilCull helpers
  • Enhance WorkspaceDetailsActivity to show idle duration, auto-pause countdown, and last probe result — all conditionally rendered (only when workspace is Running and cullingConfig is present)
  • Unit tests for WorkspaceDetailsActivity (9 tests)

What is approximated / deferred

Acceptance Criterion Status
List view idle duration ✅ existing formatDistanceToNow on Last Activity column
List view culling countdown ⚠️ approximated as lastActivity + maxInactiveSeconds − now; exact eligibleAfter timestamp requires #867/#1123
Detail view probe result (Success/Failure/Timeout) ⚠️ UI is in place but backend hardcodes LastProbe: nil pending #867
Human-readable relative time formatDistanceToNow throughout
No activity UI without activity data ✅ conditional rendering
Unit tests ✅ 9 tests covering with/without activity data
Cypress tests for detail activity view ❌ deferred until lastProbe is populated by the controller (#867)

🛑 Depended on by: #1203 (frontend culling warning notifications)
🛑 Full implementation unblocked by: #867, #1123, #868

Test plan

  • 7 unit tests for buildCullingConfig(): nil WSK, missing UID, disabled culling, absent culling field, custom value, default value, absent Enabled field
  • Handler integration test asserts cullingConfig present in JSON when culling is enabled
  • Handler integration test asserts cullingConfig absent when WorkspaceKind is missing
  • Full API envtest suite (110 specs) passes
  • 9 Jest unit tests for WorkspaceDetailsActivity (with/without culling config, probe results, running vs paused state)

@github-project-automation github-project-automation Bot moved this to Needs Triage in Kubeflow Notebooks Jun 21, 2026
@google-oss-prow google-oss-prow Bot added the area/backend area - related to backend components label Jun 21, 2026
@google-oss-prow google-oss-prow Bot requested review from caponetto and thaorell June 21, 2026 06:38
@google-oss-prow google-oss-prow Bot added area/frontend area - related to frontend components area/v2 area - version - kubeflow notebooks v2 size/L labels Jun 21, 2026
@Bhavd33p Bhavd33p changed the title feat(backend): expose culling config on workspace list item feat: expose culling config on workspace list item Jun 21, 2026
@Bhavd33p Bhavd33p force-pushed the feat/expose-culling-config-on-workspace-list-item branch from cf1b401 to a4983e9 Compare June 21, 2026 06:41
Bhavd33p and others added 2 commits June 21, 2026 12:13
…#1202)

Surface WorkspaceKind culling settings (maxInactiveSeconds) directly on
each WorkspaceListItem so the frontend can compute time-to-auto-pause
without a separate WorkspaceKind fetch.

- Add CullingConfig struct to WorkspaceKindInfo model
- Populate it via buildCullingConfig() from the WorkspaceKind spec;
  returns nil when the kind is missing or culling is disabled
- Update OpenAPI schema (swagger.json + docs.go) with the new type

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: [Bhavdeep Singh] <bhavdeep3singh@gmail.com>
…ubeflow#1202)

- Add unit tests for buildCullingConfig() covering: nil WSK, missing UID,
  disabled culling, absent culling field, custom MaxInactiveSeconds, and
  defaulting to 86400 when MaxInactiveSeconds is unset
- Extend workspaces handler test to assert cullingConfig is present in the
  JSON response when culling is enabled, and absent when the WorkspaceKind
  is missing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: [Bhavdeep Singh] <bhavdeep3singh@gmail.com>
@Bhavd33p Bhavd33p force-pushed the feat/expose-culling-config-on-workspace-list-item branch from a4983e9 to 1d02a76 Compare June 21, 2026 06:44
…eflow#1202)

- Add cullingConfig to data-contracts (maxInactiveSeconds)
- Add cullingUtils with getMsUntilCull and formatTimeUntilCull helpers
- Enhance WorkspaceDetailsActivity to show idle duration, auto-pause
  countdown, and last probe result with timestamp (conditional on
  culling config presence and running state)
- Add unit tests for WorkspaceDetailsActivity (9 tests)

Signed-off-by: [Bhavdeep Singh] <bhavdeep3singh@gmail.com>
@google-oss-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign andyatmiami, ederign for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow google-oss-prow Bot added size/XL and removed size/L labels Jun 21, 2026

@thaorell thaorell 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.

Hi @Bhavd33p, thank you for contributing to Kubeflow Notebooks. Since this is a major feature that you are contributing, can you please split the PR into 2 separate PRs: one for frontend and one for backend?

@Bhavd33p

Bhavd33p commented Jun 22, 2026

Copy link
Copy Markdown
Author

Hi @thaorell , Yes sure I will make two PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/backend area - related to backend components area/frontend area - related to frontend components area/v2 area - version - kubeflow notebooks v2 size/XL

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

2 participants