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

runnerのgRPCを実装 #58

Merged
merged 13 commits into from
Feb 14, 2025
Merged

runnerのgRPCを実装 #58

merged 13 commits into from
Feb 14, 2025

Conversation

ikura-hamu
Copy link
Member

@ikura-hamu ikura-hamu commented Feb 13, 2025

runnerがportalとgRPCで通信する部分を実装した。

  • ✨ GetJobの実装
  • 🔧 gRPCクライアントのモックの設定
  • 🏭 コード生成
  • ✅ GetJobのテスト
  • ✨ MakeProgressStreamClientの実装
  • ✅ MakeProgressStreamClientのテスト
  • 🔧 streamのクライアントのモック設定
  • 🏭 コード生成
  • ✅ SendProgressのテスト
  • ✅ Closeのテスト
  • ✨ PostJobFinishedの実装
  • ✅ PostJobFinishedのテスト
  • ✨ ちょっとDI

@ikura-hamu ikura-hamu requested review from Copilot and a team February 13, 2025 07:04
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.

Copilot reviewed 5 out of 8 changed files in this pull request and generated 1 comment.

Files not reviewed (3)
  • cmd/runner/main.go: Evaluated as low risk
  • gen/portal/v1/generate.go: Evaluated as low risk
  • runner/portal/grpc/portal_test.go: Evaluated as low risk
Comments suppressed due to low confidence (1)

runner/portal/grpc/stream.go:39

  • [nitpick] The error message could be more descriptive. Consider including more context about the error.
return fmt.Errorf("close progress stream: %w", err)


var _ portal.ProgressStreamClient = (*ProgressStreamClient)(nil)

func (c *ProgressStreamClient) SendProgress(_ context.Context, progress *domain.Progress) error {
Copy link
Preview

Copilot AI Feb 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The progress parameter should be checked for nil to prevent potential runtime panic. Add a check to return an error if progress is nil.

Suggested change
func (c *ProgressStreamClient) SendProgress(_ context.Context, progress *domain.Progress) error {
func (c *ProgressStreamClient) SendProgress(_ context.Context, progress *domain.Progress) error {
if progress == nil {
return fmt.Errorf("progress parameter is nil")
}

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
Copy link
Contributor

@pirosiki197 pirosiki197 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

よさそうです。ありがとうございます

@ikura-hamu ikura-hamu merged commit 55e94f8 into main Feb 14, 2025
10 checks passed
@ikura-hamu ikura-hamu deleted the feat/runner_grpc branch February 14, 2025 11:05
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