Skip to content

refactor(platform): share parameter field helpers with daemonclient - #1558

Merged
skevetter merged 1 commit into
mainfrom
refactor/platform-share-parameter-fields
Oct 18, 2026
Merged

skevetter merged 1 commit into
mainfrom
refactor/platform-share-parameter-fields

Conversation

@skevetter

@skevetter skevetter commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Export PrepareParameters, ParameterFields, RenderParameters, and ParameterTypeBoolean from pkg/platform/form.
  • Delete the verbatim copy of those helpers, plus FieldParameter and paramTypeBoolean, from pkg/client/clientimplementation/daemonclient/form.go (about 120 lines). Daemonclient now calls form.*.
  • No behaviour change. Daemonclient's parameterField defaults empty Type to "string", which reaches the same stringParameterField path as the default: branch in platform/form.

Why

Two verbatim copies of about 110 lines of parameter form code drift independently. This follows #1550, which shared the option pickers the same way. Only the helpers are unified here; create and update flows are untouched.

Validation

  • mise run cli:format (no diff)
  • mise run cli:lint:ci (0 issues)
  • go build ./...
  • go test ./pkg/platform/... ./pkg/client/... (pass)

CodeRabbit CLI

coderabbit review --agent --committed on f6dbb8ac0: completed, 0 findings, 2 files reviewed.

Auto-merge

Eligible: yes. Non-test changed lines: 163 (21 added + 142 deleted) across 2 files. Behaviour-preserving, no restricted paths, no tests removed, no lint rules disabled. Merge decision left to the coordinator.

Next

Unify create and update flows between daemonclient/form.go and platform/form/form.go. Not identical yet: daemonclient create sets Target.Cluster, platform/form does not. Daemonclient's fieldParametersWithValues, assignParameterValue, and assignBoolValue still duplicate platform's buildFieldParameters, assignFieldValue, and assignBoolFieldValue.

AI assistance

AI tools were used: omp agent, anthropic/claude-haiku-5-5. Used for the refactor, validation runs, and the PR body. Change is a mechanical move plus call-site rewrites.

Summary by CodeRabbit

  • Refactor
    • Parameter forms for creating and updating instances continue to use the same defaults, existing-value selection, error handling, and YAML output. The change does not alter the behavior users see when filling out or submitting these forms.

@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 devsydev canceled.

Name Link
🔨 Latest commit f6dbb8a
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6ad512799f33b4a7090b2ff3

@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: 484e803d-7daf-4cb4-a700-746add1cd04f
📥 Commits

Reviewing files that changed from the base of the PR and between 66837e2 and f6dbb8a.

📒 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; 0 remain after this review.

📝 Walkthrough

The shared form package now exports its parameter form helpers and boolean type constant. Daemon client flows for new instances and instance updates use these helpers instead of local parameter form implementations.

Changes: Parameter Form Reuse

Layer / File(s) Summary
Export shared parameter form helpers
pkg/platform/form/form.go
The parameter preparation, field construction, and rendering helpers, plus the boolean type constant, are exported. Internal call sites use the exported names without behavior changes.
Use shared helpers in daemon client
pkg/client/clientimplementation/daemonclient/form.go
New-instance and instance-update flows use the shared helpers. The local parameter form implementation is removed, and error propagation remains in place.

Priority: ⬇️ Low

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

Change: Refactor

Merge Risk: ⚪ Minimal · up to f6dbb

This PR moves daemon parameter forms to shared helpers while preserving defaults, existing values, boolean handling, and error propagation. No actionable merge risk was identified.

Security architecture risk: ⚪ Minimal · up to f6dbb

The shared helpers preserve the existing parameter handling and error behavior. The reviewed change does not introduce a new network entrypoint, increase privileges, or change when workspace changes are applied.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The changed execution path remains within the existing workspace create and update parameter flows. Source comparison identifies no new caller with greater authority, different project or cluster scope, or additional sensitive sink; exported package visibility alone does not expand remote attacker reachability.

Trust Boundaries and Controls

  • observed — Template and project selection remain in the existing client flows. The new helper calls receive parameter data rather than a privileged client or identity, so delegation does not transfer additional service authority into the shared helper contract.

Resilience and Maintainability Implications

  • observed — Form cancellation or resolution and rendering errors return before instance construction or update application. Each flow defers context cancellation. Successful updates modify a deep copy rather than the input instance, and the refactor adds no shared mutable parameter store or new persistence transition.
Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
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 17 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
Title check Passed The title clearly and concisely describes the main refactor: sharing parameter field helpers with daemonclient.
Description check Passed The description explains the change, rationale, behavior impact, validation commands, AI assistance, and follow-up scope. It omits several template headings and checkboxes, but the core information is…
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, rationale, behavior impact, validation commands, AI assistance, and follow-up scope. It omits several template headings and checkboxes, but the core information is complete enough for review.

  • 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 images-devsy-sh canceled.

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

@skevetter
skevetter marked this pull request as ready for review October 18, 2026 19:01
@skevetter
skevetter merged commit 901afee into main Oct 18, 2026
111 checks passed
@skevetter
skevetter deleted the refactor/platform-share-parameter-fields branch October 18, 2026 20:30
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