Skip to content

Use pointer semantics for entity update inputs (SDK v0.2.15) - #248

Merged
chrisghill merged 2 commits into
mainfrom
bump-sdk-dep
Jul 31, 2026
Merged

Use pointer semantics for entity update inputs (SDK v0.2.15)#248
chrisghill merged 2 commits into
mainfrom
bump-sdk-dep

Conversation

@chrisghill

Copy link
Copy Markdown
Member

What

Bumps the massdriver-sdk-go dependency and updates the project, environment,
and component update commands to match the SDK's new UpdateInput shape.

The SDK changed UpdateInput.Name / Description from string to *string
(and added *bool fields elsewhere) so it can distinguish an unset field
from an intentionally empty one. A nil pointer / nil map now means "leave
this value unchanged at the server."

Changes

  • Bump SDK to v0.2.15 (needed for mass whoami; also brings the pointer-based
    update inputs).
  • Only send changed fields. Each update command now sets a field on UpdateInput
    only when its flag was explicitly passed (cmd.Flags().Changed(...)), letting nil
    signal "unchanged."
  • Drop the pre-update Get + backfill. Previously each command fetched the current
    entity and re-sent every existing value so unset flags wouldn't blank the field. The
    server now handles the merge, so this extra round-trip is gone.
  • Reject no-op updates. Running an update with no flags now errors with
    nothing to update: set at least one of --name, --description, or --attributes
    instead of silently making a meaningless API call that reported success.

Why it matters

Before the pointer change, an argument-less update would have blanked name/description
at the server — the old backfill fetch masked that. With the fetch removed, the explicit
guard makes the "nothing to update" case a clear error rather than a misleading
"✅ updated".

Testing

  • go build ./... and go vet ./cmd/ pass.

@chrisghill
chrisghill merged commit c634459 into main Jul 31, 2026
5 checks passed
@chrisghill
chrisghill deleted the bump-sdk-dep branch July 31, 2026 20:35
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