-
Notifications
You must be signed in to change notification settings - Fork 142
Feature/core #1100
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
Feature/core #1100
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Collector
service in.proto
and generate Python/Go bindings. - Implement Go-based gRPC server for
Collector
and a CLI entrypoint. - Add Python
Parser
to convertColumnRecord
messages 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
Name
andError
fields (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
Description
完成 swanlab-core 的protobuf定义,并完成部分功能性测试
for #1063