Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: manage grpc apis with csv and automatic proto genenration #1054

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

cxw620
Copy link
Contributor

@cxw620 cxw620 commented Jul 14, 2024

Generated with mikufans-bapis-decompile-helper@0.1.5 from official apk iBiliPlayer-apinkRelease-8.6.0-b15481705

@z0z0r4 z0z0r4 added 新增/Add 添加或修改新的内容 客户端/App 接口:客户端独占 GRpcAPI GRpc接口相关 and removed 客户端/App 接口:客户端独占 labels Jul 15, 2024
@z0z0r4 z0z0r4 added this to the API Update milestone Jul 15, 2024
@cxw620 cxw620 marked this pull request as ready for review July 16, 2024 09:39
@cxw620
Copy link
Contributor Author

cxw620 commented Jul 16, 2024

All works done and protos are checked with protoc. This PR is ready to be merged. Any comments? cc @z0z0r4 @SocialSisterYi

Old proto files (some with comments) have been move to dir deprecated, since mikufans-bapis-decompile-helper does not support managing services / classes / fields comments now. Another PR will be raised when I implement it, though may cost mush time for I'm busy these days.

@cxw620 cxw620 changed the title feat: update grpc protos from [email protected] (generated with helper tool) feat: update grpc protos from [email protected] (generated with helper tool) Jul 16, 2024
@cxw620 cxw620 marked this pull request as draft July 17, 2024 12:56
@cxw620 cxw620 marked this pull request as ready for review July 17, 2024 13:14
@cxw620 cxw620 marked this pull request as draft July 17, 2024 14:06
@cxw620 cxw620 marked this pull request as ready for review July 18, 2024 10:06
@z0z0r4
Copy link
Collaborator

z0z0r4 commented Jul 18, 2024

我对 grpc 完全不了解…

@xiaoyv404 xiaoyv404 requested a review from SocialSisterYi July 20, 2024 09:52
@SocialSisterYi
Copy link
Owner

All works done and protos are checked with protoc. This PR is ready to be merged. Any comments? cc @z0z0r4 @SocialSisterYi

Old proto files (some with comments) have been move to dir deprecated, since mikufans-bapis-decompile-helper does not support managing services / classes / fields comments now. Another PR will be raised when I implement it, though may cost mush time for I'm busy these days.

如果直接对原有 gRPC 的 proto 移至 deprecated中,合并后会割裂现有的社区贡献进程,以及迁移注释的工作量庞大且繁琐。最近我也忙于工作,管理项目时间不足。但对于 gRPC 的管理,我有几点建议:

  1. 使用 .csv / .xlsx 表格对 proto 结构体的 services / message / oneof / enum / fields 进行结构化管理(类似关系型数据库),以 tag 和 id 作为索引,附加注释、类名等管理困难的信息
  2. 使用 Action 生成完整的 proto 结构树(目录和文件级别),并更新至仓库
  3. 后续 gRPC 的管理不直接改动 proto 文件,只改动各 .csv / .xlsx 文件方便自动化分析新增字段

@cxw620
Copy link
Contributor Author

cxw620 commented Jul 20, 2024

All works done and protos are checked with protoc. This PR is ready to be merged. Any comments? cc @z0z0r4 @SocialSisterYi
Old proto files (some with comments) have been move to dir deprecated, since mikufans-bapis-decompile-helper does not support managing services / classes / fields comments now. Another PR will be raised when I implement it, though may cost mush time for I'm busy these days.

如果直接对原有 gRPC 的 proto 移至 deprecated中,合并后会割裂现有的社区贡献进程,以及迁移注释的工作量庞大且繁琐。最近我也忙于工作,管理项目时间不足。但对于 gRPC 的管理,我有几点建议:

  1. 使用 .csv / .xlsx 表格对 proto 结构体的 services / message / oneof / enum / fields 进行结构化管理(类似关系型数据库),以 tag 和 id 作为索引,附加注释、类名等管理困难的信息
  2. 使用 Action 生成完整的 proto 结构树(目录和文件级别),并更新至仓库
  3. 后续 gRPC 的管理不直接改动 proto 文件,只改动各 .csv / .xlsx 文件方便自动化分析新增字段

了解, 那我先保留但是搁置这个 PR.

但是有个问题, Github Action 不会有资源限制么(看了眼, 4H16G, emmm), jadx decompile 很吃 CPU 和内存, 8845HS, -Xmx16G -j 16 也得 2 分半, 实际工具解析 jadx jsons 倒是非常快, release profile build 1秒左右就解析完了()

xlsx 的话 rust 没比较好的库, 也不便于 git diff, 应该还是采用 csv ()

那么总的来说, 我能否理解为只需要按照一定的格式将解析得到的中间数据以 csv 的格式输出并 commit, 社区只需要维护这个 csv, 最后定期用 Github Action 运行我的 helper tool 读取 csv 以 proto 格式输出并打包发布 proto files. 这样的话倒是蛮好改的. 工作量还是在迁移注释上. 总不能还得写个 GUI 吧

@cxw620 cxw620 marked this pull request as draft July 20, 2024 12:04
@cxw620 cxw620 changed the title feat: update grpc protos from [email protected] (generated with helper tool) feat: manage grpc apis with csv and automatic proto genenration Jul 23, 2024
@cxw620 cxw620 force-pushed the master branch 4 times, most recently from 19dfac5 to d58ac7f Compare July 31, 2024 13:46
[AUTO GENERATED] Helper: mikufans-bapis-decompiler/0.1.7-master-9d5260b-RELEASE built at 2024-07-31T21:43:44.301748411+08:00
[AUTO GENERATED] Helper: mikufans-bapis-decompiler/0.2.1-master-79eb4d8-RELEASE built at 2024-09-06T22:42:17.001511900+08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
新增/Add 添加或修改新的内容 GRpcAPI GRpc接口相关
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants