Skip to content

feat: add objectidtest for deterministic IDs in tests - #6

Merged
enilsen16 merged 1 commit into
mainfrom
feat/objectidtest
Oct 22, 2026
Merged

enilsen16 merged 1 commit into
mainfrom
feat/objectidtest

Conversation

@enilsen16

@enilsen16 enilsen16 commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #5.

Summary

Package objectidtest builds deterministic IDs for tests:

  • FromSeed[T](seed) returns the ID whose bare value is the UUIDv5 of seed in the package Namespace. It panics if the type rejects the value.
  • FromSeedIn[T](namespace, seed) takes another namespace, to match IDs that another service's test helpers derive, such as umbrella's TestSupport.fan_id(seed).

A test can then name "the buyer" and get the same valid ID on every run, without hard-coded UUIDs.

Tests

The tests check that the same seed gives the same ID, different seeds give different IDs, the bare value is a UUIDv5, and an integer type panics. ExampleFromSeed is included. CI runs only on PRs to main. Locally, go test -race, go vet and golangci-lint pass.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ffa58e5b-d4d8-4971-8bda-eb9640dc8cd4
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@enilsen16
enilsen16 added this pull request to stack #9 October 22, 2026 14:17
Base automatically changed from feat/typed-uuid-access to main October 22, 2026 16:19
Signed-off-by: Erik Nilsen <enilsen16@live.com>
@enilsen16
enilsen16 marked this pull request as ready for review October 22, 2026 16:19
@enilsen16
enilsen16 merged commit 869bcb9 into main Oct 22, 2026
3 checks passed
@enilsen16
enilsen16 deleted the feat/objectidtest branch October 22, 2026 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant