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

Update dependencies, prior to a new release #298

Merged
merged 3 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion samples/HttpSend/HttpSend.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="3.1.0" />
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="4.1.1" />
Copy link
Contributor

Choose a reason for hiding this comment

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

Idle thought that doesn't require a reaction in this PR but maybe we benefit from introducing a Directory.Packages.props to the repo?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not something I'm familiar with - will add an issue to remind me to look into it :)

<ProjectReference Include="..\..\src\CloudNative.CloudEvents\CloudNative.CloudEvents.csproj" />
<ProjectReference Include="..\..\src\CloudNative.CloudEvents.NewtonsoftJson\CloudNative.CloudEvents.NewtonsoftJson.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AMQPNetLite" Version="2.4.2" />
<PackageReference Include="AMQPNetLite.Serialization" Version="2.4.2" />
<PackageReference Include="AMQPNetLite" Version="2.4.11" />
<PackageReference Include="AMQPNetLite.Serialization" Version="2.4.11" />
<ProjectReference Include="..\CloudNative.CloudEvents\CloudNative.CloudEvents.csproj" />
<!-- Source-only package with nullable reference annotations. -->
<PackageReference Include="Nullable" Version="1.3.1" PrivateAssets="All" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'netstandard2.0' and '$(TargetFramework)' != 'netstandard2.1'">
<FrameworkReference Include="Microsoft.AspNetCore.App"/>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netstandard2.1'">
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.1.34" />
<PackageReference Include="System.Text.Encodings.Web" Version="6.0.0" />
<PackageReference Include="System.Text.Encodings.Web" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Apache.Avro" Version="1.11.1" />
<PackageReference Include="Apache.Avro" Version="1.11.3" />
<!--
- Explicit dependency just to avoid a vulnerable version being exposed via Apache.Avro.
- If Apache.Avro publishes a new version that updates the dependency (to 13.0.1 or higher)
- we can remove our explicit dependency.
-->
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<ProjectReference Include="..\CloudNative.CloudEvents\CloudNative.CloudEvents.csproj" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Confluent.Kafka" Version="1.6.3" />
<PackageReference Include="Confluent.Kafka" Version="1.9.3" />
<ProjectReference Include="..\CloudNative.CloudEvents\CloudNative.CloudEvents.csproj" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<ProjectReference Include="..\CloudNative.CloudEvents\CloudNative.CloudEvents.csproj" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Google.Protobuf" Version="3.22.0" />
<PackageReference Include="Google.Protobuf" Version="3.27.3" />

<!-- Be explicit about not including these files in the package. -->
<None Include="README.md" />
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<!-- Use SourceLink for all production projects, and include the licence file -->
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
<None Include="$(RepoRoot)/LICENSE" Pack="true" PackagePath="" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.14" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.32" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Cloud Native Foundation.
// Copyright 2021 Cloud Native Foundation.
// Licensed under the Apache 2.0 license.
// See LICENSE file in the project root for full license information.

Expand All @@ -13,7 +13,7 @@ public class CloudEventsSpecVersionTest
[InlineData(null)]
[InlineData("bogus")]
[InlineData("1")]
public void FromVersionId_Unknown(string versionId) =>
public void FromVersionId_Unknown(string? versionId) =>
Assert.Null(CloudEventsSpecVersion.FromVersionId(versionId));

[Theory]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@

<ItemGroup>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.console" Version="2.4.2">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.console" Version="2.9.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Cloud Native Foundation.
// Copyright 2021 Cloud Native Foundation.
// Licensed under the Apache 2.0 license.
// See LICENSE file in the project root for full license information.

Expand Down Expand Up @@ -73,7 +73,7 @@ public void ContentTypeGetEncoding_NoCharSet()
[Theory]
[InlineData(null)]
[InlineData("text/plain")]
public void CreateContentTypeOrNull_WithContentType(string text)
public void CreateContentTypeOrNull_WithContentType(string? text)
{
ContentType? ct = MimeUtilities.CreateContentTypeOrNull(text);
Assert.Equal(text, ct?.ToString());
Expand All @@ -88,7 +88,7 @@ public void CreateContentTypeOrNull_WithContentType(string text)
[InlineData("application/cloudeventstrailing", true)]
[InlineData("application/cloudevents-batch", false)]
[InlineData("application/cloudevents-batch+json", false)]
public void IsCloudEventsContentType(string contentType, bool expectedResult) =>
public void IsCloudEventsContentType(string? contentType, bool expectedResult) =>
Assert.Equal(expectedResult, MimeUtilities.IsCloudEventsContentType(contentType));

[Theory]
Expand All @@ -101,7 +101,7 @@ public void IsCloudEventsContentType(string contentType, bool expectedResult) =>
// It's not entirely clear that this *should* be true...
[InlineData("application/cloudevents-batchtrailing", true)]
[InlineData("application/cloudevents-batch+json", true)]
public void IsCloudEventsBatchContentType(string contentType, bool expectedResult) =>
public void IsCloudEventsBatchContentType(string? contentType, bool expectedResult) =>
Assert.Equal(expectedResult, MimeUtilities.IsCloudEventsBatchContentType(contentType));
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Cloud Native Foundation.
// Copyright 2021 Cloud Native Foundation.
// Licensed under the Apache 2.0 license.
// See LICENSE file in the project root for full license information.

Expand Down Expand Up @@ -291,7 +291,7 @@ public async Task HttpBinaryClientSendTest()
var result = await httpClient.PostAsync(new Uri(ListenerAddress + "ep"), content);
if (result.StatusCode != HttpStatusCode.NoContent)
{
throw new InvalidOperationException(result.Content.ReadAsStringAsync().GetAwaiter().GetResult());
throw new InvalidOperationException(await result.Content.ReadAsStringAsync());
}
}

Expand Down Expand Up @@ -392,7 +392,7 @@ public async Task HttpStructuredClientSendTest()
var result = (await httpClient.PostAsync(new Uri(ListenerAddress + "ep"), content));
if (result.StatusCode != HttpStatusCode.NoContent)
{
throw new InvalidOperationException(result.Content.ReadAsStringAsync().GetAwaiter().GetResult());
throw new InvalidOperationException(await result.Content.ReadAsStringAsync());
}
}

Expand Down
8 changes: 4 additions & 4 deletions test/CloudNative.CloudEvents.UnitTests/Kafka/KafkaTest.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Cloud Native Foundation.
// Copyright (c) Cloud Native Foundation.
// Licensed under the Apache 2.0 license.
// See LICENSE file in the project root for full license information.

Expand Down Expand Up @@ -132,10 +132,10 @@ public void KafkaBinaryMessageTest()
[Theory]
[InlineData(MediaTypeNames.Application.Octet, new byte[0])]
[InlineData(MediaTypeNames.Application.Json, null)]
[InlineData(MediaTypeNames.Application.Xml, "")]
[InlineData(MediaTypeNames.Application.Xml, new byte[0])]
[InlineData(MediaTypeNames.Text.Plain, "")]
[InlineData(null, null)]
public void KafkaBinaryMessageTombstoneTest(string contentType, object? expectedDecodedResult)
public void KafkaBinaryMessageTombstoneTest(string? contentType, object? expectedDecodedResult)
{
var jsonEventFormatter = new JsonEventFormatter();
var cloudEvent = new CloudEvent(Partitioning.AllAttributes)
Expand Down Expand Up @@ -253,4 +253,4 @@ public override void WriteJson(JsonWriter writer, object? value, JsonSerializer
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ public void DecodeStructuredModeMessage_Null()
[InlineData("application/json")]
[InlineData("text/plain")]
[InlineData("application/binary")]
public void DecodeStructuredModeMessage_NoData(string contentType)
public void DecodeStructuredModeMessage_NoData(string? contentType)
{
var obj = CreateMinimalValidJObject();
if (contentType is object)
Expand Down Expand Up @@ -740,7 +740,7 @@ public void DecodeStructuredModeMessage_DataBase64NonString()
[InlineData("application/json")]
[InlineData("text/plain")]
[InlineData("application/binary")]
public void DecodeStructuredModeMessage_Base64(string contentType)
public void DecodeStructuredModeMessage_Base64(string? contentType)
{
var obj = CreateMinimalValidJObject();
if (contentType is object)
Expand Down Expand Up @@ -768,7 +768,7 @@ public void DecodeStructuredModeMessage_NonJsonContentType_JsonStringToken(strin
[InlineData(null)]
[InlineData("application/json")]
[InlineData("application/json; charset=utf-8")]
public void DecodeStructuredModeMessage_JsonContentType_JsonStringToken(string contentType)
public void DecodeStructuredModeMessage_JsonContentType_JsonStringToken(string? contentType)
{
var obj = CreateMinimalValidJObject();
if (contentType is object)
Expand All @@ -787,7 +787,7 @@ public void DecodeStructuredModeMessage_JsonContentType_JsonStringToken(string c
[InlineData("application/json")]
[InlineData("application/xyz+json")]
[InlineData("application/xyz+json; charset=utf-8")]
public void DecodeStructuredModeMessage_JsonContentType_NonStringValue(string contentType)
public void DecodeStructuredModeMessage_JsonContentType_NonStringValue(string? contentType)
{
var obj = CreateMinimalValidJObject();
if (contentType is object)
Expand Down Expand Up @@ -1215,4 +1215,4 @@ private static IReadOnlyList<CloudEvent> DecodeBatchModeMessage(JArray array)
return formatter.DecodeBatchModeMessage(bytes, s_jsonCloudEventContentType, null);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Cloud Native Foundation.
// Copyright 2022 Cloud Native Foundation.
// Licensed under the Apache 2.0 license.
// See LICENSE file in the project root for full license information.

Expand Down Expand Up @@ -201,7 +201,7 @@ public void EncodeBinaryModeData_Bytes()
[InlineData("utf-8")]
[InlineData("iso-8859-1")]
[InlineData(null)]
public void EncodeBinaryModeData_String_TextContentType(string charset)
public void EncodeBinaryModeData_String_TextContentType(string? charset)
{
string text = "caf\u00e9"; // Valid in both UTF-8 and ISO-8859-1, but with different representations
var encoding = charset is null ? Encoding.UTF8 : Encoding.GetEncoding(charset);
Expand Down Expand Up @@ -552,7 +552,7 @@ public void ConvertFromProto_Invalid_NoSource()
[InlineData("utf-8")]
[InlineData("iso-8859-1")]
[InlineData(null)]
public void DecodeBinaryModeEventData_Text(string charset)
public void DecodeBinaryModeEventData_Text(string? charset)
{
string text = "caf\u00e9"; // Valid in both UTF-8 and ISO-8859-1, but with different representations
var encoding = charset is null ? Encoding.UTF8 : Encoding.GetEncoding(charset);
Expand All @@ -566,7 +566,7 @@ public void DecodeBinaryModeEventData_Text(string charset)
[Theory]
[InlineData("application/json")]
[InlineData(null)]
public void DecodeBinaryModeData_NonTextContentType(string contentType)
public void DecodeBinaryModeData_NonTextContentType(string? contentType)
{
var bytes = Encoding.UTF8.GetBytes("{}");
var data = DecodeBinaryModeEventData(bytes, contentType);
Expand Down Expand Up @@ -670,7 +670,7 @@ public void DecodeBatchMode_Multiple()

// Utility methods

private static object? DecodeBinaryModeEventData(byte[] bytes, string contentType)
private static object? DecodeBinaryModeEventData(byte[] bytes, string? contentType)
{
var cloudEvent = new CloudEvent().PopulateRequiredAttributes();
cloudEvent.DataContentType = contentType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ public void DecodeStructuredModeMessage_Null()
[InlineData("application/json")]
[InlineData("text/plain")]
[InlineData("application/binary")]
public void DecodeStructuredModeMessage_NoData(string contentType)
public void DecodeStructuredModeMessage_NoData(string? contentType)
{
var obj = CreateMinimalValidJObject();
if (contentType is object)
Expand Down Expand Up @@ -760,7 +760,7 @@ public void DecodeStructuredModeMessage_DataBase64NonString()
[InlineData("application/json")]
[InlineData("text/plain")]
[InlineData("application/binary")]
public void DecodeStructuredModeMessage_Base64(string contentType)
public void DecodeStructuredModeMessage_Base64(string? contentType)
{
var obj = CreateMinimalValidJObject();
if (contentType is object)
Expand Down Expand Up @@ -788,7 +788,7 @@ public void DecodeStructuredModeMessage_NonJsonContentType_JsonStringToken(strin
[InlineData(null)]
[InlineData("application/json")]
[InlineData("application/json; charset=utf-8")]
public void DecodeStructuredModeMessage_JsonContentType_JsonStringToken(string contentType)
public void DecodeStructuredModeMessage_JsonContentType_JsonStringToken(string? contentType)
{
var obj = CreateMinimalValidJObject();
if (contentType is object)
Expand All @@ -807,7 +807,7 @@ public void DecodeStructuredModeMessage_JsonContentType_JsonStringToken(string c
[InlineData("application/json")]
[InlineData("application/xyz+json")]
[InlineData("application/xyz+json; charset=utf-8")]
public void DecodeStructuredModeMessage_JsonContentType_NonStringValue(string contentType)
public void DecodeStructuredModeMessage_JsonContentType_NonStringValue(string? contentType)
{
var obj = CreateMinimalValidJObject();
if (contentType is object)
Expand Down Expand Up @@ -1227,4 +1227,4 @@ public override void Write(Utf8JsonWriter writer, DateTime value, JsonSerializer
writer.WriteStringValue(value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture));
}
}
}
}
4 changes: 2 additions & 2 deletions test/CloudNative.CloudEvents.UnitTests/TestHelpers.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Cloud Native Foundation.
// Copyright 2021 Cloud Native Foundation.
// Licensed under the Apache 2.0 license.
// See LICENSE file in the project root for full license information.

Expand Down Expand Up @@ -153,7 +153,7 @@ internal static void AssertTimestampsEqual(DateTimeOffset? expected, DateTimeOff
}
if (expected is null || actual is null)
{
Assert.True(false, "Expected both values to be null, or neither to be null");
Assert.Fail("Expected both values to be null, or neither to be null");
}
AssertTimestampsEqual(expected!.Value, actual!.Value);
}
Expand Down
2 changes: 1 addition & 1 deletion test/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<!-- Use SourceLink for all production projects, and include the licence file -->
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
<None Include="$(RepoRoot)/LICENSE" Pack="true" PackagePath="" />
</ItemGroup>
</Project>
Loading