Skip to content

Update conformance tests to protocolbuffers/protobuf v34.0#1391

Merged
emcfarlane merged 8 commits into
mainfrom
ed/protocConformV34
Apr 23, 2026
Merged

Update conformance tests to protocolbuffers/protobuf v34.0#1391
emcfarlane merged 8 commits into
mainfrom
ed/protocConformV34

Conversation

@emcfarlane

@emcfarlane emcfarlane commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

This PR updates the conformance testing to protocolbuffers/protobuf v34.0. Follows on from #1385.

Extensions are now handled in conformance to assert validation. We call getExtension on all unknowns. This passes the recommended testcase Recommended.Editions.ProtobufInput.RejectInvalidUtf8.String.Extension. Other issues were already addressed in #1388, #1387 and #1386.

Closes #1363

Upgrade the conformance test runner and its bundled protos from v33.2.0 to
v34.0.0 across the Node, Bun, and Deno conformance packages.
Comment thread README.md Outdated

@srikrsna-buf srikrsna-buf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of failing Recommended.Editions.ProtobufInput.RejectInvalidUtf8.String.Extension can we update the conformance script to read set extensions. We can get this from the unknown fields and check the registry for each unknown tag.

@emcfarlane

emcfarlane commented Apr 22, 2026

Copy link
Copy Markdown
Contributor Author

@srikrsna-buf thanks! Updated so each conformance test calls getExtension on the $unknowns.

Comment thread bun/conformance/src/conformance.ts
@timostamm

Copy link
Copy Markdown
Member

Instead of failing Recommended.Editions.ProtobufInput.RejectInvalidUtf8.String.Extension can we update the conformance script to read set extensions. We can get this from the unknown fields and check the registry for each unknown tag.

Good call. We want the confidence that the implementation is conformant. Because we parse extensions lazily, we have to take an extra step to surface errors, but we do want to surface and validate the errors.

@timostamm timostamm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - just one comment suggestion to clarify why we're calling getExtension in conformance.ts

Comment thread bun/conformance/src/conformance.ts Outdated
Comment on lines +124 to +126
// fromBinary stores extensions as unknown fields. Realize any whose
// descriptor is known to the registry so that per-field validation
// (e.g. UTF-8 checks for string extensions) fires at parse time.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// fromBinary stores extensions as unknown fields. Realize any whose
// descriptor is known to the registry so that per-field validation
// (e.g. UTF-8 checks for string extensions) fires at parse time.
// We parse extensions lazily. To exercise the conformance tests for
// UTF-8 validation, we have to take this extra step: In addition to parsing
// the message, we also parse all extensions.

(same for deno/conformance and packages/conformance)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 7cb190a

@emcfarlane emcfarlane merged commit 0cde1e6 into main Apr 23, 2026
40 of 44 checks passed
@emcfarlane emcfarlane deleted the ed/protocConformV34 branch April 23, 2026 11:22
@timostamm timostamm mentioned this pull request Apr 23, 2026
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.

3 participants