Show workspace owner and add filter toggle for cluster admins#8
Show workspace owner and add filter toggle for cluster admins#8SupremeMortal wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughThis PR adds owner-based filtering to Dev Spaces environments. A new ChangesOwner-based Environment Filtering
🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds workspace ownership awareness to Dev Spaces environments, enabling filtering to “my workspaces” and optionally showing/hiding owner info in environment descriptions.
Changes:
- Replace DevWorkspace
cheEditorannotation usage withowner(username) extraction. - Propagate owner into
EnvironmentConfig.tagsand render it inDevSpacesRemoteEnvironmentdescription (with visibility toggle). - Add repository-side filtering (
showOnlyMine) and a provider UI action to toggle “Show only my workspaces”.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| plugin/src/main/kotlin/com/redhat/devtools/toolbox/openshift/DevWorkspace.kt | Switches workspace annotation mapping from editor to owner username. |
| plugin/src/main/kotlin/com/redhat/devtools/toolbox/environment/DevSpacesRemoteEnvironment.kt | Builds description including owner and adds owner-visibility toggle. |
| plugin/src/main/kotlin/com/redhat/devtools/toolbox/datasource/DevWorkspacesDataSource.kt | Propagates owner (workspace or namespace-level) into environment tags. |
| plugin/src/main/kotlin/com/redhat/devtools/toolbox/EnvironmentRepository.kt | Adds “only mine” filtering, username resolution, sorting, and owner visibility sync. |
| plugin/src/main/kotlin/com/redhat/devtools/toolbox/DevSpacesRemoteProvider.kt | Adds UI action to toggle filtering and changes environments flow type to StateFlow. |
| plugin/src/main/kotlin/com/redhat/devtools/toolbox/DevSpacesPlugin.kt | Wires coroutineScope into provider for stateIn usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
As a cluster administrator who can see all DevWorkspaces across the cluster, I want to be able to identify which workspace belongs to which user and quickly filter down to only my own workspaces, so that I can navigate a long list of workspaces with duplicate names without losing track of whose is whose. - Resolve workspace owner from the che.eclipse.org/username annotation on the DevWorkspace resource, falling back to the same annotation on the OpenShift Project/namespace - Display the owner alongside the workspace phase in the description field (e.g. "john.doe | Running"), sorted alphabetically by owner - Add a "Show only my workspaces" toggle to the provider's action menu, resolved against the logged-in user via OpenShiftClient.currentUser() - Hide the owner prefix from the description when the filter is active, since all visible workspaces belong to the current user at that point - Remove the unused cheEditor field from DevWorkspace
| private var activePortForward: LocalPortForward? = null | ||
|
|
||
| // Public reactive properties (observed by Toolbox UI) | ||
| override val secondaryInformation: String? = initialConfig.tags["owner"] |
| override fun run() { | ||
| repository.currentUserOnly.value = !repository.currentUserOnly.value | ||
| } |
| // Username of the currently logged-in OpenShift user (resolved on first fetch) | ||
| private var currentUsername: String? = null |
| } catch (e: Exception) { | ||
| logger.warn("Could not resolve current username: ${e.message}") | ||
| null | ||
| } |
As a cluster administrator who can see all DevWorkspaces across the cluster, I want to be able to identify which workspace belongs to which user and quickly filter down to only my own workspaces, so that I can navigate a long list of workspaces with duplicate names without losing track of whose is whose.