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

Generate Protobuf C# objects automatically in MSBuild #7063

Merged
merged 10 commits into from
Apr 22, 2024

Conversation

yanpitangui
Copy link
Contributor

@yanpitangui yanpitangui commented Jan 15, 2024

Fixes #5362

Changes

  • Removed manually generated files with the msbuild alternative (https://chromium.googlesource.com/external/github.com/grpc/grpc/+/HEAD/src/csharp/BUILD-INTEGRATION.md)

  • For this to work, we need to figure out a way to override the Equals and GetHashCode from NodeMetrics and Metrics in Akka.Cluster.Metrics, AFAIK that is not possible right now, so I kept the build not functioning yet by not removing the manually created Equals and GetHashCode

  • One thing that we should look at is the accessibility of the generated classes, right now everything is public. Changing everything to internal also break things, so I would like some guidance.

Checklist

For significant changes, please ensure that the following have been completed (delete if not relevant):

@Aaronontheweb
Copy link
Member

Thanks for this @yanpitangui - I'll take a look at this

Copy link
Member

@Aaronontheweb Aaronontheweb left a comment

Choose a reason for hiding this comment

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

The structure of the project and the build changes look fine - I need to take a look at the build errors next. I am not sure why this is the case (per @yanpitangui 's original PR comment):

For this to work, we need to figure out a way to override the Equals and GetHashCode from NodeMetrics and Metrics in Akka.Cluster.Metrics, AFAIK that is not possible right now, so I kept the build not functioning yet by not removing the manually created Equals and GetHashCode

That's odd, because we never manually edited any of the generated files before. Is this a new change caused by the way Grpc.Tools is calling protoc?

@@ -25,6 +25,7 @@
<NewtonsoftJsonVersion>[13.0.1,)</NewtonsoftJsonVersion>
<NBenchVersion>2.0.1</NBenchVersion>
<ProtobufVersion>3.25.2</ProtobufVersion>
<GrpcToolsVersion>2.60.0</GrpcToolsVersion>
Copy link
Member

Choose a reason for hiding this comment

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

LGTM

@@ -426,51 +426,6 @@ Target "PublishNuget" (fun _ ->
printfn "%s" exn.Message
)

//--------------------------------------------------------------------------------
Copy link
Member

Choose a reason for hiding this comment

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

LGTM

@Aaronontheweb
Copy link
Member

One thing that we should look at is the accessibility of the generated classes, right now everything is public. Changing everything to internal also break things, so I would like some guidance.

I'm fine leaving them as public - these classes are subjected to Extend-only Design inherently through the design of the Protobuf versioning guidelines. And besides, these types map directly to wire formats so they have to be treated like they're public anyway due to our wire versioning guidelines too: https://getakka.net/community/contributing/wire-compatibility.html

@Aaronontheweb
Copy link
Member

D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\obj\Release\netstandard2.0\Serialization\Proto\ClusterMetricsMessages.cs(685,17): error CS0111: Type 'NodeMetrics' already defines a member called 'Equals' with the same parameter types [D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\Akka.Cluster.Metrics.csproj::TargetFramework=netstandard2.0]
D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\obj\Release\netstandard2.0\Serialization\Proto\ClusterMetricsMessages.cs(700,25): error CS0111: Type 'NodeMetrics' already defines a member called 'GetHashCode' with the same parameter types [D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\Akka.Cluster.Metrics.csproj::TargetFramework=netstandard2.0]
D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\obj\Release\netstandard2.0\Serialization\Proto\ClusterMetricsMessages.cs(1478,21): error CS0111: Type 'NodeMetrics.Types.Metric' already defines a member called 'Equals' with the same parameter types [D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\Akka.Cluster.Metrics.csproj::TargetFramework=netstandard2.0]
D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\obj\Release\netstandard2.0\Serialization\Proto\ClusterMetricsMessages.cs(1493,29): error CS0111: Type 'NodeMetrics.Types.Metric' already defines a member called 'GetHashCode' with the same parameter types [D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\Akka.Cluster.Metrics.csproj::TargetFramework=netstandard2.0]
D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\obj\Release\net6.0\Serialization\Proto\ClusterMetricsMessages.cs(685,17): error CS0111: Type 'NodeMetrics' already defines a member called 'Equals' with the same parameter types [D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\Akka.Cluster.Metrics.csproj::TargetFramework=net6.0]
D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\obj\Release\net6.0\Serialization\Proto\ClusterMetricsMessages.cs(700,25): error CS0111: Type 'NodeMetrics' already defines a member called 'GetHashCode' with the same parameter types [D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\Akka.Cluster.Metrics.csproj::TargetFramework=net6.0]
D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\obj\Release\net6.0\Serialization\Proto\ClusterMetricsMessages.cs(1478,21): error CS0111: Type 'NodeMetrics.Types.Metric' already defines a member called 'Equals' with the same parameter types [D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\Akka.Cluster.Metrics.csproj::TargetFramework=net6.0]
D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\obj\Release\net6.0\Serialization\Proto\ClusterMetricsMessages.cs(1493,29): error CS0111: Type 'NodeMetrics.Types.Metric' already defines a member called 'GetHashCode' with the same parameter types [D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\Akka.Cluster.Metrics.csproj::TargetFramework=net6.0]
    0 Warning(s)
    8 Error(s)

I think what you have going on here is actually a namespace clash @yanpitangui - these files should normally be copied into the .Proto sub-namespace for each of their respective projects. That's what the FAKE script was doing previously:

let protoFiles = [
        ("WireFormats.proto", "/src/core/Akka.Remote/Serialization/Proto/");
        ("ContainerFormats.proto", "/src/core/Akka.Remote/Serialization/Proto/");
        ("SystemMessageFormats.proto", "/src/core/Akka.Remote/Serialization/Proto/");
        ("ClusterMessages.proto", "/src/core/Akka.Cluster/Serialization/Proto/");
        ("ClusterClientMessages.proto", "/src/contrib/cluster/Akka.Cluster.Tools/Client/Serialization/Proto/");
        ("DistributedPubSubMessages.proto", "/src/contrib/cluster/Akka.Cluster.Tools/PublishSubscribe/Serialization/Proto/");
        ("ClusterShardingMessages.proto", "/src/contrib/cluster/Akka.Cluster.Sharding/Serialization/Proto/");
        ("ReliableDelivery.proto", "/src/core/Akka.Cluster/Serialization/Proto/");
        ("TestConductorProtocol.proto", "/src/core/Akka.Remote.TestKit/Proto/");
        ("Persistence.proto", "/src/core/Akka.Persistence/Serialization/Proto/");
        ("StreamRefMessages.proto", "/src/core/Akka.Streams/Serialization/Proto/");
        ("ReplicatorMessages.proto", "/src/contrib/cluster/Akka.DistributedData/Serialization/Proto/");
        ("ReplicatedDataMessages.proto", "/src/contrib/cluster/Akka.DistributedData/Serialization/Proto/"); ]

So in your case, I think you just need to change the output directory these files are generated into - ensure that they get generated into Serialization/Proto for each of these respective projects. Does that make sense?

@yanpitangui
Copy link
Contributor Author

yanpitangui commented Jan 16, 2024

The structure of the project and the build changes look fine - I need to take a look at the build errors next. I am not sure why this is the case (per @yanpitangui 's original PR comment):

For this to work, we need to figure out a way to override the Equals and GetHashCode from NodeMetrics and Metrics in Akka.Cluster.Metrics, AFAIK that is not possible right now, so I kept the build not functioning yet by not removing the manually created Equals and GetHashCode

That's odd, because we never manually edited any of the generated files before. Is this a new change caused by the way Grpc.Tools is calling protoc?

I'm pretty sure that the generated files were being versioned in git. If you take a look into the deleted files, you will see them
Also, take a look at this comment: https://github.com/yanpitangui/akka.net/blob/e4c1ee2637a222d1a64a9cf2a34ac1de1d5d105c/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/Metric.cs#L167

@yanpitangui
Copy link
Contributor Author

yanpitangui commented Jan 16, 2024

D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\obj\Release\netstandard2.0\Serialization\Proto\ClusterMetricsMessages.cs(685,17): error CS0111: Type 'NodeMetrics' already defines a member called 'Equals' with the same parameter types [D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\Akka.Cluster.Metrics.csproj::TargetFramework=netstandard2.0]
D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\obj\Release\netstandard2.0\Serialization\Proto\ClusterMetricsMessages.cs(700,25): error CS0111: Type 'NodeMetrics' already defines a member called 'GetHashCode' with the same parameter types [D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\Akka.Cluster.Metrics.csproj::TargetFramework=netstandard2.0]
D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\obj\Release\netstandard2.0\Serialization\Proto\ClusterMetricsMessages.cs(1478,21): error CS0111: Type 'NodeMetrics.Types.Metric' already defines a member called 'Equals' with the same parameter types [D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\Akka.Cluster.Metrics.csproj::TargetFramework=netstandard2.0]
D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\obj\Release\netstandard2.0\Serialization\Proto\ClusterMetricsMessages.cs(1493,29): error CS0111: Type 'NodeMetrics.Types.Metric' already defines a member called 'GetHashCode' with the same parameter types [D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\Akka.Cluster.Metrics.csproj::TargetFramework=netstandard2.0]
D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\obj\Release\net6.0\Serialization\Proto\ClusterMetricsMessages.cs(685,17): error CS0111: Type 'NodeMetrics' already defines a member called 'Equals' with the same parameter types [D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\Akka.Cluster.Metrics.csproj::TargetFramework=net6.0]
D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\obj\Release\net6.0\Serialization\Proto\ClusterMetricsMessages.cs(700,25): error CS0111: Type 'NodeMetrics' already defines a member called 'GetHashCode' with the same parameter types [D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\Akka.Cluster.Metrics.csproj::TargetFramework=net6.0]
D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\obj\Release\net6.0\Serialization\Proto\ClusterMetricsMessages.cs(1478,21): error CS0111: Type 'NodeMetrics.Types.Metric' already defines a member called 'Equals' with the same parameter types [D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\Akka.Cluster.Metrics.csproj::TargetFramework=net6.0]
D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\obj\Release\net6.0\Serialization\Proto\ClusterMetricsMessages.cs(1493,29): error CS0111: Type 'NodeMetrics.Types.Metric' already defines a member called 'GetHashCode' with the same parameter types [D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\Akka.Cluster.Metrics.csproj::TargetFramework=net6.0]
    0 Warning(s)
    8 Error(s)

I think what you have going on here is actually a namespace clash @yanpitangui - these files should normally be copied into the .Proto sub-namespace for each of their respective projects. That's what the FAKE script was doing previously:

let protoFiles = [
        ("WireFormats.proto", "/src/core/Akka.Remote/Serialization/Proto/");
        ("ContainerFormats.proto", "/src/core/Akka.Remote/Serialization/Proto/");
        ("SystemMessageFormats.proto", "/src/core/Akka.Remote/Serialization/Proto/");
        ("ClusterMessages.proto", "/src/core/Akka.Cluster/Serialization/Proto/");
        ("ClusterClientMessages.proto", "/src/contrib/cluster/Akka.Cluster.Tools/Client/Serialization/Proto/");
        ("DistributedPubSubMessages.proto", "/src/contrib/cluster/Akka.Cluster.Tools/PublishSubscribe/Serialization/Proto/");
        ("ClusterShardingMessages.proto", "/src/contrib/cluster/Akka.Cluster.Sharding/Serialization/Proto/");
        ("ReliableDelivery.proto", "/src/core/Akka.Cluster/Serialization/Proto/");
        ("TestConductorProtocol.proto", "/src/core/Akka.Remote.TestKit/Proto/");
        ("Persistence.proto", "/src/core/Akka.Persistence/Serialization/Proto/");
        ("StreamRefMessages.proto", "/src/core/Akka.Streams/Serialization/Proto/");
        ("ReplicatorMessages.proto", "/src/contrib/cluster/Akka.DistributedData/Serialization/Proto/");
        ("ReplicatedDataMessages.proto", "/src/contrib/cluster/Akka.DistributedData/Serialization/Proto/"); ]

So in your case, I think you just need to change the output directory these files are generated into - ensure that they get generated into Serialization/Proto for each of these respective projects. Does that make sense?

I think my previous comment touches the point here: the generated files were being stripped of their GetHashCode and Equals and versioned. Since the classes are partial, they work fine and can be extended

@Aaronontheweb
Copy link
Member

Ah, you're right those files were edited. TIL. Ok. give that a shot with the partial class approach.

@yanpitangui
Copy link
Contributor Author

D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\obj\Release\netstandard2.0\Serialization\Proto\ClusterMetricsMessages.cs(685,17): error CS0111: Type 'NodeMetrics' already defines a member called 'Equals' with the same parameter types [D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\Akka.Cluster.Metrics.csproj::TargetFramework=netstandard2.0]
D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\obj\Release\netstandard2.0\Serialization\Proto\ClusterMetricsMessages.cs(700,25): error CS0111: Type 'NodeMetrics' already defines a member called 'GetHashCode' with the same parameter types [D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\Akka.Cluster.Metrics.csproj::TargetFramework=netstandard2.0]
D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\obj\Release\netstandard2.0\Serialization\Proto\ClusterMetricsMessages.cs(1478,21): error CS0111: Type 'NodeMetrics.Types.Metric' already defines a member called 'Equals' with the same parameter types [D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\Akka.Cluster.Metrics.csproj::TargetFramework=netstandard2.0]
D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\obj\Release\netstandard2.0\Serialization\Proto\ClusterMetricsMessages.cs(1493,29): error CS0111: Type 'NodeMetrics.Types.Metric' already defines a member called 'GetHashCode' with the same parameter types [D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\Akka.Cluster.Metrics.csproj::TargetFramework=netstandard2.0]
D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\obj\Release\net6.0\Serialization\Proto\ClusterMetricsMessages.cs(685,17): error CS0111: Type 'NodeMetrics' already defines a member called 'Equals' with the same parameter types [D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\Akka.Cluster.Metrics.csproj::TargetFramework=net6.0]
D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\obj\Release\net6.0\Serialization\Proto\ClusterMetricsMessages.cs(700,25): error CS0111: Type 'NodeMetrics' already defines a member called 'GetHashCode' with the same parameter types [D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\Akka.Cluster.Metrics.csproj::TargetFramework=net6.0]
D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\obj\Release\net6.0\Serialization\Proto\ClusterMetricsMessages.cs(1478,21): error CS0111: Type 'NodeMetrics.Types.Metric' already defines a member called 'Equals' with the same parameter types [D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\Akka.Cluster.Metrics.csproj::TargetFramework=net6.0]
D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\obj\Release\net6.0\Serialization\Proto\ClusterMetricsMessages.cs(1493,29): error CS0111: Type 'NodeMetrics.Types.Metric' already defines a member called 'GetHashCode' with the same parameter types [D:\a\1\s\src\contrib\cluster\Akka.Cluster.Metrics\Akka.Cluster.Metrics.csproj::TargetFramework=net6.0]
    0 Warning(s)
    8 Error(s)

I think what you have going on here is actually a namespace clash @yanpitangui - these files should normally be copied into the .Proto sub-namespace for each of their respective projects. That's what the FAKE script was doing previously:

let protoFiles = [
        ("WireFormats.proto", "/src/core/Akka.Remote/Serialization/Proto/");
        ("ContainerFormats.proto", "/src/core/Akka.Remote/Serialization/Proto/");
        ("SystemMessageFormats.proto", "/src/core/Akka.Remote/Serialization/Proto/");
        ("ClusterMessages.proto", "/src/core/Akka.Cluster/Serialization/Proto/");
        ("ClusterClientMessages.proto", "/src/contrib/cluster/Akka.Cluster.Tools/Client/Serialization/Proto/");
        ("DistributedPubSubMessages.proto", "/src/contrib/cluster/Akka.Cluster.Tools/PublishSubscribe/Serialization/Proto/");
        ("ClusterShardingMessages.proto", "/src/contrib/cluster/Akka.Cluster.Sharding/Serialization/Proto/");
        ("ReliableDelivery.proto", "/src/core/Akka.Cluster/Serialization/Proto/");
        ("TestConductorProtocol.proto", "/src/core/Akka.Remote.TestKit/Proto/");
        ("Persistence.proto", "/src/core/Akka.Persistence/Serialization/Proto/");
        ("StreamRefMessages.proto", "/src/core/Akka.Streams/Serialization/Proto/");
        ("ReplicatorMessages.proto", "/src/contrib/cluster/Akka.DistributedData/Serialization/Proto/");
        ("ReplicatedDataMessages.proto", "/src/contrib/cluster/Akka.DistributedData/Serialization/Proto/"); ]

So in your case, I think you just need to change the output directory these files are generated into - ensure that they get generated into Serialization/Proto for each of these respective projects. Does that make sense?

About the FAKE script, if I'm not mistaken, the "Protobuf" step wasn't part of the build process. It was executed manually whenever a protobuf file changed or was created and then the correspondent file would be updated

@yanpitangui
Copy link
Contributor Author

Ah, you're right those files were edited. TIL. Ok. give that a shot with the partial class approach.

Even though the classes are partial, as they already defined GetHashCode and Equals, I don't see a way to solve this

@Aaronontheweb
Copy link
Member

Ah, you're right those files were edited. TIL. Ok. give that a shot with the partial class approach.

Even though the classes are partial, as they already defined GetHashCode and Equals, I don't see a way to solve this

Let me think on it - maybe we're doing something bad that we should not be, with those types.

@Aaronontheweb
Copy link
Member

So I've found the issue here:

public sealed partial class NodeMetrics
{
public Actor.Address Address { get; private set; }
/// <summary>
/// Creates new instance of <see cref="NodeMetrics"/>
/// </summary>
/// <param name="address">Address of the node the metrics are gathered at</param>
/// <param name="timestamp">the time of sampling, in milliseconds since midnight, January 1, 1970 UTC</param>
/// <param name="metrics">The set of sampled <see cref="Types.Metric"/></param>
public NodeMetrics(Actor.Address address, long timestamp, IEnumerable<Types.Metric> metrics)
{
Address = address;
timestamp_ = timestamp;
metrics_ = new RepeatedField<Types.Metric>();
metrics_.AddRange(metrics);
}
/// <summary>
/// Returns the most recent data.
/// </summary>
public NodeMetrics Merge(NodeMetrics that)
{
if (!Address.Equals(that.Address))
throw new ArgumentException(nameof(that), $"merge only allowed for same address, {Address} != {that.Address}");
if (Timestamp >= that.Timestamp)
return this; // that is order
return new NodeMetrics(Address, that.Timestamp, that.Metrics.Union(Metrics));
}
/// <summary>
/// Returns the most recent data with <see cref="Types.EWMA"/> averaging.
/// </summary>
public NodeMetrics Update(NodeMetrics that)
{
if (!Address.Equals(that.Address))
throw new ArgumentException(nameof(that), $"merge only allowed for same address, {Address} != {that.Address}");
// Apply sample ordering
var (latestNode, currentNode) = Timestamp >= that.Timestamp ? (this, that) : (that, this);
// Average metrics present in both latest and current.
var updated = latestNode.Metrics
.SelectMany(latest => currentNode.Metrics.Select(current => (Latest: latest, Current: current)))
.Where(pair => pair.Latest.SameAs(pair.Current))
.Select(pair => pair.Current + pair.Latest)
.ToList();
// Append metrics missing from either latest or current.
// Equality is based on the metric's name
var merged = updated.Union(latestNode.Metrics).Union(currentNode.Metrics);
return new NodeMetrics(Address, latestNode.Timestamp, merged);
}
/// <summary>
/// Gets metric by key
/// </summary>
public Option<Types.Metric> Metric(string name) => Metrics.FirstOrDefault(m => m.Name == name) ?? Option<Types.Metric>.None;
/// <summary>
/// Returns true if <code>that</code> address is the same as this
/// </summary>
public bool SameAs(NodeMetrics that) => Address.Equals(that.Address);
/*
* Two methods below, Equals and GetHashCode, should be used instead of generated in ClusterMetrics.Messages.g.cs
* file. Since we do not have an option to not generate those methods for this particular class,
* just stip them from generated code and paste here, with adding Address property check
*/
public bool Equals(NodeMetrics other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
return Equals(Address, other.Address);
}
public override int GetHashCode()
{
return (Address != null ? Address.GetHashCode() : 0);
}
}

Indeed, we are abusing the Protobuf objects inside our internal usages within Akka.Cluster.Metrics. That's a separate issue that I think will need to be solved in a different PR.

@Aaronontheweb
Copy link
Member

We fixed the issue with Akka.Cluster.Mertrics - you should be good to move forward with this now @yanpitangui

@yanpitangui
Copy link
Contributor Author

Thank you @Aaronontheweb and @Arkatufus, I will resume from here!

@yanpitangui
Copy link
Contributor Author

@Aaronontheweb, now, adding the internal accessor to the protobuf definition in the csproj, everything works fine. If I remove it, i will have to add the new types to the core api specs. Is that desirable?

@Aaronontheweb
Copy link
Member

@Aaronontheweb, now, adding the internal accessor to the protobuf definition in the csproj, everything works fine. If I remove it, i will have to add the new types to the core api specs. Is that desirable?

We should make the internal protobuf types all internal

@Aaronontheweb
Copy link
Member

@Aaronontheweb, now, adding the internal accessor to the protobuf definition in the csproj, everything works fine. If I remove it, i will have to add the new types to the core api specs. Is that desirable?

We should make the internal protobuf types all internal

And if that "breaks" a public API - the protobuf data types were never intended to be public in the first place, so this falls under our definition of "Practical SemVer"

@yanpitangui
Copy link
Contributor Author

Hmm... looks like this pr broke the tests? I will have to take a deeper look in what happened

@Aaronontheweb
Copy link
Member

@yanpitangui nah these are some racy tests - your code did not trigger those. We're even working on fixing some of them right now over on #7068

@yanpitangui
Copy link
Contributor Author

@yanpitangui nah these are some racy tests - your code did not trigger those. We're even working on fixing some of them right now over on #7068

Oh ok, I will mark it as ready to review, then

@yanpitangui yanpitangui marked this pull request as ready for review February 2, 2024 17:27
@Aaronontheweb Aaronontheweb self-assigned this Feb 16, 2024
@Aaronontheweb
Copy link
Member

I'm gonna get this merged in soon, fyi @yanpitangui

@yanpitangui
Copy link
Contributor Author

I'm gonna get this merged in soon, fyi @yanpitangui

Thank you. Should I resolve the conflicts or are you doing it?

@Aaronontheweb
Copy link
Member

Aaronontheweb commented Apr 19, 2024 via email

Copy link
Member

@Aaronontheweb Aaronontheweb left a comment

Choose a reason for hiding this comment

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

LGTM - nice work @yanpitangui

@Aaronontheweb Aaronontheweb merged commit a19b825 into akkadotnet:dev Apr 22, 2024
10 of 12 checks passed
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.

Build System: generate Protobuf C# objects automatically in MSBuild
2 participants