Skip to content

Conversation

SAKURA-CAT
Copy link
Member

Description

完成 swanlab-core 的protobuf定义,并完成部分功能性测试

for #1063

SAKURA-CAT and others added 5 commits June 11, 2025 10:54
* 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>
Copy link

@Copilot Copilot AI left a 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 convert ColumnRecord 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 and Error 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

@SAKURA-CAT SAKURA-CAT marked this pull request as ready for review June 15, 2025 07:04
@SAKURA-CAT SAKURA-CAT merged commit e3b3ae3 into main Jun 15, 2025
14 of 16 checks passed
@SAKURA-CAT SAKURA-CAT deleted the feature/core branch June 15, 2025 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💪 enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants