Skip to content

build(proto): restore buf generation tasks#285

Merged
innomentats merged 1 commit into
chaitin:mainfrom
kingfs:chore/restore-proto-generation
Jul 14, 2026
Merged

build(proto): restore buf generation tasks#285
innomentats merged 1 commit into
chaitin:mainfrom
kingfs:chore/restore-proto-generation

Conversation

@kingfs

@kingfs kingfs commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Restore task generate and add the focused task generate:proto command.
  • Add Buf module and generation configuration for Go protobuf and Connect sources.
  • Install a pinned Buf version through task prepare when it is unavailable.
  • Regenerate committed protobuf artifacts and normalize their source paths to the Buf module layout.

Testing

  • task generate
  • buf lint
  • task build:proto
  • task lint
  • git diff --check

Checklist

  • Documentation updated when behavior or configuration changed.
  • Tests added or updated for user-visible behavior. (No runtime behavior changed; the generation workflow was verified directly.)
  • No secrets, private endpoints, internal certificates, or local runtime state included.

@monkeyscan

monkeyscan Bot commented Jul 14, 2026

Copy link
Copy Markdown

PR Title: build(proto): restore buf generation tasks

Commit: 213dc5e

本次变更恢复了基于 buf 的 Protobuf 代码生成流程:新增 buf.yaml(v2 模块,MINIMAL lint)和 buf.gen.yaml(使用 paths=source_relative 输出到 proto 目录),在 Taskfile.yml 中引入 BUF_VERSION: v1.68.1、在 prepare 任务中安装 buf,并新增 generate / generate:proto 任务。随后使用 buf 重新生成了 healthagentcompose 相关的 .pb.go.connect.go 文件。

关键观察:

  • health 相关生成文件中的 proto source path 从 proto/health/v1/health.proto 变为 health/v1/health.proto,对应的 File_ 描述符变量名也随之调整(如 File_proto_health_v1_health_protoFile_health_v1_health_proto),health.connect.go 已同步更新引用,变更文件内部一致。
  • agentcompose 生成文件仅更新了 protoc 版本注释(改为 (unknown),符合 buf 内部 protoc 的行为),source path 未发生变化。
  • go.mod 已通过 tool 指令管理 protoc-gen-goprotoc-gen-connect-go,与 buf.gen.yamllocal: [go, tool, ...] 的配置方式匹配,开发者只需运行 task prepare 安装 buf 后即可正常执行 task generate:proto

整体评估:变更结构清晰,buf 配置与现有目录结构匹配,生成的 Go 包内部引用已保持一致,属于合理的构建流程恢复。未发现需要修复的问题。

@innomentats
innomentats merged commit 8d0bde9 into chaitin:main Jul 14, 2026
16 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.

2 participants