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

SA1019: firestore.WriteBatch is deprecatedの対応 #158

Merged
merged 3 commits into from Jan 3, 2023
Merged

Conversation

wheatandcat
Copy link
Owner

@wheatandcat wheatandcat commented Jan 2, 2023

関連 issue

対応内容

  • パッケージを全体的にバージョンアップ
  • deprecatedになっていた箇所を修正
    • firestore.WriteBatch→BulkWriterに移行
    • google.golang.org/genproto/googleapis/cloud/tasks/v2→cloud.google.com/go/cloudtasks/apiv2/cloudtaskspbに移行
    • google.golang.org/genproto/googleapis/firestore/v1→cloud.google.com/go/firestore/apiv1/firestorepbに移行

開発用メモ

無し

@github-actions

This comment has been minimized.

@github-actions
Copy link

github-actions bot commented Jan 2, 2023

Visit the 👀 Preview 👀 for this PR (updated for commit 4ac9f96):
https://pr-158---product-x-drwvbiotlz-an.a.run.app
(:warning: deleted at Tue Jan 3 17:47:49 JST 2023)

@github-actions

This comment has been minimized.

@@ -19,7 +20,8 @@ import (
const verifyCustomTokenURL = "https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyCustomToken?key=%s"

type User struct {
UserToken string `yaml:"userToken"`
UserToken1 string `yaml:"userToken1"`
Copy link
Owner Author

Choose a reason for hiding this comment

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

以下のissueの対応の土台でe2eでユーザーを2つ作成できるように修正

@@ -45,10 +49,26 @@ func newGraph() graph.Graph {
AuthUseCase: &moq_usecase_auth.UseCaseMock{},
}

credJSON, err := ioutil.ReadFile("../serviceAccount.json")
Copy link
Owner Author

Choose a reason for hiding this comment

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

testでFirestoreClientを使用するので認証のコードを追加

g.App.InviteRepository.Create(ctx, g.FirestoreClient, batch, i)

if err := g.App.CommonRepository.Commit(ctx, batch); err != nil {
batch := g.FirestoreClient.BulkWriter(ctx)
Copy link
Owner Author

Choose a reason for hiding this comment

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

Batch→BulkWriterに変更

@@ -7,7 +7,7 @@ import (
"os"

cloudtasks "cloud.google.com/go/cloudtasks/apiv2"
taskspb "google.golang.org/genproto/googleapis/cloud/tasks/v2"
Copy link
Owner Author

Choose a reason for hiding this comment

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

deprecatedになっていたので修正

@github-actions
Copy link

github-actions bot commented Jan 3, 2023

Code Metrics Report

150 (4f9f956) 150 (4ac9f96) +/-
Coverage 40.4% 40.4% 0.0%
Code to Test Ratio 1:0.1 1:0.1 0.0
Test Execution Time 30s 33s +3s
Details
  |                     | 150 (4f9f956) | 150 (4ac9f96) | +/-  |
  |---------------------|---------------|---------------|------|
  | Coverage            |         40.4% |         40.4% | 0.0% |
  |   Files             |             9 |             9 |    0 |
  |   Lines             |           559 |           559 |    0 |
  |   Covered           |           226 |           226 |    0 |
  | Code to Test Ratio  |         1:0.1 |         1:0.1 |  0.0 |
  |   Code              |         14700 |         14700 |    0 |
  |   Test              |          1390 |          1390 |    0 |
- | Test Execution Time |           30s |           33s |  +3s |

Code coverage of files in pull request scope (69.3% → 69.3%)

Files Coverage +/-
graph/invite.go 72.9% 0.0%
graph/relationship.go 82.6% 0.0%
graph/relationship_request.go 67.6% 0.0%
graph/user.go 59.0% 0.0%

Reported by octocov

@wheatandcat wheatandcat added this to the v1.7.0 milestone Jan 3, 2023
@wheatandcat wheatandcat self-assigned this Jan 3, 2023
@wheatandcat wheatandcat marked this pull request as ready for review January 3, 2023 08:46
@wheatandcat wheatandcat merged commit e1c5db6 into main Jan 3, 2023
@wheatandcat wheatandcat deleted the 150 branch January 3, 2023 08:47
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.

None yet

1 participant