Skip to content

Migrate share-link create/update dry-run to renderOperation#351

Merged
AndreyVMarkelov merged 1 commit into
masterfrom
feature/dry-run-share-link
Jul 10, 2026
Merged

Migrate share-link create/update dry-run to renderOperation#351
AndreyVMarkelov merged 1 commit into
masterfrom
feature/dry-run-share-link

Conversation

@AndreyVMarkelov

@AndreyVMarkelov AndreyVMarkelov commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Third PR in the dry-run generalization series. Routes the two share-link mutation commands' dry-run branches through the shared renderOperation helper (added in #350), dropping the duplicated commandOutput(cmd).Render(..., newJSONCommandOperationOutput(cmd, ...)) glue.

Changes

  • cmd/share_link_create.gorenderShareLinkCreateDryRunOutput calls renderOperation.
  • cmd/share_link_update.gorenderShareLinkUpdateDryRunOutput calls renderOperation.

Why these two next

They validate that renderOperation generalizes beyond the mkdir/restore shape: share-link uses shareLinkJSONMetadata plus a dedicated result-input struct carrying dry_run, not jsonMetadata. It slotted in with no change to the helper — confirming the envelope-only abstraction is shape-agnostic. Risk stays low: both are single planned operations with no discovery or both-modes path.

Behavior

Unchanged. The text closure already passed to .Render moves into renderOperation verbatim. The share-link dry-run JSON tests and the cross-command contract tests all pass.

Route renderShareLinkCreateDryRunOutput and
renderShareLinkUpdateDryRunOutput through the shared renderOperation
helper, dropping the duplicated commandOutput/newJSONCommandOperationOutput
glue.

These commands use shareLinkJSONMetadata and a dedicated result-input
struct rather than jsonMetadata, so they confirm renderOperation
generalizes beyond the mkdir/restore shape. Output is unchanged; the
share-link dry-run JSON tests and the cross-command contract tests pass.
@AndreyVMarkelov AndreyVMarkelov merged commit 4ac4f9d into master Jul 10, 2026
13 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