8000 Copy the api/types/time package to internal client/daemon packages by austinvazquez · Pull Request #50722 · moby/moby · GitHub
[go: up one dir, main page]

Skip to content

Conversation

austinvazquez
Copy link
Contributor
@austinvazquez austinvazquez commented Aug 13, 2025

- What I did
1/2 for #50718

This change copies the api/types/time package into internal packages for the client and daemon. The package does not define any types but provided some utilities for format-handling of timestamps.

- 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)

@thaJeztah
Copy link
Member

Git gets a bit confused because it tries to keep history, but has to decide "did it move to daemon/internal or client/internal ?

Perhaps we should have 2 commits in this PR; one that moves it to either daemon or client, and a second commit that creates a copy for the other.

(not sure which one is best to use for the "move" - ideally we'd pick the one where it's most likely to "stay", so that that one can be used to preserve history)

@thaJeztah
Copy link
Member

Thinking of that; perhaps the daemon/internal would be best for the move, because that would only have a "move" (no duplication in the vendor/ directory). For the client one, it likely would be harder to keep track as it (again) would have to chose "did it move to vendor/xxx or did it move to client/xxx ?)

(hope I make sense!)

@austinvazquez
Copy link
Contributor Author
austinvazquez commented Aug 13, 2025

Yep makes sense. Ironically I had that at first but ended up squashing as I thought there would be a broken commit. Although now I realize client is a module pointing to a point in time of API so it should be fine if I do the daemon first as you said.

@thaJeztah
Copy link
Member

Yeah, I don't think there's a "best" option, and of course there's still git history. But I suspect the move to daemon will preserve that history best because it's a literal move.

@austinvazquez austinvazquez force-pushed the deconstruct-api-types-time branch 2 times, most recently from eb6d49d to 4f1e1be Compare August 14, 2025 12:43
@thompson-shaun thompson-shaun requested a review from Copilot August 14, 2025 12:45
Copy link
@Copilot 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 copies the api/types/time package into internal packages for both the client and daemon components. The purpose is to remove the external dependency on the shared API types package by creating internal copies of timestamp utility functions.

Key changes:

  • Created internal timestamp packages for both client and daemon with identical functionality
  • Updated all import references from github.com/moby/moby/api/types/time to the new internal package paths
  • Changed package names from time to timestamp to avoid naming conflicts

Reviewed Changes

Copilot reviewed 19 out of 25 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
daemon/internal/timestamp/timestamp.go New internal timestamp utilities package for daemon
daemon/internal/timestamp/timestamp_test.go Test file for daemon timestamp package
client/internal/timestamp/timestamp.go New internal timestamp utilities package for client
client/internal/timestamp/timestamp_test.go Test file for client timestamp package
Multiple daemon files Updated imports to use new internal timestamp package
Multiple client files Updated imports to use new internal timestamp package

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@austinvazquez austinvazquez marked this pull request as ready for review August 14, 2025 12:54
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
This change copies the daemon/internal/timestamp package (previously api/types/time) to an internal client package and updates the client usage for GetTimestamp functionality.

Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
@austinvazquez austinvazquez force-pushed the deconstruct-api-types-time branch from 4f1e1be to aa80ad2 Compare August 14, 2025 13:27
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, thanks!

@austinvazquez austinvazquez merged commit 823f61a into moby:master Aug 14, 2025
216 of 217 checks passed
@austinvazquez austinvazquez deleted the deconstruct-api-types-time branch August 14, 2025 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0