Skip to content

plugins: report supported editions in error responses - #823

Open
vanderbr wants to merge 1 commit into
anthropics:mainfrom
reallyme:plugin-error-editions
Open

vanderbr wants to merge 1 commit into
anthropics:mainfrom
reallyme:plugin-error-editions

Conversation

@vanderbr

@vanderbr vanderbr commented Nov 13, 2026 •

Copy link
Copy Markdown

Both protoc-gen-buffa and protoc-gen-buffa-packaging can return an error response advertising editions support without its required minimum and maximum edition fields. Buf rejects that response before displaying the plugin's own diagnostic. For example, an invalid packaging filter produces a missing-edition protocol error instead of the useful configuration error, even for proto3 input.

Add buffa_codegen::plugin_response_metadata() and use it for all four success/error response construction sites across the two plugins. It advertises proto3 optional support and the existing EDITION_PROTO2 through EDITION_2024 range. This centralizes the metadata without changing successful generation.

Validation:

  • 102 plugin unit/CLI tests and the shared-helper regression test pass.
  • Formatting, strict Clippy for the affected packages and strict codegen rustdoc pass.
  • Rust 1.75 compilation passes with an independently resolved MSRV-compatible lockfile.
  • 32 before/after Buf cases cover proto2, proto3 and editions 2023/2024. The packaging plugin now exposes its original error, and successful generated files are byte-identical in this matrix.

The MSRV remains Rust 1.75 and the development toolchain remains 1.95.0. Dependency manifests and lockfiles are unchanged. Changelog entries cover the packaging fix and the new shared API.

Contributed by ReallyMe Technologies Limited.

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@vanderbr

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA.

github-actions Bot added a commit that referenced this pull request Nov 13, 2026
@vanderbr vanderbr changed the title protoc-gen-buffa: report supported editions in error responses plugins: report supported editions in error responses Nov 17, 2026
Build capability metadata once in buffa-codegen and use it for success and error responses from both plugin binaries. Preserve the existing feature flags and supported edition range, and test each executable error response.
@vanderbr
vanderbr force-pushed the plugin-error-editions branch from 9935bd9 to a62d2b4 Compare November 17, 2026 13:42

This branch has not been deployed

No deployments
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