Skip to content

feat(clusters): hide container ops on self-hosted, gate Deployments on auth#1540

Merged
dawsontoth merged 1 commit into
stagefrom
claude/self-hosted-cluster-features-b1e2fc
Jul 20, 2026
Merged

feat(clusters): hide container ops on self-hosted, gate Deployments on auth#1540
dawsontoth merged 1 commit into
stagefrom
claude/self-hosted-cluster-features-b1e2fc

Conversation

@dawsontoth

Copy link
Copy Markdown
Contributor

What

Hides a few cluster features that don't apply to self-hosted clusters, plus gates the Deployments menu item on cluster authentication.

1. Container actions hidden on self-hosted clusters

Self-hosted clusters have no managed container lifecycle — Harper doesn't control their runtime — so the Container action group (Start, Start in safe mode, Restart, Restart in safe mode, Stop) is now hidden for them in:

  • the cluster-card context menu / "…" dropdown (ClusterCard)
  • the per-instance context menu / "…" dropdown (useInstanceMenuItems)

This matches the existing behavior of the cluster-overview "Cluster actions" dropdown (ClusterStateMenu), which already returns null for self-hosted clusters — so no change was needed there.

Note: the request specifically named Restart / Restart in safe mode / Stop, but I hid the whole group (Start / Start in safe mode too) for consistency with ClusterStateMenu's "self-hosted clusters have no container ops" rule. In practice self-hosted clusters are RUNNING, so only the three named ones were ever visible anyway.

2. "Deployments" gated on cluster authentication

The Deployments cluster-card menu item now only appears once you've authenticated with the cluster (!!auth.user, the same signal ClusterHome uses for its connected state) — previously it showed whenever you had view permission.

Verification

  • tsc -b, oxlint, dprint, and the full vitest suite (241 files / 1732 tests) all pass.
  • Verified live against real cluster data (worktree dev server on :5173) with a managed cluster ("Anvils") and a self-hosted cluster ("Self"), neither authenticated:
Menu Container actions Deployments
Self (self-hosted) cluster card absent ✓ absent (not authed) ✓
Self instance menu absent ✓
Anvils (managed) cluster card — control Restart / Restart in safe mode / Stop present ✓ absent (not authed) ✓

The managed cluster confirms the container-ops change is correctly scoped to self-hosted; Deployments disappearing for both clusters (where it previously showed unconditionally) confirms the auth gate.

🤖 Generated with Claude Code

…n auth

Self-hosted clusters have no managed container lifecycle (Harper doesn't
control their runtime), so the Container action group — Start, Start in
safe mode, Restart, Restart in safe mode, Stop — is now hidden for them
in both the cluster-card context menu (ClusterCard) and the per-instance
menu (useInstanceMenuItems). This matches ClusterStateMenu, which already
hides the "Cluster actions" dropdown entirely for self-hosted clusters.

Also gate the "Deployments" cluster-card menu item on cluster
authentication (!!auth.user, the same signal ClusterHome uses for its
connected state), so it only appears once you've authenticated with the
cluster.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dawsontoth
dawsontoth requested a review from a team as a code owner July 20, 2026 18:03

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request hides container lifecycle actions (such as start, stop, and restart) for self-managed/self-hosted clusters in both the instance menu items and the cluster card, as Harper does not control their runtime. Additionally, it restricts the visibility of the deployments action in the cluster card to authenticated users. There are no review comments, and I have no feedback to provide.

@github-actions

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 50.99% 5434 / 10656
🔵 Statements 51.56% 5818 / 11283
🔵 Functions 43.21% 1331 / 3080
🔵 Branches 44.44% 3666 / 8249
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/features/cluster/useInstanceMenuItems.tsx 2.17% 0% 0% 2.27% 49-221
src/features/clusters/components/ClusterCard.tsx 0% 0% 0% 0% 53-439
Generated in workflow #1560 for commit cbd0565 by the Vitest Coverage Report Action

@DavidCockerill DavidCockerill left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM — clean visibility fix. Hiding the Container group on self-hosted clusters is correct (Harper doesn't control their runtime), and it uses the canonical clusterIsSelfManaged / the isSelfManaged param consistently, so the cluster card, per-instance menu, and ClusterStateMenu now all agree. Verified isSelfManaged is in scope (it's a declared param of useInstanceMenuItems, already used just below), so no undefined-ref risk. One minor, non-blocking: the Deployments gate uses !!auth.user (any authenticated Studio user) — worth confirming that's the intended signal vs a cluster-scoped one, but it's a reasonable minimum.

— DAIvid (Claude Fable 5)

@dawsontoth
dawsontoth added this pull request to the merge queue Jul 20, 2026
@dawsontoth

Copy link
Copy Markdown
Contributor Author

Yup, it's intentional on the Deployments.

Merged via the queue into stage with commit f47ceba Jul 20, 2026
2 checks passed
@dawsontoth
dawsontoth deleted the claude/self-hosted-cluster-features-b1e2fc branch July 20, 2026 18:16
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