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

fix: [restful v2] count(*) & hook #34369

Merged
merged 2 commits into from
Jul 4, 2024

Conversation

PowderLi
Copy link
Contributor

@PowderLi PowderLi commented Jul 2, 2024

issue: #31224 #34374

for query api:

  1. param filter is not requried
  2. param limit is useless while outputFields = [count(*)]

add hook about grpc call

@sre-ci-robot sre-ci-robot added the size/L Denotes a PR that changes 100-499 lines. label Jul 2, 2024
@mergify mergify bot added dco-passed DCO check passed. kind/bug Issues or changes related a bug labels Jul 2, 2024
Copy link
Contributor

mergify bot commented Jul 3, 2024

@PowderLi E2e jenkins job failed, comment /run-cpu-e2e can trigger the job again.

}
}

func RestfulHookInterceptor() restfulHandler {
Copy link
Contributor

Choose a reason for hiding this comment

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

Better to rename as ServerHookInterceptor

@@ -17,38 +17,47 @@ import (

var hoo hook.Hook

type restfulHandler func(ctx context.Context, req any, userName, fullMethod string, handler grpc.UnaryHandler) (interface{}, error)
Copy link
Contributor

Choose a reason for hiding this comment

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

rename ,do not include restful
This thing is being utilized not only for "restful" purposes.

Copy link
Contributor

mergify bot commented Jul 3, 2024

@PowderLi E2e jenkins job failed, comment /run-cpu-e2e can trigger the job again.

return func(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {
return HookInterceptor()(ctx, req, getCurrentUser(ctx), info.FullMethod, handler)
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps it would be better to use the HookInterceptor return value as a method directly, because it can reduce one layer of function calls, like HookIntercept(xxx, xxx, xxx)

Copy link
Contributor

mergify bot commented Jul 4, 2024

@PowderLi E2e jenkins job failed, comment /run-cpu-e2e can trigger the job again.

Copy link

codecov bot commented Jul 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.33%. Comparing base (7611128) to head (4007033).
Report is 3 commits behind head on master.

Current head 4007033 differs from pull request most recent head 3cdbb04

Please upload reports for the commit 3cdbb04 to get more accurate results.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #34369      +/-   ##
==========================================
+ Coverage   80.92%   84.33%   +3.40%     
==========================================
  Files        1113      825     -288     
  Lines      138345   113669   -24676     
==========================================
- Hits       111960    95859   -16101     
+ Misses      22145    13590    -8555     
+ Partials     4240     4220      -20     
Files Coverage Δ
...nternal/distributed/proxy/httpserver/handler_v2.go 91.59% <100.00%> (+0.02%) ⬆️
...nternal/distributed/proxy/httpserver/request_v2.go 100.00% <ø> (ø)
internal/proxy/hook_interceptor.go 100.00% <100.00%> (ø)

... and 317 files with indirect coverage changes

@PowderLi
Copy link
Contributor Author

PowderLi commented Jul 4, 2024

/run-cpu-e2e

1. param filter is not requried
2. param limit is useless while outputFields = [count(*)]

Signed-off-by: PowderLi <[email protected]>
Signed-off-by: PowderLi <[email protected]>
@czs007 czs007 added the PR | need cherry-pick need cherry pick to other branches label Jul 4, 2024
@czs007
Copy link
Contributor

czs007 commented Jul 4, 2024

/approve

@czs007
Copy link
Contributor

czs007 commented Jul 4, 2024

/approve
/lgtm

@sre-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: czs007, PowderLi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@mergify mergify bot added the ci-passed label Jul 4, 2024
@sre-ci-robot sre-ci-robot merged commit c16a704 into milvus-io:master Jul 4, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved ci-passed dco-passed DCO check passed. kind/bug Issues or changes related a bug lgtm PR | need cherry-pick need cherry pick to other branches size/L Denotes a PR that changes 100-499 lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants