Skip to content

Conversation

grtlr
Copy link
Member

@grtlr grtlr commented Oct 8, 2025

Related

What

This changes our protobuf reflection code to put the entire message behind a single component to make it easier to extract it from lenses. This also guarantees that each protobuf message is always self-contained.

@grtlr grtlr added include in changelog 🧢 MCAP Everything related to the MCAP support labels Oct 8, 2025
Copy link

github-actions bot commented Oct 8, 2025

Web viewer built successfully.

Result Commit Link Manifest
8ed9923 https://rerun.io/viewer/pr/11459 +nightly +main

Note: This comment is updated whenever you push a commit.

@grtlr grtlr requested a review from Copilot October 8, 2025 07:42
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the protobuf reflection parser to consolidate protobuf messages into a single component instead of splitting them into multiple field-based components. This simplifies data extraction from lenses and ensures each protobuf message remains self-contained.

  • Changed from field-based component structure to single message component
  • Modified parser to use a single StructBuilder wrapped in a FixedSizeListBuilder
  • Updated component naming from individual fields to a unified "message" component

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
crates/utils/re_mcap/src/layers/protobuf.rs Core refactoring of protobuf parser from field-based to message-based structure
crates/utils/re_mcap/src/layers/snapshots/re_mcap__layers__protobuf__test__two_simple_rows.snap Updated test snapshot reflecting new single-component output format
Comments suppressed due to low confidence (1)

crates/utils/re_mcap/src/layers/protobuf.rs:1

  • [nitpick] This function uses a long chain of if-else statements that could be simplified using a match-based approach or a trait-based solution. Consider extracting this logic into a trait implementation for ArrayBuilder types or using a macro to reduce code duplication.
use arrow::{

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@grtlr grtlr changed the title Reflection-based protobuf parser only returns single component Reflection-based protobuf parser only returns single component Oct 8, 2025
Copy link
Member

@oxkitsune oxkitsune left a comment

Choose a reason for hiding this comment

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

very nice!

})
}

fn append_null_to_builder(builder: &mut dyn ArrayBuilder) -> Result<(), ProtobufError> {
Copy link
Member

Choose a reason for hiding this comment

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

would be nice if ArrayBuilder implemented append_null 🥲

Base automatically changed from grtlr/protobuf-enum to main October 8, 2025 11:45
@grtlr grtlr merged commit 858711a into main Oct 8, 2025
40 of 41 checks passed
@grtlr grtlr deleted the grtlr/protobuf-single-component branch October 8, 2025 12:18
Wumpf pushed a commit that referenced this pull request Oct 8, 2025
)

### Related

* Closes RR-2552.
* Related to RR-2553.
* Related to #11394.
* [x] Requires #11458.

 
### What

This changes our `protobuf` reflection code to put the entire message
behind a single component to make it easier to extract it from lenses.
This also guarantees that each protobuf message is always
self-contained.
grtlr pushed a commit that referenced this pull request Oct 10, 2025
### Related

* Related to RR-2552 (#11459)
* Closes RR-2553


### What

This changes our `ros2_reflection` parser to put the entire message
behind a single component to make it easier to extract it from lenses.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

include in changelog 🧢 MCAP Everything related to the MCAP support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants