Skip to content

client: refactor ContainerRename to wrap options/result structs#51315

Merged
thaJeztah merged 1 commit intomoby:masterfrom
austinvazquez:refactor-client-container-rename
Oct 29, 2025
Merged

client: refactor ContainerRename to wrap options/result structs#51315
thaJeztah merged 1 commit intomoby:masterfrom
austinvazquez:refactor-client-container-rename

Conversation

@austinvazquez
Copy link
Contributor

- What I did
#50965

This change refactors client ContainerRename implementation to take client module defined options and result structs to decouple the client module from API changes.

- How I did it

- How to verify it

- Human readable description for the release notes

- A picture of a cute animal (not mandatory but encouraged)

@austinvazquez austinvazquez requested a review from Copilot October 29, 2025 00:19
@austinvazquez austinvazquez self-assigned this Oct 29, 2025
@austinvazquez austinvazquez added kind/refactor PR's that refactor, or clean-up code area/go-sdk labels Oct 29, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the ContainerRename API to use structured options and result types instead of simple string parameters, improving API consistency and enabling future extensibility.

  • Introduces ContainerRenameOptions and ContainerRenameResult structs to wrap input parameters and return values
  • Updates the ContainerRename method signature to accept options struct and return result struct
  • Updates all test files to use the new API structure

Reviewed Changes

Copilot reviewed 4 out of 6 changed files in this pull request and generated no comments.

File Description
client/container_rename.go Defines new options/result structs and refactors the main ContainerRename implementation
client/client_interfaces.go Updates the ContainerAPIClient interface to match the new method signature
client/container_rename_test.go Updates unit tests to use the new structured API
integration/container/rename_test.go Updates integration tests to use the new structured API and handle return values

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


// ContainerRenameOptions represents the options for renaming a container.
type ContainerRenameOptions struct {
NewContainerName string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps NewName would work for this; slightly shorter.

Let me push an update.

Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah force-pushed the refactor-client-container-rename branch from 721c473 to d2e7465 Compare October 29, 2025 09:14
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaJeztah thaJeztah merged commit b5971b6 into moby:master Oct 29, 2025
288 of 292 checks passed
@austinvazquez austinvazquez deleted the refactor-client-container-rename branch October 29, 2025 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/dependencies area/go-sdk kind/refactor PR's that refactor, or clean-up code module/client release-blocker PRs we want to block a release on status/4-merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants