Skip to content

Validate protobuf enum prefix collisions#1312

Merged
jwils merged 3 commits into
mainfrom
joshuaw/proto-enum-collisions
Jul 20, 2026
Merged

Validate protobuf enum prefix collisions#1312
jwils merged 3 commits into
mainfrom
joshuaw/proto-enum-collisions

Conversation

@jwils

@jwils jwils commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Why

Distinct GraphQL enum names can normalize to the same protobuf enum-value prefix, producing duplicate package-level symbols in schema.proto.

What

  • Validate enum-value prefixes across the enum types actually emitted in schema.proto.
  • Raise an actionable schema error naming both enum types and their shared prefix.
  • Preserve reachability behavior by allowing collisions with enum types that are not emitted.

Validation

  • script/run_gem_specs elasticgraph-proto_ingestion
  • script/lint elasticgraph-proto_ingestion
  • script/type_check

Risk assessment

Low. This adds validation only for schemas that would otherwise emit invalid protobuf definitions.

References

…/schema_definition/schema.rb

Co-authored-by: Myron Marston <myron.marston@toasttab.com>
@jwils
jwils marked this pull request as ready for review July 20, 2026 19:58
@jwils
jwils enabled auto-merge (squash) July 20, 2026 19:58
@jwils
jwils disabled auto-merge July 20, 2026 20:19
@jwils
jwils enabled auto-merge (squash) July 20, 2026 20:19
@jwils
jwils merged commit 2319c94 into main Jul 20, 2026
24 checks passed
@jwils
jwils deleted the joshuaw/proto-enum-collisions branch July 20, 2026 20:39
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.

2 participants