Skip to content

fix(bazel): ignore enum values the BEP protos don't have - #1360

Merged
trunk-io[bot] merged 1 commit into
mainfrom
tylerbeebe/bep-ignore-unknown-enums
Nov 18, 2026
Merged

trunk-io[bot] merged 1 commit into
mainfrom
tylerbeebe/bep-ignore-unknown-enums

Conversation

@acatxnamedvirtue

Copy link
Copy Markdown
Contributor

Stacked on #1359 (Bazel 9.0.1 protos). Merge that first; GitHub will then retarget this PR to main.

Why

#1359 fixes Bazel 9 by adding NON_CONFIGURABLE to the vendored protos. The next Bazel that adds an enum value would break --bazel-bep-path JSON uploads the same way, finding no tests. The JSON parser that pbjson generates rejects any enum name it doesn't know. The binary parser already copes, because prost keeps unknown enum numbers.

Change

  • JSON parsing: pbjson-build 0.9's ignore_unknown_enum_variants. An unknown enum value now reads as the enum's default, like an unknown field, instead of failing the whole parse.
  • Dependencies: pbjson 0.9 needs prost 0.14, so bazel-bep moves to prost 0.14, prost-build 0.14 and protox 0.9. The rest of the workspace stays on prost 0.12.
    • bazel-bep now re-exports prost, and context's binary BEP parser decodes with that copy.
  • No more tonic: bazel-bep drops tonic and its client/server features, which nothing enabled, and generates the messages with prost-build directly.
  • Cargo.lock: it only removes the old tonic stack and the duplicate old hyper/axum/http copies it pulled in. It adds the prost 0.14 family alongside 0.12. No version the rest of the workspace uses changed.
  • README: a line in bazel-bep/README.md says unknown fields and enum values are skipped.

Testing

  • New test_parse_json_bep_with_unknown_enum_values: a JSON BEP with option tags no Bazel has. It fails without ignore_unknown_enum_variants and passes with it.
  • The context, bazel-bep, trunk-analytics-cli and test_report suites pass, except the three Swift xunit tests, which need a Swift toolchain this machine doesn't have.
  • cargo check --workspace --all-targets passes, including the Python and JavaScript bindings, and trunk check is clean.

🤖 Generated with Claude Code

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.74%. Comparing base (e654981) to head (d25f4ad).

Additional details and impacted files
@@                        Coverage Diff                        @@
##           tylerbeebe/bazel-9-bep-protos    #1360      +/-   ##
=================================================================
- Coverage                          85.82%   82.74%   -3.08%     
=================================================================
  Files                                 85       85              
  Lines                              19186    19071     -115     
=================================================================
- Hits                               16467    15781     -686     
- Misses                              2719     3290     +571     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@TylerJang27 TylerJang27 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There's a big ol debate about protobuf parser crates. I think prost is the standard, and this shouldn't be a big change, but would appreciate a quick sanity check from Dylan here

@acatxnamedvirtue

Copy link
Copy Markdown
Contributor Author

@dfrankland ^

Base automatically changed from tylerbeebe/bazel-9-bep-protos to main November 18, 2026 03:37
A JSON build event with an enum value our vendored protos lack, as
Bazel 9's NON_CONFIGURABLE was, failed the whole parse and found no
tests. pbjson-build 0.9's ignore_unknown_enum_variants reads such a
value as the enum's default instead, as the binary parser already does.

pbjson 0.9 needs prost 0.14, so bazel-bep moves to prost 0.14 alone,
re-exports it for context's binary parser, and drops tonic: nothing
enabled its gRPC client or server features.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@trunk-io

trunk-io Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

😎 Stack merged successfully - details.

@trunk-io
trunk-io Bot force-pushed the tylerbeebe/bep-ignore-unknown-enums branch from d25f4ad to 6b536bc Compare November 18, 2026 03:37
@trunk-io
trunk-io Bot merged commit 6e87fd1 into main Nov 18, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants