feat: add protobuf to json converter#64
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Protobuf decoding support to Caterpillar’s converter task so pipelines can convert binary Protobuf messages into JSON using a compiled FileDescriptorSet and configurable marshal options.
Changes:
- Implemented a new
protobufconverter that loads a descriptor set, dynamically unmarshals messages, and marshals them to JSON. - Registered
protobufas a supported converter format and documented configuration/usage. - Added a sample pipeline plus
.desc/.binfixtures and promotedgoogle.golang.org/protobufto a direct dependency.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
internal/pkg/pipeline/task/converter/protobuf.go |
New Protobuf-to-JSON converter implementation using descriptor sets + protojson. |
internal/pkg/pipeline/task/converter/converter.go |
Registers the new protobuf converter in the supported formats map. |
internal/pkg/pipeline/task/converter/README.md |
Documents Protobuf converter options and usage (also updates the format list). |
README.md |
Updates top-level supported task summary to mention Protobuf for converter. |
go.mod |
Adds google.golang.org/protobuf as a direct dependency. |
test/pipelines/converter/protobuf.yaml |
Example pipeline wiring file-read → protobuf-convert → file-write. |
test/pipelines/converter/person.desc |
Descriptor set fixture for the sample message schema. |
test/pipelines/converter/person.bin |
Binary Protobuf fixture to validate decoding behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ) | ||
|
|
||
| type protobuf struct { | ||
| DescriptorPath string `yaml:"descriptor_path" json:"descriptor_path"` |
Contributor
There was a problem hiding this comment.
Yash Shrivastava (@alephys26) can we know the use case? Because if there is need to ship the schema file, then we might need to add support for s3 reads as well, similar to file task type
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. |
prasadlohakpure
approved these changes
May 19, 2026
Mayuresh Pawar (Mayureshpawar29)
approved these changes
May 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
We need the ability to convert protobuf to json to allow handling of protobuf records in caterpillar. Adding the functionality in converter task to perform this action.
Changes
Protobuf format support:
protobufconverter implementation inprotobuf.go, allowing conversion from binary Protobuf messages to JSON using a descriptor file and configurable options.convertertask documentation inREADME.mdto describe Protobuf support, configuration options, and usage examples. [1] [2] [3] [4]protobufconverter type in the converter core logic.Dependency management:
google.golang.org/protobufingo.modto support Protobuf operations. [1] [2]Testing and examples:
person.desc,person.bin,protobuf.yaml) to demonstrate and verify Protobuf conversion functionality. [1] [2] [3]Types of changes
Tests
Added a test pipeline and it produced correct output record in the expected file:
{"id":42,"name":"Ada Lovelace","email":"ada@example.com","tags":["engineer","pioneer"]}Checklist