Skip to content

Conversation

@linwumingshi
Copy link
Collaborator

  • Closes gRPC doc doesn't work if proto files organized in package #1116

  • Fixes the core issue: Resolves the problem where grpc-xxx goals fail when .proto files are organized using packages (e.g., base/enum.proto, file/fileops.proto). The root cause was an incorrect --proto_path calculation.

  • Enhances path handling: Refactored getUniqueParentDirectories to correctly find the deepest common ancestor directory, ensuring --proto_path points to the actual root of the .proto files.

  • Improves command robustness: Uses absolute paths for protoc, protoc-gen-doc, and all input .proto files to guarantee reliable execution across different environments.

  • Adds comprehensive logging: Logs the final protoc command for debugging and adds [protoc] prefix to plugin output, making it easier to distinguish between smart-doc logs and protoc errors.

@github-actions
Copy link

github-actions bot commented Sep 5, 2025

@linwumingshi

🔍 Before proceeding, please review the contribution guidelines

This includes requirements for:

  • ✅ Commit message format (Angular Convention. feat, fix, etc.)
  • 🧹 Code style (execute mvn spring-javaformat:apply)
  • 📄 Documentation updates (if config changes)
  • 💡 Example code submission (for new features)

Thanks for your PR. 🙏
Please check again for your PR changes whether they contain any usage configuration change, such as Add new configuration or Change default value of configuration.
If so, please add or update documents (Markdown format) in the docs/ directory of the repository smart-doc-group/smart-doc-group.github.io.

In addition, if you have added new features, please provide example code in the repository smart-doc-group/smart-doc-example-cn. This will help other users understand how to use the new features.

Code Style Reminder:
The code should use the Spring code style. Please format your code using the command mvn spring-javaformat:apply. You can also install the Spring Java Format plugin for convenience.


🔍 提交前请务必完成以下检查

需特别注意:

  • ✅ 提交信息格式 (feat, fix 等类型)
  • 🧹 代码风格(执行 mvn spring-javaformat:apply
  • 📄 文档更新(配置变更需同步更新 docs)
  • 💡 示例代码(新功能需提供示例)

感谢您提交的PR。 🙏
请再次查看您的PR内容,确认是否包含任何使用方式或配置参数的变更,如:新增配置参数修改默认配置等操作。
如果是,请确保在提交之前,在仓库smart-doc-group/smart-doc-group.github.io中的docs/目录下添加或更新文档(Markdown格式)。

另外,如果您添加了新功能,请在仓库smart-doc-group/smart-doc-example-cn中提供示例代码。这将帮助其他用户了解如何使用新功能。

代码风格提示:
请使用 Spring 代码风格。您可以通过命令 mvn spring-javaformat:apply 格式化代码。为了方便操作,您还可以安装 Spring Java Format 插件。

…kages

- Closes TongchengOpenSource#1116

- Fixes the core issue: Resolves the problem where grpc-xxx goals fail when .proto files are organized using packages (e.g., base/enum.proto, file/fileops.proto). The root cause was an incorrect --proto_path calculation.
- Enhances path handling: Refactored getUniqueParentDirectories to correctly find the deepest common ancestor directory, ensuring --proto_path points to the actual root of the .proto files.
- Improves command robustness: Uses absolute paths for protoc, protoc-gen-doc, and all input .proto files to guarantee reliable execution across different environments.
- Adds comprehensive logging: Logs the final protoc command for debugging and adds [protoc] prefix to plugin output, making it easier to distinguish between smart-doc logs and protoc errors.
@shalousun shalousun added this to the 3.1.2 milestone Sep 5, 2025
@shalousun shalousun added the bug Something isn't working label Sep 5, 2025
@shalousun shalousun merged commit 91cd0d5 into TongchengOpenSource:master Sep 5, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gRPC doc doesn't work if proto files organized in package

2 participants