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

gomockをgo.uber.org/mockに移行 #1153

Merged
merged 2 commits into from
Feb 24, 2025
Merged

gomockをgo.uber.org/mockに移行 #1153

merged 2 commits into from
Feb 24, 2025

Conversation

ikura-hamu
Copy link
Member

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

User description

fix #1040

  • ⬆️ github.com/golang/mock -> go.uber.org/mock
  • 🔧 go.mod の tool directive を使う

PR Type

enhancement, dependencies


Description

  • gomockの依存関係をgithub.com/golang/mockからgo.uber.org/mockに移行。

  • //go:generateディレクティブをgo tool mockgenに更新。

  • go.modgo.sumでの依存関係の整理と更新。

  • テストコード内のgomockインポートをgo.uber.org/mock/gomockに変更。


Changes walkthrough 📝

Relevant files
Enhancement
10 files
oidc.go
`//go:generate`ディレクティブを更新                                                               
+1/-1     
user.go
`//go:generate`ディレクティブを更新                                                               
+1/-1     
user.go
`//go:generate`ディレクティブを更新                                                               
+1/-1     
app.go
`//go:generate`ディレクティブを更新                                                               
+1/-1     
auth.go
`//go:generate`ディレクティブを更新                                                               
+1/-1     
cache.go
`//go:generate`ディレクティブを更新                                                               
+1/-1     
handler.go
`//go:generate`ディレクティブを更新                                                               
+1/-1     
repository.go
`//go:generate`ディレクティブを更新                                                               
+1/-1     
service.go
`//go:generate`ディレクティブを更新                                                               
+1/-1     
storage.go
`//go:generate`ディレクティブを更新                                                               
+1/-1     
Dependencies
10 files
oidc_test.go
`gomock`インポートを`go.uber.org/mock`に変更                                           
+1/-1     
user_test.go
`gomock`インポートを`go.uber.org/mock`に変更                                           
+1/-1     
user_test.go
`gomock`インポートを`go.uber.org/mock`に変更                                           
+1/-1     
session_test.go
`gomock`インポートを`go.uber.org/mock`に変更                                           
+1/-1     
admin_test.go
`gomock`インポートを`go.uber.org/mock`に変更                                           
+1/-1     
checker_test.go
`gomock`インポートを`go.uber.org/mock`に変更                                           
+1/-1     
game_file_test.go
`gomock`インポートを`go.uber.org/mock`に変更                                           
+1/-1     
game_genre_test.go
`gomock`インポートを`go.uber.org/mock`に変更                                           
+1/-1     
game_image_test.go
`gomock`インポートを`go.uber.org/mock`に変更                                           
+1/-1     
game_role_test.go
`gomock`インポートを`go.uber.org/mock`に変更                                           
+1/-1     
Additional files
58 files
go.mod +3/-2     
go.sum +0/-9     
game_test.go +1/-1     
game_version_test.go +1/-1     
game_video_test.go +1/-1     
oauth2_test.go +1/-1     
session_test.go +1/-1     
users_test.go +1/-1     
access_token.go +1/-1     
edition.go +1/-1     
game_genre.go +1/-1     
game_management_role.go +1/-1     
db_test.go +1/-1     
launcher_session.go +1/-1     
launcher_user.go +1/-1     
db.go +1/-1     
product_key.go +1/-1     
v2_admin_auth.go +1/-1     
v2_game.go +1/-1     
v2_game_file.go +1/-1     
v2_game_image.go +1/-1     
v2_game_version.go +1/-1     
v2_game_video.go +1/-1     
edition.go +1/-1     
edition_auth.go +1/-1     
game_genre.go +1/-1     
user.go +1/-1     
user_test.go +1/-1     
admin_auth_test.go +1/-1     
edition_test.go +1/-1     
game_file_test.go +1/-1     
game_genre_test.go +1/-1     
game_image_test.go +1/-1     
game_test.go +1/-1     
game_version_test.go +1/-1     
game_video_test.go +1/-1     
oidc_test.go +1/-1     
v2_admin_auth.go +1/-1     
v2_game.go +1/-1     
v2_game_file.go +1/-1     
v2_game_image.go +1/-1     
v2_game_role.go +1/-1     
v2_game_version.go +1/-1     
v2_game_video.go +1/-1     
v2_oidc.go +1/-1     
directory_manager_test.go +1/-1     
game_file_test.go +1/-1     
game_image_test.go +1/-1     
game_video_test.go +1/-1     
game_file.go +1/-5     
game_image.go +1/-1     
game_video.go +1/-1     
client_test.go +1/-1     
client_test.go +1/-1     
game_file_test.go +1/-1     
game_image_test.go +1/-1     
game_video_test.go +1/-1     
tools.go +1/-1     

Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • Copy link

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    🎫 Ticket compliance analysis 🔶

    1040 - Partially compliant

    Compliant requirements:

    • Migrate from github.com/golang/mock to go.uber.org/mock.
    • Update //go:generate directives to use go tool mockgen.
    • Update go.mod and go.sum files to reflect the dependency change.

    Non-compliant requirements:

    Requires further human verification:

    • Ensure compatibility with existing code and tests.
    ⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
    🧪 PR contains tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Compatibility Check

    Verify that the updated //go:generate directive using go tool mockgen works as expected and generates mocks correctly.

    //go:generate go tool mockgen -source=$GOFILE -destination=mock/${GOFILE} -package=mock
    Dependency Update

    Ensure that the new dependency go.uber.org/mock is correctly integrated and does not introduce any conflicts or issues.

    go.uber.org/mock v0.5.0

    Copy link

    PR Code Suggestions ✨

    No code suggestions found for the PR.

    Copy link

    codecov bot commented Feb 24, 2025

    Codecov Report

    All modified and coverable lines are covered by tests ✅

    Project coverage is 45.90%. Comparing base (3c38227) to head (c94a30f).
    Report is 3 commits behind head on main.

    Additional details and impacted files
    @@           Coverage Diff           @@
    ##             main    #1153   +/-   ##
    =======================================
      Coverage   45.90%   45.90%           
    =======================================
      Files         123      123           
      Lines       11118    11118           
    =======================================
      Hits         5104     5104           
      Misses       5724     5724           
      Partials      290      290           

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

    @ikura-hamu ikura-hamu merged commit cd9c687 into main Feb 24, 2025
    11 checks passed
    @ikura-hamu ikura-hamu deleted the dep/uber_gomock branch February 24, 2025 13:53
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    gomockの移行
    1 participant