Repository navigation
Add custom enum values to dataset field annotations - #85
Merged
Merged
Conversation
Add an optional descriptor set to dataset create/update schemas for custom enum definitions and future message types. Document fully qualified references and name-based response resolution. Amp-Thread-ID: https://ampcode.com/threads/T-01a15368-905e-70db-a93b-31a2b835d742 Co-authored-by: Amp <amp@ampcode.com>
|
The latest Buf updates on your PR. Results from workflow Lint Protobuf / buf (pull_request).
|
Keep full enum descriptors in create/update requests and define reversible public values. Specify server-side string literal resolution, exact enum symbols, supported operators, and null behavior without changing filter message fields. Amp-Thread-ID: T-01a15368-905e-70db-a93b-31a2b835d742
Replace supporting descriptor input with a string-only EnumValue message. Document server-owned enum generation, append-only updates, response ordering, and public-value filtering. Amp-Thread-ID: https://ampcode.com/threads/T-01a15368-905e-70db-a93b-31a2b835d742 Co-authored-by: Amp <amp@ampcode.com>
Use public string values as the only custom enum query representation. Reserve the old enum_name field name and tag to prevent accidental reuse. Amp-Thread-ID: https://ampcode.com/threads/T-01a15368-905e-70db-a93b-31a2b835d742 Co-authored-by: Amp <amp@ampcode.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.
Changes
Add
FieldAnnotation.enum_valueswith an extensibleEnumValuemessage containing only a nonempty stringvalue. This replaces the earlierDatasetType.type_definitionsproposal.Clients set
TYPE_ENUM, omittype_name, and supply values such asL1andL2SP. The server generates the native protobuf enum and its numbers. Updates may append values while preserving existing numbers; removal, renaming, and reordering are deferred.The same annotations are returned with the resolved descriptor. Values correspond in order to its enum members, excluding the generated zero member. Clients pair values with descriptor numbers without knowing generated naming conventions or treating list positions as numbers.
Custom enum filters use
string_valuefor public values. Remove the unsupportedenum_nameliteral and reserve its field name and tag 8. Equality, inequality, and existing OR/null expressions cover the initial use case. Enum queryables do not count toward the string-field limit.Scope
API definitions and contract comments only. No backend generation, schema compatibility enforcement, ingestion, query compilation, SDK conversions, or generated core clients are included. Backend support must follow before the feature is usable.
Integration note
The removed field already exists on main, although the backend cannot compile it into a working filter. The configured WIRE_JSON compatibility check passes with its name and number reserved, but generated source APIs change. When core regenerates its clients, remove
value.HasEnumName()fromcountQueryValueKindsindatasets-service/cmd/datasets-api-external/dataset-backend/expression_filter.go. No core files are changed in this PR.Verification
Using Buf 1.73.0:
buf format --diff --exit-code .buf build .buf lint .buf breaking . --against ".git#branch=origin/main"git diff --checkAll passed.