Skip to content

refactor(platform): share instance creation form - #1574

Merged
skevetter merged 1 commit into
mainfrom
refactor/platform-share-create-instance-form
Oct 19, 2026
Merged

skevetter merged 1 commit into
mainfrom
refactor/platform-share-create-instance-form

Conversation

@skevetter

@skevetter skevetter commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Move daemonclient interactive form creation into the shared platform form package.
  • Preserve CreateInstance behavior and add CreateInstanceOnCluster using a focused InstanceIdentity value object.
  • Remove duplicate daemonclient form implementation.

Why

Daemonclient maintained a separate 182-line copy of the instance creation flow. Sharing the form implementation avoids drift while preserving the selected cluster for daemonclient workspace creation.

Validation

  • mise run cli:format — passed
  • mise run cli:lint:ci — passed (0 issues)
  • go build ./... — passed
  • go test ./pkg/platform/... ./pkg/client/clientimplementation/daemonclient/... — passed
  • git grep -n createInstanceInteractive -- "*.go" — no matches

CodeRabbit CLI

Attempted on current head 8fd29b33d9527ece1ba5469e957889e42594869f: failed with Rate limit exceeded (all 3 included free OSS reviews used; reported wait time 39 minutes; on-demand review unavailable). The earlier 0-finding review covered superseded head 6848eb766e26497e43698c4176e3c1a39b8053e4.

Auto-merge

Eligible: yes. Additive repo-internal platform-form helper; no behavior-breaking API change. Non-test changed lines: 248.

Next

Obtain CodeRabbit coverage for the final head when the CLI limit resets.

Summary by CodeRabbit

  • Improvements
    • Workspace instances created through the daemon client are now associated with the selected cluster. Project, template, and template-version selection remains part of the creation flow, and workspace details continue to be saved after successful creation.
    • Cluster targeting is handled consistently with the shared workspace creation experience, helping ensure the instance is created in the intended environment.

@skevetter skevetter added the surface-refactor Unattended refactor (surface) label Oct 19, 2026
@netlify

netlify Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit 8fd29b3
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6ad59d5d2a192082cc766d6b

@netlify

netlify Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for images-devsy-sh canceled.

Name Link
🔨 Latest commit 8fd29b3
🔍 Latest deploy log https://app.netlify.com/projects/images-devsy-sh/deploys/6ad59d5d38ddf713390a6ee9

@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 30cbd6e2-d4ed-4642-a0eb-2617866012d6
📥 Commits

Reviewing files that changed from the base of the PR and between 1f47cd1 and 8fd29b3.

📒 Files selected for processing: 3
  • pkg/client/clientimplementation/daemonclient/create.go
  • pkg/client/clientimplementation/daemonclient/form.go
  • pkg/platform/form/form.go
💤 Files with no reviewable changes: 1
  • pkg/client/clientimplementation/daemonclient/form.go

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

📝 Walkthrough

The platform form package now creates workspace instances from identity values and retains the selected cluster in its creation result. The daemon client uses this shared flow instead of its local interactive instance-creation implementation.

Changes: Workspace instance creation

Layer / File(s) Summary
Shared instance creation flow
pkg/platform/form/form.go
CreateInstance now uses the shared creation flow. The new CreateInstanceOnCluster sets the instance target cluster to the selected cluster. InstanceIdentity groups the identity inputs, and the creation result includes the selected cluster.
Daemon client integration
pkg/client/clientimplementation/daemonclient/create.go, pkg/client/clientimplementation/daemonclient/form.go
The daemon client passes workspace identity values to CreateInstanceOnCluster. Its former local interactive instance-creation flow was removed.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Refactor

Merge Risk: ⚪ Minimal · up to 8fd29

The shared creation flow preserves the checked workspace-creation behavior and is ready to merge after normal checks.

Security architecture risk: ⚪ Minimal · up to 8fd29

The shared flow preserves workspace identity, project selection, cluster targeting, and creation ordering. The existing creation API remains compatible. No material security risk introduced or worsened by this refactor was identified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The changed operation remains workspace creation through the existing daemon path, with namespace derived from the selected project and target derived from the selected cluster. The refactor does not demonstrate expanded tenant, credential, or service authority.

Trust Boundaries and Controls

  • observed — Project, cluster, template, and version selection retain their previous dependencies. Identity and parameter values still become instance metadata and specification fields before the unchanged CreateWorkspace call; moving construction does not introduce a new intermediate persistence sink.

Resilience and Maintainability Implications

  • observed — Selection or parameter-form errors return before workspace creation. Successful creation still precedes local metadata persistence, and the existing-workspace lookup remains the retry shortcut. A configuration-save failure after successful creation remains possible as before; this refactor adds no transactional rollback or concurrency guarantee.
Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Description check Warning The description explains the change, motivation, validation commands, and merge considerations. However, it does not use the required template sections and omits the issue reference, change-type selec… Update the description to follow the repository template. Add the issue reference or state "none", select the change type, complete the AI assistance section, document applicable integration or unit-test coverage and manual verification, co…
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: sharing the instance creation form in the platform package.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the change, motivation, validation commands, and merge considerations. However, it does not use the required template sections and omits the issue reference, change-type selection, AI assistance disclosure, testing checklist, repository checklist, and reviewer notes.

Resolution

Update the description to follow the repository template. Add the issue reference or state "none", select the change type, complete the AI assistance section, document applicable integration or unit-test coverage and manual verification, complete the checklist, and add reviewer notes or remove the section if not applicable.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
✨ Simplify code
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@skevetter
skevetter force-pushed the refactor/platform-share-create-instance-form branch from 223734b to 6848eb7 Compare October 19, 2026 04:25
@skevetter
skevetter force-pushed the refactor/platform-share-create-instance-form branch from 6848eb7 to 8fd29b3 Compare October 19, 2026 04:32
@skevetter
skevetter marked this pull request as ready for review October 19, 2026 05:17
@mergify

mergify Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@skevetter
skevetter merged commit 7682a30 into main Oct 19, 2026
111 checks passed
@skevetter
skevetter deleted the refactor/platform-share-create-instance-form branch October 19, 2026 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/l surface-refactor Unattended refactor (surface)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant