Migrate share-link create/update dry-run to renderOperation#351
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Third PR in the dry-run generalization series. Routes the two share-link mutation commands' dry-run branches through the shared
renderOperationhelper (added in #350), dropping the duplicatedcommandOutput(cmd).Render(..., newJSONCommandOperationOutput(cmd, ...))glue.Changes
cmd/share_link_create.go—renderShareLinkCreateDryRunOutputcallsrenderOperation.cmd/share_link_update.go—renderShareLinkUpdateDryRunOutputcallsrenderOperation.Why these two next
They validate that
renderOperationgeneralizes beyond the mkdir/restore shape: share-link usesshareLinkJSONMetadataplus a dedicated result-input struct carryingdry_run, notjsonMetadata. 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
.Rendermoves intorenderOperationverbatim. The share-link dry-run JSON tests and the cross-command contract tests all pass.