Skip to content

Conversation

@ikura-hamu
Copy link
Member

@ikura-hamu ikura-hamu commented Oct 8, 2025

User description

fix #1384

  • ✨ handlerのPostGamePlayLogStartを実装
  • ✅ PostGamePlayLogStartのテスト

PR Type

Enhancement, Tests


Description

  • ゲーム起動ログ開始ハンドラ実装

  • 既存サービス連携とID変換

  • エラーハンドリングとHTTP応答整備

  • 単体テスト追加とケース網羅


Diagram Walkthrough

flowchart LR
  Handler["POST /editions/{editionID}/games/{gameID}/plays/start"] --> Parse["Body/Path解析"]
  Parse --> Service["GamePlayLogV2.CreatePlayLog"]
  Service -- 成功 --> Response["201 Created + PlayLogID"]
  Service -- ErrInvalidEdition/Game/Version --> NotFound["404 Not Found"]
  Service -- その他エラー --> Internal["500 Internal Server Error"]
Loading

File Walkthrough

Relevant files
Enhancement
game_play_log.go
起動ログ開始ハンドラの本実装                                                                                     

src/handler/v2/game_play_log.go

  • サービス依存性を受け取るコンストラクタ追加
  • 起動ログ開始ハンドラを実装
  • リクエストバリデーションとID変換を実装
  • 404/500のエラーハンドリングと201応答
+42/-6   
Tests
game_play_log_test.go
起動ログ開始ハンドラのテスト追加                                                                                 

src/handler/v2/game_play_log_test.go

  • PostGamePlayLogStartの単体テスト追加
  • 404/500/201パスの網羅的検証
  • gomockでサービスモック化
  • JSONレスポンスの内容検証
+136/-0 

@ikura-hamu ikura-hamu requested a review from a team as a code owner October 8, 2025 14:27
@github-actions
Copy link

github-actions bot commented Oct 8, 2025

Migrate lint ✅

Lint output
Notice: Starting with v0.38, 'atlas migrate lint' will only be available in Atlas Pro.
The command and existing code remain open source and available in the Community Edition.
Learn more: https://atlasgo.io/blog-v037#deprecate-lint

1 similar comment
@github-actions
Copy link

github-actions bot commented Oct 8, 2025

Migrate lint ✅

Lint output
Notice: Starting with v0.38, 'atlas migrate lint' will only be available in Atlas Pro.
The command and existing code remain open source and available in the Community Edition.
Learn more: https://atlasgo.io/blog-v037#deprecate-lint

@codecov
Copy link

codecov bot commented Oct 8, 2025

Codecov Report

❌ Patch coverage is 89.18919% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.15%. Comparing base (3acfa53) to head (48750cd).
⚠️ Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
src/wire/wire_gen.go 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1395      +/-   ##
==========================================
+ Coverage   50.00%   50.15%   +0.15%     
==========================================
  Files         135      135              
  Lines       11810    11840      +30     
==========================================
+ Hits         5905     5938      +33     
+ Misses       5601     5598       -3     
  Partials      304      304              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ikura-hamu ikura-hamu requested a review from mathsuky October 8, 2025 14:40
Copy link
Contributor

@mathsuky mathsuky left a comment

Choose a reason for hiding this comment

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

LGTM with a small comment
テストの書き方など勉強になりました:pray:

  • レスポンスがAPI仕様を見たすことを確認
  • Service層の返り値を必要十分にvalidationすることを確認
  • テストケースの網羅性を確認


playLogID := values.NewGamePlayLogID()

testCases := map[string]struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

リクエストボディが不正であるようなケース(400のケース)のテストはしなくても良いのでしょうか

Copy link
Member Author

Choose a reason for hiding this comment

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

あった方がいいです。

@ikura-hamu ikura-hamu requested a review from mathsuky October 10, 2025 12:14
Copy link
Contributor

@mathsuky mathsuky left a comment

Choose a reason for hiding this comment

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

LGTM!

@ikura-hamu ikura-hamu merged commit c3507c0 into main Oct 11, 2025
11 checks passed
@ikura-hamu ikura-hamu deleted the feat/handler_post_game_play_log_start branch October 11, 2025 14:43
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.

PostGamePlayLogStart のhandler実装

3 participants