{{ message }}
Repository navigation
refactor: migrate UUID generation and parsing to Go 1.27 stdlib - #4404
Merged
Merged
Conversation
Use crypto/rand-backed stdlib uuid.NewV4().String() for random UUIDs and stdlib parsing instead of github.com/google/uuid, wherever the stdlib can express the behavior. github.com/google/uuid is kept only in pkg/model/provider/base/opencode.go for uuid.NewSHA1, since the stdlib has no UUIDv5 support; the namespace and resulting IDs are unchanged. pkg/userid/userid.go keeps a compatibility helper that preserves every legacy persisted-ID form the Google parser accepted, without rewriting or rotating existing IDs. pkg/evaluation/eval.go keeps reading the first 4 UUID bytes as big-endian to preserve existing decimal evaluation names. Added tests covering v4 bit layout, legacy persisted-ID forms, the evaluation name format, and the OpenCode UUIDv5 fallback. Signed-off-by: David Gageot <david.gageot@docker.com>
trungutt
approved these changes
Sep 23, 2026
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.

Go 1.27's standard library gained a
uuidpackage that covers the cases most call sites actually need, so the project no longer has to pull ingithub.com/google/uuidfor the common path of generating a random ID or parsing one back.Every call site that generated a random UUID now uses the standard library's
uuid.NewV4().String(), and every place that parsed a UUID string uses the standard library'suuid.Parseoruuid.MustParseinstead of the Google package. Thegithub.com/google/uuiddependency remains inpkg/model/provider/base/opencode.go, which still needsuuid.NewSHA1to derive stable, deterministic OpenCode IDs from a namespace: the stdlib has no UUIDv5 support, so that one usage is unchanged.pkg/userid/userid.gokeeps a small compatibility helper so every legacy persisted-ID form the old Google parser accepted still parses correctly, with no rewriting or rotation of existing stored IDs.pkg/evaluation/eval.gostill reads the first four bytes of the UUID as big-endian to keep its decimal evaluation names stable.Tests were added for the v4 bit layout, the legacy persisted-ID compatibility forms, the evaluation name format, and a check that the OpenCode SHA1-derived IDs stay stable.
task build,task test,task lint, andgit diff --checkall pass on this branch, which is cut directly frommainand carries only this UUID migration commit.