Skip to content

feat(pb): support schemas from a directory#4006

Merged
ngjaying merged 1 commit intomasterfrom
feat/mande/protobuf-dir-schema
Mar 4, 2026
Merged

feat(pb): support schemas from a directory#4006
ngjaying merged 1 commit intomasterfrom
feat/mande/protobuf-dir-schema

Conversation

@ngjaying
Copy link
Collaborator

Description

Support configuring a directory path as the schema file for protobuf adapters. When a directory is provided, the parser will collect and parse all .proto files within it, allowing for schemas split across multiple files.

Changes

  • Updated Scan method in schema/protobuf.go to recognize subdirectories as valid schema IDs.
  • Added collectProtoFiles helper to gather paths for all .proto files in a directory.
  • Updated Infer in schema and NewConverter in converter to parse all collected files into a unified descriptor pool and search across all resulting file descriptors for the target message.
  • Added corresponding unit tests covering directory and sub-file scenarios.

@ngjaying ngjaying changed the title feat(protobuf): support loading protobuf schemas from a directory feat(pb): support schemas from a directory Feb 27, 2026
@ngjaying ngjaying force-pushed the feat/mande/protobuf-dir-schema branch from 79cfa9b to afbe059 Compare February 27, 2026 01:43
The protobuf schema parser now supports directories by passing the directory
path as the schema file. It will parse all '.proto' files within the
directory, allowing for schemas split across multiple files.

Signed-off-by: Jiyong Huang <huangjy@emqx.io>
@ngjaying ngjaying force-pushed the feat/mande/protobuf-dir-schema branch from afbe059 to 60dbe7b Compare February 27, 2026 02:01
@codecov
Copy link

codecov bot commented Feb 27, 2026

Codecov Report

❌ Patch coverage is 77.77778% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.78%. Comparing base (5dee73c) to head (60dbe7b).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
internal/converter/protobuf/converter.go 75.00% 6 Missing and 3 partials ⚠️
internal/schema/protobuf.go 80.00% 6 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4006      +/-   ##
==========================================
- Coverage   71.87%   71.78%   -0.09%     
==========================================
  Files         460      460              
  Lines       53183    53248      +65     
==========================================
- Hits        38224    38223       -1     
- Misses      12024    12078      +54     
- Partials     2935     2947      +12     

☔ View full report in Codecov by Sentry.
📢 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.

@ngjaying ngjaying requested a review from Yisaer March 3, 2026 01:38
@ngjaying ngjaying merged commit 93d3234 into master Mar 4, 2026
68 checks passed
@ngjaying ngjaying deleted the feat/mande/protobuf-dir-schema branch March 4, 2026 06:21
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.

2 participants