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

Implement StreamListObject and its tests #2145

Merged
merged 10 commits into from
Aug 4, 2023
Merged

Conversation

ykadowak
Copy link
Contributor

@ykadowak ykadowak commented Jul 31, 2023

Description:

This PR implements StreamListObject rpc.

Related Issue:

Versions:

  • Go Version: 1.20.6
  • Docker Version: 20.10.8
  • Kubernetes Version: v1.27.3
  • NGT Version: 2.0.16

Checklist:

Special notes for your reviewer:

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jul 31, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: d21c1af
Status: ✅  Deploy successful!
Preview URL: https://f0dff87c.vald.pages.dev
Branch Preview URL: https://feature-stream-list-object.vald.pages.dev

View logs

@vdaas-ci
Copy link
Collaborator

[CHATOPS:HELP] ChatOps commands.

  • 🙆‍♀️ /approve - approve
  • 💌 /changelog - replace the PR body by changelog details
  • 🍱 /format - format codes and add licenses
  • /gen-test - generate test codes
  • 🏷️ /label - add labels
  • /rebase - rebase main
  • 🔚 2️⃣ 🔚 /label actions/e2e-deploy - run E2E deploy & integration test

@codecov
Copy link

codecov bot commented Jul 31, 2023

Codecov Report

Patch coverage: 48.27% and project coverage change: +0.04% 🎉

Comparison is base (bf17b93) 31.14% compared to head (d21c1af) 31.18%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2145      +/-   ##
==========================================
+ Coverage   31.14%   31.18%   +0.04%     
==========================================
  Files         339      339              
  Lines       32834    32920      +86     
==========================================
+ Hits        10225    10265      +40     
- Misses      22157    22200      +43     
- Partials      452      455       +3     
Files Changed Coverage Δ
internal/client/v1/client/vald/vald.go 0.00% <0.00%> (ø)
internal/net/grpc/status/status.go 21.84% <0.00%> (-0.22%) ⬇️
pkg/agent/core/ngt/service/ngt.go 36.77% <0.00%> (-0.06%) ⬇️
pkg/agent/core/ngt/handler/grpc/object.go 59.33% <69.49%> (+3.99%) ⬆️
internal/net/grpc/stream.go 27.21% <100.00%> (ø)

... and 2 files with indirect coverage changes

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

@ykadowak ykadowak changed the title [WIP] implement StreamListObject and its tests Implement StreamListObject and its tests Aug 1, 2023
@ykadowak ykadowak requested review from a team, kevindiu and datelier and removed request for a team August 1, 2023 05:45
datelier
datelier previously approved these changes Aug 1, 2023
kevindiu
kevindiu previously approved these changes Aug 2, 2023
Comment on lines 261 to 268
for _, e := range errs {
st, msg, err := status.ParseError(e, codes.Internal, "failed to parse StreamListObject final gRPC error response")
if span != nil {
span.RecordError(err)
span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...)
span.SetStatus(trace.StatusError, msg)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

seems we can rewrite it like

Suggested change
for _, e := range errs {
st, msg, err := status.ParseError(e, codes.Internal, "failed to parse StreamListObject final gRPC error response")
if span != nil {
span.RecordError(err)
span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...)
span.SetStatus(trace.StatusError, msg)
}
}
if span != nil {
for _, e := range errs {
st, msg, err := status.ParseError(e, codes.Internal, "failed to parse StreamListObject final gRPC error response")
span.RecordError(err)
span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...)
span.SetStatus(trace.StatusError, msg)
}
}

because this block of logic only effective when span is not nil.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks
d21c1af

@ykadowak ykadowak requested a review from kevindiu August 3, 2023 01:49
@ykadowak ykadowak merged commit 760d586 into main Aug 4, 2023
71 checks passed
@ykadowak ykadowak deleted the feature/stream-list-object branch August 4, 2023 00:07
@hlts2 hlts2 mentioned this pull request Sep 13, 2023
ykadowak added a commit that referenced this pull request Nov 30, 2023
ykadowak added a commit that referenced this pull request Nov 30, 2023
ykadowak added a commit that referenced this pull request Nov 30, 2023
ykadowak added a commit that referenced this pull request Nov 30, 2023
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.

4 participants