Repository navigation
feat: accept earlier prefixes with Definition.Aliases - #8
Merged
Merged
Conversation
Signed-off-by: Erik Nilsen <enilsen16@live.com>
Signed-off-by: Erik Nilsen <enilsen16@live.com>
Signed-off-by: Erik Nilsen <enilsen16@live.com>
Signed-off-by: Erik Nilsen <enilsen16@live.com>
Signed-off-by: Erik Nilsen <enilsen16@live.com>
Signed-off-by: Erik Nilsen <enilsen16@live.com>
Signed-off-by: Erik Nilsen <enilsen16@live.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. Comment |
enilsen16
added this pull request to stack #9
October 22, 2026 14:17
Signed-off-by: Erik Nilsen <enilsen16@live.com>
…options Signed-off-by: Erik Nilsen <enilsen16@live.com>
…ition Signed-off-by: Erik Nilsen <enilsen16@live.com>
Signed-off-by: Erik Nilsen <enilsen16@live.com>
…options Signed-off-by: Erik Nilsen <enilsen16@live.com> # Conflicts: # objectid_test.go
…d-checks Signed-off-by: Erik Nilsen <enilsen16@live.com> # Conflicts: # objectid.go # objectidproto/objectidproto.go # objectidproto/objectidproto_test.go
…n errors Signed-off-by: Erik Nilsen <enilsen16@live.com>
Signed-off-by: Erik Nilsen <enilsen16@live.com>
Signed-off-by: Erik Nilsen <enilsen16@live.com>
Signed-off-by: Erik Nilsen <enilsen16@live.com>
Signed-off-by: Erik Nilsen <enilsen16@live.com>
Signed-off-by: Erik Nilsen <enilsen16@live.com>
Aliases now live in one prefixes list that parsing and unions both read, and alias names go through ObjectType.validate. Signed-off-by: Erik Nilsen <enilsen16@live.com>
…-options Signed-off-by: Erik Nilsen <enilsen16@live.com> # Conflicts: # objectid.go # objectid_test.go
Signed-off-by: Erik Nilsen <enilsen16@live.com>
Signed-off-by: Erik Nilsen <enilsen16@live.com>
Signed-off-by: Erik Nilsen <enilsen16@live.com>
…-options Signed-off-by: Erik Nilsen <enilsen16@live.com> # Conflicts: # objectid.go # objectid_test.go
…d-checks Signed-off-by: Erik Nilsen <enilsen16@live.com> # Conflicts: # objectid.go
Signed-off-by: Erik Nilsen <enilsen16@live.com>
Signed-off-by: Erik Nilsen <enilsen16@live.com>
Signed-off-by: Erik Nilsen <enilsen16@live.com>
Signed-off-by: Erik Nilsen <enilsen16@live.com>
Signed-off-by: Erik Nilsen <enilsen16@live.com> # Conflicts: # objectid.go
Signed-off-by: Erik Nilsen <enilsen16@live.com>
…aliases Signed-off-by: Erik Nilsen <enilsen16@live.com>
Signed-off-by: Erik Nilsen <enilsen16@live.com>
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.
Stacked on #7.
Summary
Definition.Aliaseslists earlier object types. Parsing still accepts them throughParse,FromStorage,Scanand JSON in the full format, and throughParseUnion. Every encoder emitsObjectType. A prefix can then be renamed, the way Stripe movedcard_andsrc_topm_, without breaking values that are already stored or sent.prefixeslist, with the object type's prefix first. Parsing,WrongPrefixError.Wantand union matching all read that list, and in a union the longest prefix still wins.ObjectType.validate. One set of seen names rejects both a repeat of the object type and a duplicate alias.CheckUnionrejects an alias that is another member's prefix.Tests
alias_test.gocovers parsing each alias,Scanin full storage, an unknown prefix, union matching, and the definition errors.Parsestays at 22 ns with 0 allocs. CI runs only on PRs tomain. Locally,go test -race,go vetand golangci-lint pass.