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 still held 34 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 remaining scalar 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 (added by #1306) how scalar types map to proto field types, including import: and field_comment: 9 existing + 4 moved here
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 header_lines: options 3

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

Every example moved verbatim — I verified that all 43 example bodies are byte-identical before and after the split, and the suite example count is unchanged at 107. 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

`schema_spec.rb` still held 34 examples covering every proto schema
generation concern, and "schema" is a broad enough label that it would
keep growing. Move each cohesive group out of it:

- `scalar_proto_types_spec.rb` (added by #1306) gains the 4 remaining
  scalar examples, so every scalar proto type example now lives together
- `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 `header_lines:`
  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