-
-
Notifications
You must be signed in to change notification settings - Fork 147
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
Replace grpcstatus.Errorf with connect.Error #741
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #741 +/- ##
==========================================
- Coverage 49.27% 49.25% -0.02%
==========================================
Files 69 69
Lines 10081 10084 +3
==========================================
Hits 4967 4967
- Misses 4598 4601 +3
Partials 516 516 ☔ View full report in Codecov by Sentry. |
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.
Seems like I have forgot to update some of error handling codes on interceptors. Thanks for the updates 👍🏼
I'm unsure about how to validate this change in the test code, as it is currently passing test using the existing approach.
auth_webhook_test.go
does not validates admin interceptor. Since this code is only related to admin operations, you need to add new test on admin_test.go
.
it will look something like this:
t.Run("authorization test", func(t *testing.T) {
// try to do admin operation without authorization.
adminCli2, err := admin.Dial(defaultServer.RPCAddr(), admin.WithInsecure(true))
assert.NoError(t, err)
defer func() {
adminCli2.Close()
}()
_, err = adminCli2.GetProject(ctx, "default")
assert.Equal(t, connect.CodeUnauthenticated, connect.CodeOf(err))
})
Co-authored-by: Yourim Cha <chacha912@users.noreply.github.com> Co-authored-by: Youngteac Hong <susukang98@gmail.com>
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.
Thanks for your contribution. 👍
What this PR does / why we need it:
Previously, there was an issue in Dashboard where errors were not being properly distinguished as
ConnectError
. To address this problem, I replaced the usage of gRPC status error withconnect.NewError
.Which issue(s) this PR fixes:
Related #703
Special notes for your reviewer:
I'm unsure about how to validate this change in the test code, as it is currently passing test using the existing approach.
yorkie/test/integration/auth_webhook_test.go
Lines 92 to 141 in d932b59
Does this PR introduce a user-facing change?:
Additional documentation:
Checklist: