-
Notifications
You must be signed in to change notification settings - Fork 0
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
team 関連のAPIの実装 #20
team 関連のAPIの実装 #20
Conversation
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.
Copilot reviewed 8 out of 20 changed files in this pull request and generated no comments.
Files not reviewed (12)
- go.mod: Language not supported
- server/domain/team.go: Evaluated as low risk
- server/handler/handler.go: Evaluated as low risk
- server/handler/middleware.go: Evaluated as low risk
- server/handler/middleware_test.go: Evaluated as low risk
- server/usecase/error.go: Evaluated as low risk
- server/domain/user.go: Evaluated as low risk
- server/repository/repository.go: Evaluated as low risk
- server/handler/response.go: Evaluated as low risk
- server/handler/openapi/oas_parameters_gen.go: Evaluated as low risk
- server/repository/db/user.go: Evaluated as low risk
- server/repository/mock/repository.go: Evaluated as low risk
Comments suppressed due to low confidence (9)
server/usecase/team_test.go:27
- The test does not verify the expected behavior of the CreateTeam method. Consider adding assertions to check if the method is called with the correct parameters.
mockRepo.EXPECT().CreateTeam(gomock.Any(), gomock.Any()).AnyTimes()
server/usecase/team_test.go:95
- The test does not verify the expected behavior of the UpdateTeam method. Consider adding assertions to check if the method is called with the correct parameters.
mockRepo.EXPECT().UpdateTeam(gomock.Any(), gomock.Any()).AnyTimes()
server/usecase/team_test.go:34
- [nitpick] The field name 'wantErr' is ambiguous. It should be renamed to 'expectError' to indicate that an error is expected.
wantErr bool
server/usecase/team.go:41
- [nitpick] The field name CreatorID should be checked for consistency with the rest of the codebase. If camelCase is the convention, it should be renamed to creatorID.
CreatorID string
server/usecase/team.go:44
- The CreateTeam function should have corresponding unit tests to ensure the behavior is covered.
func (u *TeamUseCase) CreateTeam(ctx context.Context, input CreateTeamInput) (domain.Team, error) {
server/usecase/team.go:83
- The UpdateTeam function should have corresponding unit tests to ensure the behavior is covered.
func (u *TeamUseCase) UpdateTeam(ctx context.Context, input UpdateTeamInput) (domain.Team, error) {
server/handler/team.go:92
- Potential nil pointer dereference. Add a nil check for req.Name before accessing its Value property.
Name: string(req.Name.Value),
server/handler/openapi/oas_validators_gen.go:416
- The error message 'invalid value' is not very helpful. It should include the invalid value for better context.
return errors.Errorf("invalid value: %v", s)
server/handler/openapi/oas_validators_gen.go:485
- The error message 'array' is not descriptive. It should specify that the array length is not within the expected range.
return errors.Wrap(err, "array")
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.
PRありがとう。遅くなってごめんなさい。
機能としてはほぼ問題ないと思います。
テストについてのコメントが多くなっていますが、このプロダクトは他のSysAdプロジェクトと違って継続的なメンテナンスを行うものではないと思うので、ユニットテストがパッケージアップデートを安心してできる材料になったり、ドキュメントの役割を持ったりします。大変だと思いますが、できるだけユニットテストをcoverage高く書くようにしてください。
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.
テストに関して
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.
ありがとう。2点だけお願いします
ea52719
to
5ca2c79
Compare
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.
長くなって申し訳ないです。お疲れ様でした
やったこと
タイトル通り
handlerに全部書くとユニットテストが書きづらすぎたので、usecase層を作りました
やってないこと
github id の扱いについて、teamごとに設定できるようにしますが、管理は別でしようと今のところ考えているので、このprには含めていません
メモ
そろそろrepositoryが大きくなってきたので、分割してもいいかもです