Skip to content

refactor(platform): share form option pickers with daemonclient - #1550

Merged
skevetter merged 2 commits into
mainfrom
refactor/platform-share-form-fields
Oct 18, 2026
Merged

skevetter merged 2 commits into
mainfrom
refactor/platform-share-form-fields

Conversation

@skevetter

@skevetter skevetter commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Share the option pickers between pkg/platform/form and daemonclient.
  • Export ProjectOptions, ClusterOptions, TemplateOptions, TemplateVersionOptions in pkg/platform/form.
  • daemonclient/form.go calls form.* and drops its ProjectOption, TemplateOption, CancelFunc aliases and the four picker copies.
  • Parameter-field helpers are unchanged on both sides.

Why

The four picker functions were duplicated with only the client type name differing. One copy removes drift risk. No behaviour or output change.

Validation

  • go build ./...
  • go vet ./pkg/platform/... ./pkg/client/...
  • GOOS=windows go build ./pkg/platform/... ./pkg/client/... ./cmd/...
  • go build ./cmd/pro/provider/create/... ./cmd/pro/provider/update/...
  • go test ./pkg/platform/... ./pkg/client/clientimplementation/daemonclient/...
  • mise run cli:format
  • mise run cli:lint:ci (0 issues)

CodeRabbit CLI

Commit 3108ecc88: rate-limited (free OSS quota, 22 min wait). Prior commit abc334cbc on the same files: 0 findings. Re-run pending.

Auto-merge

  • Eligible: yes, once the CodeRabbit re-run is clean.
  • Non-test changed lines: 156 (daemonclient 9 added / 125 deleted; platform 13 added / 9 deleted). Files: 2.

Next

Share the parameter-field helpers (FieldParameter, PrepareParameters, ParameterFields, RenderParameters, ~100 lines) and then unify create/update flows.

Summary by CodeRabbit

  • Refactor
    • Interactive create and update flows now use consistent handling for project, cluster, template, and template-version choices. The available options remain unchanged, preserving existing selection behavior while keeping choices consistent across both flows. No other user-facing changes are included in this update.

daemonclient/form.go duplicated the huh option and parameter helpers already in platform/form. Export the platform copies and call them from daemonclient; delete the duplicate block. No behaviour change.
@skevetter skevetter added the surface-refactor Unattended refactor (surface) label Oct 18, 2026
@netlify

netlify Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for images-devsy-sh canceled.

Name Link
🔨 Latest commit 3108ecc
🔍 Latest deploy log https://app.netlify.com/projects/images-devsy-sh/deploys/6ad4f88238ddf71339e3df7f

@coderabbitai

coderabbitai Bot commented Oct 18, 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: 506a1ad7-7754-422a-a6bb-263540be9b73
📥 Commits

Reviewing files that changed from the base of the PR and between 675485e and 3108ecc.

📒 Files selected for processing: 2
  • pkg/client/clientimplementation/daemonclient/form.go
  • pkg/platform/form/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 form package exports shared project, cluster, template, and template-version option helpers. The daemon client now uses those helpers and shared option types instead of local option builders.

Changes: Shared form option helpers

Layer / File(s) Summary
Export shared option helpers
pkg/platform/form/form.go
The form package exports the project, cluster, template, and template-version option helpers. Its create and update selection forms call the exported helpers.
Use shared options in daemonclient
pkg/client/clientimplementation/daemonclient/form.go
The daemon client uses the shared helpers and option types. It removes local option builders and aliases, including code that ordered the default template first and logged lookup errors before canceling the form.

Priority: ⬇️ Low

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

Change: Refactor

Merge Risk: ⚪ Minimal · up to 3108e

The shared option pickers preserve the checked selection and error behavior. No issue identified here prevents merging after normal checks.

Security architecture risk: ⚪ Minimal · up to 3108e

The shared helpers preserve the existing client authority, project-scoped lookups, selection behavior, and cancellation handling. The reviewed changes introduce no identified material security risk.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The inspected migration does not expand effective authority or project exposure: the same interactive selections feed the same project-scoped lookups and existing create/update persistence paths. Exporting these Go helpers does not itself create a remote entrypoint.

Trust Boundaries and Controls

  • observed — The helpers remain option producers, not authorization controls. They retain caller-supplied context and client authority, scope cluster/template requests by the selected project's name, and cancel the active form on lookup failure rather than proceeding with partial results.
Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: sharing platform form option pickers with daemonclient through a refactor.
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.
  • 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.

@netlify

netlify Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit 3108ecc
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6ad4f88272dc4618c44d4fb0

@skevetter skevetter changed the title refactor(platform): share form option helpers with daemonclient refactor(platform): share form option pickers with daemonclient Oct 18, 2026
@skevetter
skevetter marked this pull request as ready for review October 18, 2026 16:51
@mergify

mergify Bot commented Oct 18, 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 e48bba9 into main Oct 18, 2026
111 checks passed
@skevetter
skevetter deleted the refactor/platform-share-form-fields branch October 18, 2026 17:45
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