Skip to content

Commit

Permalink
NuGet Audit fix - testing application - part 2 (#3716)
Browse files Browse the repository at this point in the history
  • Loading branch information
ysolomchenko authored Oct 21, 2024
1 parent d0ae641 commit 315758d
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 34 deletions.
7 changes: 2 additions & 5 deletions build/LibraryVersions.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ public static partial class LibraryVersion
"TestApplication.Elasticsearch",
new List<PackageBuildInfo>
{
new("8.0.0"),
new("8.10.0"),
new("8.15.6"),
new("8.15.10"),
}
},
{
Expand Down Expand Up @@ -69,8 +67,7 @@ public static partial class LibraryVersion
"TestApplication.MassTransit",
new List<PackageBuildInfo>
{
new("8.0.0"),
new("8.2.5"),
new("8.3.0"),
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions test/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Import Project="..\Directory.Packages.props" />
<ItemGroup>
<PackageVersion Include="Azure.Storage.Blobs" Version="12.22.2" />
<PackageVersion Include="Elastic.Clients.Elasticsearch" Version="8.15.6" />
<PackageVersion Include="Elastic.Clients.Elasticsearch" Version="8.15.10" />
<PackageVersion Include="Confluent.Kafka" Version="2.5.3" />
<PackageVersion Include="FluentAssertions" Version="6.12.1" />
<PackageVersion Include="Google.Protobuf" Version="3.28.2" />
Expand All @@ -14,7 +14,7 @@
<PackageVersion Include="Grpc.Net.Client" Version="2.66.0" />
<PackageVersion Include="Grpc.Net.Client.Web" Version="2.65.0" />
<PackageVersion Include="Grpc.Tools" Version="2.67.0" />
<PackageVersion Include="MassTransit" Version="8.2.5" />
<PackageVersion Include="MassTransit" Version="8.3.0" />
<PackageVersion Include="Microsoft.AspNetCore.SignalR.Client" Version="8.0.8" />
<PackageVersion Include="Microsoft.Build" Version="15.9.20" />
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="15.9.20" />
Expand Down
7 changes: 2 additions & 5 deletions test/IntegrationTests/LibraryVersions.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ public static TheoryData<string> Elasticsearch
#if DEFAULT_TEST_PACKAGE_VERSIONS
theoryData.Add(string.Empty);
#else
theoryData.Add("8.0.0");
theoryData.Add("8.10.0");
theoryData.Add("8.15.6");
theoryData.Add("8.15.10");
#endif
return theoryData;
}
Expand Down Expand Up @@ -113,8 +111,7 @@ public static TheoryData<string> MassTransit
#if DEFAULT_TEST_PACKAGE_VERSIONS
theoryData.Add(string.Empty);
#else
theoryData.Add("8.0.0");
theoryData.Add("8.2.5");
theoryData.Add("8.3.0");
#endif
return theoryData;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,7 @@
try
{
await client.SearchAsync<TestObject>(s =>
#if ELASTICSEARCH_CLIENT_8_13_OR_GREATER
s.Index("test-index").From(0).Size(10).Query(q => q.Term(t => t.Field(to => to.Id))));

#else
s.Index("test-index").From(0).Size(10).Query(q => q.Term(t => t.Id, 1)));
#endif
}
catch (UnexpectedTransportException)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<DefineConstants Condition="'$(LibraryVersion)' == '' or '$(LibraryVersion)'>='8.13.0'">$(DefineConstants);ELASTICSEARCH_CLIENT_8_13_OR_GREATER</DefineConstants>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Elastic.Clients.Elasticsearch" VersionOverride="$(LibraryVersion)" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,9 @@

namespace TestApplication.MassTransit.Consumers;

public class TestConsumerDefinition :
ConsumerDefinition<TestConsumer>
public class TestConsumerDefinition : ConsumerDefinition<TestConsumer>
{
#if MASSTRANSIT_8_1_OR_GREATER
protected override void ConfigureConsumer(IReceiveEndpointConfigurator endpointConfigurator, IConsumerConfigurator<TestConsumer> consumerConfigurator, IRegistrationContext context)
#else
protected override void ConfigureConsumer(IReceiveEndpointConfigurator endpointConfigurator, IConsumerConfigurator<TestConsumer> consumerConfigurator)
#endif
{
endpointConfigurator.UseMessageRetry(r => r.Intervals(500, 1000));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk.Worker">

<PropertyGroup>
<DefineConstants Condition="'$(LibraryVersion)' == '' or '$(LibraryVersion)'>='8.1.0'">$(DefineConstants);MASSTRANSIT_8_1_OR_GREATER</DefineConstants>
</PropertyGroup>


<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" />
<PackageReference Include="MassTransit" VersionOverride="$(LibraryVersion)" />
</ItemGroup>

</Project>
11 changes: 9 additions & 2 deletions tools/LibraryVersionsGenerator/PackageVersionDefinitions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,13 @@ internal static class PackageVersionDefinitions
TestApplicationName = "TestApplication.Elasticsearch",
Versions = new List<PackageVersion>
{
/*
new("8.0.0"),
new("8.10.0"), // 8.10.0 introduces breaking change for ActivitySource name
new("8.10.0"),
all lower versions than 8.15.10 contains references impacted by
https://github.com/advisories/GHSA-8g4q-xg66-9fp4
*/
new("8.15.10"),
new("*")
}
},
Expand Down Expand Up @@ -89,7 +94,9 @@ internal static class PackageVersionDefinitions
TestApplicationName = "TestApplication.MassTransit",
Versions = new List<PackageVersion>
{
new("8.0.0"),
// new("8.0.0"), // all lower versions than 8.3.0 contains references impacted by
// https://github.com/advisories/GHSA-8g4q-xg66-9fp4
new("8.3.0"),
new("*")
}
},
Expand Down

0 comments on commit 315758d

Please sign in to comment.