Skip to content

feat(workstation): add Workstation resource kind#29

Merged
vanducng merged 1 commit into
mainfrom
feat/workstation-resource
Jun 14, 2026
Merged

feat(workstation): add Workstation resource kind#29
vanducng merged 1 commit into
mainfrom
feat/workstation-resource

Conversation

@vanducng

Copy link
Copy Markdown
Contributor

Summary

  • New Workstation resource kind: reconcile SSH workstations via WS RPC (workstations.create/update/delete, permissions.add/remove, linkAgent)
  • SSH credentials (privateKey, host, user, knownHostsFingerprint) declared write-only — excluded from diff, never logged, encrypted at rest by goclaw
  • Prune safety verified: workstations.list returns createdBy; prune skips any resource where createdBy != "gcplane" — imperatively-created workstations (e.g. coding-agent with created_by=vanducng) are never auto-deleted
  • Agent links are add-only (no unlinks) — goclaw has no workstations.links.list RPC yet; guarded by nil current sentinel with explanatory comment

Tests

13 new tests (11 unit + 2 reconciler):

  • Observe found/not-found/strips-internal-fields
  • Create with allowlist + agent links
  • Create without allowlist/agents
  • Update with permission diff (add + remove)
  • Delete idempotent / not-found
  • ListAll with mixed createdBy
  • BuildCreateParams: SSH metadata folding, allowlist/agents exclusion
  • WriteOnlyFields registration
  • TestReconcile_Prune_SkipsNonGcplaneOwned — prune never deletes createdBy=vanducng workstation
  • TestReconcile_Workstation_AdoptExisting — existing non-gcplane workstation takes Update path (no duplicate Create)

All 15 packages pass (go test ./internal/... && go vet ./... && go build ./...).

Deploy note

Do NOT merge the goclaw-config feat/workstation-resource branch until this gcplane release is deployed — reconciling an unknown Workstation kind on the running gcplane would break the reconcile loop.

Reconcile SSH workstations: create/update/delete via WS RPC
(workstations.create/update/delete, permissions.add/remove,
linkAgent). SSH credentials (privateKey/host/user/fingerprint)
are write-only — never returned by API, never logged.

Prune safety: workstations.list returns createdBy; prune skips
any resource where createdBy != gcplane, so imperatively-created
workstations (e.g. coding-agent/vanducng) are never auto-deleted.

Agent links are add-only (nil current → no unlinks) since goclaw
has no workstations.links.list RPC yet.

Adds 11 unit tests (observe, create, update, delete, params, write-only
fields, list-all) + 2 reconciler tests (prune-skips-non-gcplane-owned,
adopt-existing-workstation).
@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@vanducng, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 56 minutes and 57 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5ea88040-2fa7-4fd4-a732-4a214c19a5f6

📥 Commits

Reviewing files that changed from the base of the PR and between b05821f and 647c842.

📒 Files selected for processing (9)
  • internal/manifest/field_config.go
  • internal/manifest/types.go
  • internal/manifest/validate.go
  • internal/provider/goclaw/list_all.go
  • internal/provider/goclaw/provider.go
  • internal/provider/goclaw/workstation_test.go
  • internal/provider/goclaw/workstations.go
  • internal/reconciler/engine_test.go
  • internal/tui/app.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/workstation-resource

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@vanducng vanducng merged commit 88e17ef into main Jun 14, 2026
6 checks passed
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