Skip to content

Commit

Permalink
Bump Google.Protobuf from 3.27.3 to 3.28.0 in /src/net (#277)
Browse files Browse the repository at this point in the history
* Bump Google.Protobuf from 3.27.3 to 3.28.0 in /src/net

Bumps [Google.Protobuf](https://github.com/protocolbuffers/protobuf) from 3.27.3 to 3.28.0.
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf/blob/main/protobuf_release.bzl)
- [Commits](protocolbuffers/protobuf@v3.27.3...v3.28.0)

---
updated-dependencies:
- dependency-name: Google.Protobuf
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Update Google Protobuf Tools

* Update configuration management

* Conversion fix

* Test multiple serializations

* Added missing concurrency

* Manage serialization in tests

* Update framework version

* Update dependencies

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: masesdevelopers <[email protected]>
  • Loading branch information
dependabot[bot] and masesdevelopers authored Sep 20, 2024
1 parent dd5e83c commit 9073cc8
Show file tree
Hide file tree
Showing 6 changed files with 344 additions and 65 deletions.
343 changes: 297 additions & 46 deletions .github/workflows/build.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="MASES.KNet.Serialization.Avro" Version="2.8.0" />
<PackageReference Include="MASES.KNet.Serialization.Avro" Version="2.8.1" />
</ItemGroup>

<ItemGroup>
<None Update="AvroValueContainer.avsc">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@

<ItemGroup>
<ProjectReference Include="..\KEFCore.SerDes\KEFCore.SerDes.csproj" />
<PackageReference Include="Google.Protobuf" Version="3.27.3" />
<PackageReference Include="Google.Protobuf.Tools" Version="3.27.3">
<PackageReference Include="Google.Protobuf" Version="3.28.2" />
<PackageReference Include="Google.Protobuf.Tools" Version="3.28.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion src/net/KEFCore.SerDes.Protobuf/ProtobufKEFCoreSerDes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static class ProtobufKEFCoreSerDes
/// <summary>
/// Base class to define key extensions of <see cref="ISerDesSelector{T}"/>, for example <see href="https://masesgroup.github.io/KNet/articles/usageSerDes.html"/>
/// </summary>
public class Key<T> : ISerDesSelector<T> where T : class, IMessage<T>
public class Key<T> : ISerDesSelector<T>
{
/// <summary>
/// Returns a new instance of <see cref="Key{T}"/>
Expand Down
4 changes: 2 additions & 2 deletions src/net/KEFCore.SerDes/KEFCore.SerDes.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.8" PrivateAssets="none" Condition="'$(TargetFramework)' == 'net6.0'" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.8" PrivateAssets="none" Condition="'$(TargetFramework)' == 'net7.0'" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.33" PrivateAssets="none" Condition="'$(TargetFramework)' == 'net6.0'" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.20" PrivateAssets="none" Condition="'$(TargetFramework)' == 'net7.0'" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.8" PrivateAssets="none" Condition="'$(TargetFramework)' == 'net8.0'" />
<PackageReference Include="MASES.KNet" Version="2.8.1">
<IncludeAssets>All</IncludeAssets>
Expand Down
49 changes: 41 additions & 8 deletions test/Common/ProgramConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,17 @@
using System.Text.Json;
using Java.Lang;
using Java.Util.Concurrent;
using System.Collections.Generic;
using System.Reflection;

namespace MASES.EntityFrameworkCore.KNet.Test.Common
{
public class ProgramConfig
{
public bool UseJson { get; set; } = false;
public bool UseProtobuf { get; set; } = false;
public bool UseAvro { get; set; } = false;
public bool UseAvroBinary { get; set; } = false;
public bool UseAvroBinary { get; set; } = true;
public bool EnableKEFCoreTracing { get; set; } = false;
public bool UseInMemoryProvider { get; set; } = false;
public bool UseModelBuilder { get; set; } = false;
Expand Down Expand Up @@ -84,7 +87,10 @@ public void ApplyOnContext(KafkaDbContext context)
context.UseEnumeratorWithPrefetch = UseEnumeratorWithPrefetch;
context.UseByteBufferDataTransfer = UseByteBufferDataTransfer;

if (UseProtobuf)
if (UseJson)
{ // default
}
else if (UseProtobuf)
{
context.KeySerDesSelectorType = typeof(ProtobufKEFCoreSerDes.Key<>);
context.ValueContainerType = typeof(ProtobufValueContainer<>);
Expand All @@ -104,19 +110,46 @@ public void ApplyOnContext(KafkaDbContext context)

public static void LoadConfig(string[] args)
{
if (args.Length > 0)
const string FileFormat = "/f:";
const string PropertyFormat = "/p:";

Dictionary<PropertyInfo, object> properties = new Dictionary<PropertyInfo, object>();
var props = typeof(ProgramConfig).GetProperties();
string file = null;
foreach (var arg in args)
{
if (arg.StartsWith(FileFormat))
{
file = arg[FileFormat.Length..];
if (!File.Exists(file)) { throw new FileNotFoundException($"{file} is not a configuration file.", file); }
}
else if (arg.StartsWith(PropertyFormat))
{
var argVal = arg[FileFormat.Length..];
var values = argVal.Split('=');
foreach (var prop in props)
{
if (prop.Name == values[0])
{
properties.Add(prop, Convert.ChangeType(values[1], prop.PropertyType));
}
}
}
else if (File.Exists(arg)) file = arg;
}

if (!string.IsNullOrWhiteSpace(file))
{
if (!File.Exists(args[0])) { throw new FileNotFoundException($"{args[0]} is not a configuration file.", args[0]); }
Config = JsonSerializer.Deserialize<ProgramConfig>(File.ReadAllText(args[0]));
Config = JsonSerializer.Deserialize<ProgramConfig>(File.ReadAllText(file));
}
else Config = new();

if (args.Length > 1)
foreach (var property in properties)
{
Config.BootstrapServers = args[1];
property.Key.SetValue(Config, property.Value);
}

ReportString(JsonSerializer.Serialize<ProgramConfig>(Config, new JsonSerializerOptions() { WriteIndented = true }));
ReportString(JsonSerializer.Serialize(Config, new JsonSerializerOptions() { WriteIndented = true }));

if (!KafkaDbContext.EnableKEFCoreTracing) KafkaDbContext.EnableKEFCoreTracing = Config.EnableKEFCoreTracing;

Expand Down

0 comments on commit 9073cc8

Please sign in to comment.