-
Notifications
You must be signed in to change notification settings - Fork 829
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
Change to use grpc-dotnet instead of Grpc.Core in C# SDK #3397
Change to use grpc-dotnet instead of Grpc.Core in C# SDK #3397
Conversation
using Microsoft.Extensions.Logging; | ||
using System; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Grpc.Core; |
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.
The namespace Grpc.Core
remains, but it is included in grpc-dotnet.
Build Succeeded 👏 Build Id: ace9678b-3a9e-4208-b627-fedbfa760722 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
Build Succeeded 👏 Build Id: 64dede6e-da6b-413d-afdc-4eabf3932b60 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
Build Succeeded 👏 Build Id: e120c85b-ce3d-48c0-8edb-586ae79e7161 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
build/build-sdk-images/csharp/gen.sh
Outdated
proto=/go/src/agones.dev/agones/proto | ||
sdk=${proto}/sdk | ||
googleapis=${proto}/googleapis | ||
csharp_proto_file_output_dir=/go/src/agones.dev/agones/sdks/csharp/sdk/proto |
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.
Curious - does it have to be in sdk/proto
? Also wondering if we should update the .gitignore so it doesn't ignore ./proto
folder anymore, since the csharp code is now generated at build time.
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.
It doesn't necessarily need to be in sdk/proto
, but since only the C# SDK uses this specially rewritten .proto
files, I decided to output it there.
Currently it doesn't seem to be ignored by .gitignore, but is there likely to be a problem?
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.
Sorry, I wasn't clear, lemme explain this another way:
Shall we put the proto files in /go/src/agones.dev/agones/sdks/csharp/proto
(the sdk
seems redundant), which is the same as how we do the same thing with rust https://github.com/googleforgames/agones/tree/main/sdks/rust/proto
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.
I see, I understand!
I did it that way at first, but the actual C# SDK implementation was in sdks/csharp/sdk
.
For this reason, although it is redundant, I thought it would be better to put them in the same hierarchy.
WDYT?
https://github.com/googleforgames/agones/tree/main/sdks/csharp/sdk
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.
oooooh! So it is!
I guess what's the usual convention for csharp? Are the protos usually kept with the source code (i.e. sdk
) or kept separately (i.e. one level up)?
We should probably just do whatever the regular convention is - I don't actually mind either way.
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.
Normally, the proto file is often shared between the server and client, so I think it should be placed in a separate folder from the source code.
(However, this time it seems to be different in that a proto file exclusively for the C# SDK is generated.)
That said, I agree that it would be better to have a structure similar to most projects.
Now let's modify it to output to sdks/csharp
.
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.
Now let's modify it to output to sdks/csharp .
Sorry, wasn't sure I 100% understood.
I think we're saying to leave it at /go/src/agones.dev/agones/sdks/csharp/sdk/proto
yes? or no?
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.
Sorry, that's no.
I modify it to csharp/sdk
.
And I just committed it.
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.
Got it! That works for me!
Build Succeeded 👏 Build Id: da80c334-0623-4751-b92c-177a348d3e51 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
Build Succeeded 👏 Build Id: 8f99a110-26fc-413d-ad3d-6ec506eb8d69 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
Build Succeeded 👏 Build Id: 261c389a-8e26-4b9e-9859-aebfe92a5def The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: markmandel, yoshd 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 |
New changes are detected. LGTM label has been removed. |
Build Succeeded 👏 Build Id: bfaea9d3-c0b2-4189-8195-57a347489e7d The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
What type of PR is this?
/kind cleanup
What this PR does / Why we need it:
Grpc.Core used in the C# SDK is currently deprecated.
https://grpc.io/blog/grpc-csharp-future/
Changed to use grpc-dotnet instead.
Accordingly, code generation for .proto files has been modified to occur at build time, similar to the Rust SDK.
To do this, C#-specific rewritten .proto file was output to the
sdks/csharp/sdk
folder.Which issue(s) this PR fixes:
Closes #
Special notes for your reviewer: