Skip to content

Conversation

@mhils
Copy link
Member

@mhils mhils commented Apr 29, 2025

No description provided.

@mhils mhils requested a review from Copilot April 29, 2025 15:19
Copy link

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 fixes Protobuf number encoding in contentviews by improving YAML prettification and re-encoding logic to properly handle and represent various numeric types (including signed numbers via ZigZag encoding).

  • Introduces a helper struct (NumReprs) to collect multiple numeric representations and select the best one for output.
  • Adds a new static tag ZIGZAG for signed integer (sint) handling and updates tests accordingly.
  • Refactors re-encoding functions to better convert numeric values for FIXED32, FIXED64, and varint fields.

Reviewed Changes

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

Show a summary per file
File Description
mitmproxy-contentviews/src/protobuf/yaml_to_pretty.rs Implements NumReprs for formatted number representation and comments.
mitmproxy-contentviews/src/protobuf/view_protobuf.rs Adds new ZIGZAG tag and updates tests to reflect new output formats.
mitmproxy-contentviews/src/protobuf/view_grpc.rs Adjusts test expectations for gRPC YAML output.
mitmproxy-contentviews/src/protobuf/reencode.rs Refactors numeric parsing and conversion, including ZigZag encoding.
mitmproxy-contentviews/src/protobuf/proto_to_yaml.rs Modifies tag_number to conditionally tag unknown fields by type.

@mhils mhils enabled auto-merge (squash) April 29, 2025 15:25
@mhils mhils merged commit 3e2ed31 into mitmproxy:main Apr 29, 2025
23 checks passed
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