Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #241 +/- ##
==========================================
Coverage ? 100.00%
==========================================
Files ? 5
Lines ? 457
Branches ? 0
==========================================
Hits ? 457
Misses ? 0
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR adds UUIDv8 support (RFC 9562) to the library, enabling callers to construct version 8 UUIDs from custom user-provided fields.
Changes:
- Introduces the
V8UUID version constant and documents v8 as supported. - Adds
NewV8at both package level and generator level, including validation and a new sentinel error (ErrV8FieldLength). - Adds generator tests covering UUIDv8 creation, field placement, version/variant bits, and invalid input lengths.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| uuid.go | Exposes V8 as an official UUID version constant. |
| generator.go | Adds UUIDv8 generation API and implementation, plus a new method on the Generator interface. |
| error.go | Adds ErrV8FieldLength sentinel error for invalid UUIDv8 field lengths. |
| generator_test.go | Adds test coverage for UUIDv8 creation, bit layout, and validation errors. |
| README.md | Lists Version 8 as a supported UUID version. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@cameracker I've opened a new pull request, #244, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Initial plan * docs: include version 8 in RFC-9562 package doc comment Co-authored-by: cameracker <14242948+cameracker@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: cameracker <14242948+cameracker@users.noreply.github.com>
|
@dylan-bourque @kohenkatz do you guys have a preference on how this is released (major or minor)? Technically this changes the generator interface in a "breaking" way but I really doubt that many people are using the generator interface... |
👎 on a major version for this IMO. Adding a new method shouldn't require every consumer out there to have to update every reference to our library. The non-breaking option would be define a new If we do release as |
|
A consideration: #246 could also pedantically be considered a breaking change (since existing consumers using Go < 1.25 will stop working). I would argue against a major version for that change as well, but maybe it's worth it if we have more than one breakage. 🤔 |
I'll put up an issue and ask for community feedback for a couple of weeks and then kick it out as a minor if we dont hear anything |
|
Alight I'm gonna merge this thing in next but git decided the readme had a conflict for some reason.... Needs a reapproval |
This PR adds v8 support to the package.
This variant is for "custom" implementations where there is very little standardized other than the the bit arrangement of the UUID. Version and Variant bits are set same as other UUID formats.
We will need to release this as a major version update because it adds a function to the
Generatorinterface.EDIT: Reviewing a previous decision about adding vNAtTime() to the Generator interface without incrementing a major version, I'd be comfortable with going the same route. Open to feedback.