Skip to content

Split the proto_ingestion schema spec into cohesive files - #1358

Open
jwils wants to merge 1 commit into
joshuaw/buf-breaking-validationfrom
joshuaw/proto-spec-organization
Open

Split the proto_ingestion schema spec into cohesive files#1358
jwils wants to merge 1 commit into
joshuaw/buf-breaking-validationfrom
joshuaw/proto-spec-organization

Conversation

@jwils

@jwils jwils commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Why

elasticgraph-proto_ingestion's schema_spec.rb had grown to 39 examples covering every proto schema generation concern, and "schema" is a broad enough label that it would keep growing. Per review feedback on #1306, the scalar-related examples belong in scalar_proto_types_spec.rb, and the other cohesive groups deserve their own files too.

What

Move each cohesive group of examples out of schema_spec.rb:

File Covers Examples
scalar_proto_types_spec.rb how scalar types map to proto field types, including import: and comment: 9
stable_numbers_spec.rb field and enum value numbers staying stable as the schema evolves 8
external_proto_enums_spec.rb external_proto_enum, both sourcing values and referencing an external enum type 10
abstract_types_spec.rb oneof wrappers for interface and union types 3
proto_syntax_and_headers_spec.rb the syntax: and headers: options 3

schema_spec.rb keeps the 6 examples that cover schema generation as a whole, dropping from 1174 lines to 172.

Every example moved verbatim — I verified that the 39 example bodies are byte-identical before and after the split. schema_edge_cases_spec.rb is untouched.

Risk Assessment

None — spec file organization only. No behavior change, no coverage change (elasticgraph-proto_ingestion stays at 100% line and branch coverage).

References

Note on the stack

#1286 and #1352 are currently based on an older copy of #1306's commit, so they need a restack. Rebase this branch after that restack. Expect a conflict in scalar_proto_types_spec.rb: #1306 now creates that file with its own examples, and this PR creates it with the moved ones, so the resolution is to keep both sets.

`schema_spec.rb` had grown to 39 examples across every proto schema
generation concern, and "schema" is a broad enough label that it would
keep growing. Move each cohesive group into its own file:

- `scalar_proto_types_spec.rb` — how scalar types map to proto field
  types, including `import:` and `comment:`
- `stable_numbers_spec.rb` — field and enum value numbers staying stable
  as the schema evolves
- `external_proto_enums_spec.rb` — `external_proto_enum`, both sourcing
  values and referencing an external enum type
- `abstract_types_spec.rb` — `oneof` wrappers for interface and union
  types
- `proto_syntax_and_headers_spec.rb` — the `syntax:` and `headers:`
  options

`schema_spec.rb` keeps the 6 examples that cover schema generation as a
whole. Every example moved verbatim, so this changes no behavior and adds
no coverage.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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