Merged
Conversation
* feat: init go project (#1064) * feat: add proto and grpc * feat: add proto build script * fix: golangci lint * feat: support auto or specify select port * chore: license * chore: add .golangci.yml * fix: use log/slog instead of log * chore: del core vendor --------- Co-authored-by: Kang Li <79990647+SAKURA-CAT@users.noreply.github.com>
* feat: impl health checker and init data collector * chore: change module name --------- Co-authored-by: KAAANG <79990647+SAKURA-CAT@users.noreply.github.com>
Co-authored-by: kaikai <2837968358@qq.com>
There was a problem hiding this comment.
Pull Request Overview
This PR adds the foundational protobuf definitions and code generation for the core collector service, implements the Go gRPC server and Python parsing utility with tests, and configures build and CI workflows.
- Define
Collectorservice in.protoand generate Python/Go bindings. - Implement Go-based gRPC server for
Collectorand a CLI entrypoint. - Add Python
Parserto convertColumnRecordmessages to JSON, with comprehensive unit tests.
Reviewed Changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| swanlab/proto/core/collector/v1/collector_service.proto | Define Collector RPC service and messages. |
| swanlab/proto/**/*.py{,i} | Auto-generated Python protobuf and gRPC bindings. |
| core/pkg/pb/*.pb.go | Auto-generated Go protobuf and gRPC bindings. |
| script/build_proto.py | Script to compile .proto files into Python/Go outputs. |
| requirements-dev.txt | Add grpcio-tools for Python codegen. |
| core/internal/service/collector.go | Implement Go Collector server logic. |
| core/internal/api/parse.go | Python Parser for transforming ColumnRecord. |
| core/internal/api/parse_test.go | Unit tests covering Parser.ParseColumnRecord. |
| core/cmd/core/core.go | CLI entrypoint to start gRPC server with health checks. |
| .github/workflows/test-core.yml | CI workflow for building/testing the Go core. |
| core/README.md | Project overview and setup instructions. |
Comments suppressed due to low confidence (5)
core/internal/api/parse.go:1
- Header comment references 'send.go' but the file is named 'parse.go'. Update the @title to match the actual filename.
// @Title send.go
core/internal/api/parse.go:65
- [nitpick] Error message 'column key cannot be EMPTY' has inconsistent casing. Consider using 'column key cannot be empty' for clarity and consistency.
return ColumnDTO{}, errors.New("column key cannot be EMPTY")
.github/workflows/test-core.yml:16
- The workflow ignores the OS matrix and always runs on ubuntu-latest. Change to 'runs-on: ${{ matrix.os }}' to respect the configured matrix.
runs-on: ubuntu-latest
core/internal/api/parse.go:75
- [nitpick] The
NameandErrorfields (mapping from record.GetColumnName() and record.GetColumnError()) are not covered by tests. Consider adding test cases to validate these mappings.
Name: record.GetColumnName(),
core/README.md:47
- [nitpick] The 'Env' section is marked TODO; please provide the necessary environment setup instructions or remove this placeholder.
TODO
Kaikaikaifang
approved these changes
Jun 15, 2025
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
完成 swanlab-core 的protobuf定义,并完成部分功能性测试
for #1063