-
Notifications
You must be signed in to change notification settings - Fork 769
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
Move Grpc.Core.Api nuget from grpc/grpc #1651
Conversation
/// </summary> | ||
public static class VersionInfo | ||
{ | ||
// TODO(jtattermusch): how to propagate versions from https://github.com/grpc/grpc-dotnet/blob/f238855fcb77cec01e87eb9cc08680c3420c132f/Directory.Build.props#L8-L10version into |
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.
Still need to figure out how to turn .csproj properties into string constants.
(in grpc/grpc we simply used codegen to generate contents of VersionInfo.cs)
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.
@JamesNK any ideas how to do 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.
No. I know how to easily embed properties as assembly attributes, which can then be fetched at runtime. But these are const values so that won't work.
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.
Could write a source generator? https://docs.microsoft.com/en-us/dotnet/csharp/roslyn-sdk/source-generators-overview
/// </summary> | ||
public class AuthInterceptorContext | ||
{ | ||
readonly string serviceUrl; |
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.
What do you think of eventually following grpc-dotnet standards? e.g. underscore on private variables, no this, var, etc
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 is something we can consider, but I think it's low priority. I understand that we'd want all the code to follow the same code-style, but I'd like us to refrain from making unnecessary changes / refactorings until the point when things settle down a bit (e.g. once we've done one or two successful releases of the new location and we have some verification that there aren't any unexpected problems).
[assembly: InternalsVisibleTo("Grpc.Core,PublicKey=" + | ||
"00240000048000009400000006020000002400005253413100040000010001002f5797a92c6fcde81bd4098f43" + | ||
"0442bb8e12768722de0b0cb1b15e955b32a11352740ee59f2c94c48edc8e177d1052536b8ac651bce11ce5da3a" + | ||
"27fc95aff3dc604a6971417453f9483c7b5e836756d5b271bf8f2403fe186e31956148c03d804487cf642f8cc0" + | ||
"71394ee9672dfe5b55ea0f95dfd5a7f77d22c962ccf51320d3")] | ||
[assembly: InternalsVisibleTo("Grpc.Core.Tests,PublicKey=" + | ||
"00240000048000009400000006020000002400005253413100040000010001002f5797a92c6fcde81bd4098f43" + | ||
"0442bb8e12768722de0b0cb1b15e955b32a11352740ee59f2c94c48edc8e177d1052536b8ac651bce11ce5da3a" + | ||
"27fc95aff3dc604a6971417453f9483c7b5e836756d5b271bf8f2403fe186e31956148c03d804487cf642f8cc0" + | ||
"71394ee9672dfe5b55ea0f95dfd5a7f77d22c962ccf51320d3")] | ||
[assembly: InternalsVisibleTo("Grpc.Core.Testing,PublicKey=" + | ||
"00240000048000009400000006020000002400005253413100040000010001002f5797a92c6fcde81bd4098f43" + | ||
"0442bb8e12768722de0b0cb1b15e955b32a11352740ee59f2c94c48edc8e177d1052536b8ac651bce11ce5da3a" + | ||
"27fc95aff3dc604a6971417453f9483c7b5e836756d5b271bf8f2403fe186e31956148c03d804487cf642f8cc0" + | ||
"71394ee9672dfe5b55ea0f95dfd5a7f77d22c962ccf51320d3")] | ||
[assembly: InternalsVisibleTo("Grpc.IntegrationTesting,PublicKey=" + | ||
"00240000048000009400000006020000002400005253413100040000010001002f5797a92c6fcde81bd4098f43" + | ||
"0442bb8e12768722de0b0cb1b15e955b32a11352740ee59f2c94c48edc8e177d1052536b8ac651bce11ce5da3a" + | ||
"27fc95aff3dc604a6971417453f9483c7b5e836756d5b271bf8f2403fe186e31956148c03d804487cf642f8cc0" + | ||
"71394ee9672dfe5b55ea0f95dfd5a7f77d22c962ccf51320d3")] | ||
[assembly: InternalsVisibleTo("Grpc.Microbenchmarks,PublicKey=" + | ||
"00240000048000009400000006020000002400005253413100040000010001002f5797a92c6fcde81bd4098f43" + | ||
"0442bb8e12768722de0b0cb1b15e955b32a11352740ee59f2c94c48edc8e177d1052536b8ac651bce11ce5da3a" + | ||
"27fc95aff3dc604a6971417453f9483c7b5e836756d5b271bf8f2403fe186e31956148c03d804487cf642f8cc0" + | ||
"71394ee9672dfe5b55ea0f95dfd5a7f77d22c962ccf51320d3")] |
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.
Can be removed/replaced
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.
We can only remove once we verify that Grpc.Core.Api assembly built using the grpc-dotnet repo still works with the tests from the grpc/grpc (since those tests aren't going to be deleted, we still need to be able to run them, even though they'd live on a "frozen" branch.)
There are tests in Grpc.Core.Tests that relate to Grpc.Core.Api functionality. They should be extracted to a new test project. |
Added Grpc.Core.Api.Tests with the tests from Grpc.Core.Tests that seemed relevant. |
public class VersionInfoTest | ||
{ | ||
[Test] | ||
public void VersionInfoMatchesAssemblyProperties() |
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.
FYI I added this test to make sure that VersionInfo.cs' constants alway stay in sync with the .csproj settings regardless of what approach we choose for keeping the VersionInfo up to date.
One more question: It seems feasible to add the original src/csharp/Grpc.Core.Api git subtree along with filtered commit history by using the |
Discussed and we decided to simply do a codedump and link to the original codebase (at a clearly documented revision) for simplicity. |
@JamesNK can you please do another pass and let me know if there's any other major concerns (besides the question of regenerating the constants in VersionInfo.cs) that would prevent this PR from accepting? |
@@ -0,0 +1,21 @@ | |||
<Project Sdk="Microsoft.NET.Sdk"> | |||
<PropertyGroup> | |||
<TargetFrameworks>net45;netcoreapp3.1</TargetFrameworks> |
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.
net45 -> net462
I think eventually these new projects should test with the same frameworks as existing test projects (e.g. + net5.0 and net6.0) but can leave it unchanged for now.
|
||
<IsGrpcPublishedPackage>true</IsGrpcPublishedPackage> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
<TargetFrameworks>net45;netstandard1.5;netstandard2.0;netstandard2.1</TargetFrameworks> |
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.
net45 isn't supported anymore. See https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-framework
Should change net45 to net462 for various Grpc.Core projects.
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.
ok, that seems doable. But there should also be a some follow-up cleanup after switching to net462 (#if
defs and also there is some compatibility code that is no longer needed on net462)
3024577
to
53e681c
Compare
@JamesNK this is ready for final pass of review (even when approved, I still won't merge just yet, I'd like to synchronize removing stuff from grpc/grpc with adding the corresponding stuff to grpc-dotnet). |
1d4a5e1
to
c21d173
Compare
I'm going to merge this to allow for easier review of #1652 and #1708.
|
Add Grpc.Core.Api and relevant tests from grpc/grpc to grpc-dotnet.