-
Notifications
You must be signed in to change notification settings - Fork 813
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
C# SDK Cleanup & Nuget Package #1596
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
To build this as a nuget package the command is straight forward:
For further details: https://docs.microsoft.com/en-us/nuget/create-packages/creating-a-package-dotnet-cli I've tested this internally on our private Nuget repositories and have been running sdk integrated game servers for the last two weeks. |
Build Failed 😱 Build Id: be26b4c7-6889-49b8-a213-d5dff5318608 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Failed 😱 Build Id: 2e597929-8cfb-48ca-8d6b-c1fb1e52b672 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Looking at the logs, it looks like Something in the SDK tests isn't working. |
Build Succeeded 👏 Build Id: 6c575c63-ef77-42c8-978d-e46e1c9074b6 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:
|
A couple of quick questions: Just to confirm, is this a breaking change in the SDK? I.e will old integrations still work with this when they upgrade, or will people need to change the code?
Can you expand more on this? Maybe this is something we should upgrade across the board. |
Are there any issues with the generated code output? Doesn't look like there are, as the generated code wasn't touched, but just wanted to be sure. |
Build Succeeded 👏 Build Id: 7471aa09-7604-4e47-bd1a-c4eadba4037a 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:
|
There should be no breaking changes to the gRPC update; there was an issue with our unit tests starting before the agones api endpoint was available (we're packing the dev server as a fixture and delayed the startup to test) and the stream connection wasn't attempting a retry properly. Instead, it was failing an exception in the grpc library with:
Updating it to the No agones code gen required. |
Build Succeeded 👏 Build Id: ee5cf4b5-ba97-4b17-9ee0-194ea2749a8d 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 Failed 😱 Build Id: 32677196-7c4d-4933-86ab-8125097f2404 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Succeeded 👏 Build Id: 664c52a8-f626-4cd8-a0b4-57d6364edc72 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:
|
@pooneh-m since you are our resident C# expert, would you mind taking a look at these changes? |
} | ||
catch (RpcException ex) | ||
{ | ||
Console.Error.WriteLine(ex.Message); | ||
//Should I rethrow the exception? | ||
return null; |
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.
This is change in the behavior. I agree that this is how it should have been handled originally, but may break a customer use-case that is already depending on this behavior.
@markmandel would it be ok to suddenly throw exception GetGameServerAsync()? How other SDKs are handling this?
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.
Yeah, I think it's reasonable to throw an exception here. I'm also assuming that in C#, exception throwing is the appropriate way to deal with errorrs?
For example, Go returns an error
The only maybe interesting part, is - do we want to throw the GRPC exception, or do we want to wrap it in our own exception type?
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.
Ah, I forgot about this. Yeah, I figured surfacing the exception would be better than just sinking it like it was previously doing. Typically, libraries shouldn't do this and should surface it to the consuming callsite.
As for whether or not to make a custom AgonesException to wrap it in, I'll leave it up to you. I'm fine with handling a gRPC exception in my code.
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.
If there is no dependency to this SDK that this change would break them, it looks good to me. I don't think we need to wrap the exception.
Thanks @rcreasey for the changes and for the fix. |
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 the changes. The proposed change to RequestTimeoutSec looks good to me.
} | ||
catch (RpcException ex) | ||
{ | ||
Console.Error.WriteLine(ex.Message); | ||
//Should I rethrow the exception? | ||
return null; |
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.
If there is no dependency to this SDK that this change would break them, it looks good to me. I don't think we need to wrap the exception.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: pooneh-m, rcreasey 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 Failed 😱 Build Id: ff2ec003-2944-4e98-a0ae-feb1aae11a83 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Failed 😱 Build Id: c34abefd-1cf8-4d9a-86ca-1f8c40fb42db To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Failed 😱 Build Id: e7488cd1-5ff9-4e44-a144-73a4fc2ac660 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Succeeded 👏 Build Id: 85824577-0585-4658-b19b-1b812b23f7e8 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:
|
* C# SDK refactoring; preparing for a nuget package * Updating c# sdk documentation * Fixing csharp sdk tests. * Updating nuget version * Updating project version as well * Version matching the nuspec file. * Update sdks/csharp/sdk/AgonesSDK.cs * Properly renaming the RequestTimeout property to RequestTimeoutSec
What type of PR is this?
/kind bug
/kind cleanup
/kind documentation
/kind feature
What this PR does / Why we need it:
Updates the C# SDK with the following:
2.28
due to timeout issues.Health
pings on instanced clients.Which issue(s) this PR fixes:
Closes #1583
Special notes for your reviewer:
This will still require additional work on the Google side to provide necessary credentials to get the nuget package pushed to official repositories.