Skip to content

Commit 05abfff

Browse files
authored
Fixup build to clean state (#432)
* fix build errors * use redis.io as the project url * enable API change tracking * upgrade packages and finish cleaning output * more cleanup * be explicit about langver * CI: install SDK 9 * Update action.yml * preserve compilation context * re-enable VSTest for net6/net7 * Enable netfx build anywhere * drop net6/net7 CI (they're EOL); add net9; net8 is preserved as LTS * dotnet format * don't ref NetTopologySuite unnecessarily
1 parent 605672e commit 05abfff

File tree

196 files changed

+15145
-13983
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

196 files changed

+15145
-13983
lines changed

.github/actions/run-tests/action.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ runs:
2424
using: "composite"
2525
steps:
2626
- uses: actions/checkout@v4
27-
28-
- name: Install .NET Core
27+
28+
- name: Install .NET Core
2929
uses: actions/setup-dotnet@v4
3030
with:
31-
dotnet-version: ${{inputs.dotnet-version}}
31+
dotnet-version: |
32+
9.0.x
33+
${{inputs.dotnet-version}}
3234
dotnet-quality: 'ga'
3335

3436
- name: Setup Environment variables and run Redis

.github/workflows/integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
fail-fast: false
3939
matrix:
4040
redis-version: [ '8.0-RC2-pre', '${{ needs.redis_version.outputs.CURRENT }}', '7.2.6', '6.2.16']
41-
dotnet-version: ['6.0', '7.0', '8.0']
41+
dotnet-version: [ '8.0', '9.0']
4242
env:
4343
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
4444
name: Redis ${{ matrix.redis-version }}; .NET ${{ matrix.dotnet-version }};

Directory.Build.props

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<Copyright>2022- Redis, inc.</Copyright>
44
<Nullable>enable</Nullable>
5-
<LangVersion>latest</LangVersion>
5+
<LangVersion>13</LangVersion>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Authors>Redis Open Source</Authors>
88
<Owners>Redis OSS</Owners>
@@ -21,6 +21,7 @@
2121
<CheckEolTargetFramework>false</CheckEolTargetFramework>
2222
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
2323
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
24+
<SuppressTfmSupportBuildErrors>true</SuppressTfmSupportBuildErrors>
2425
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
2526
<NoWarn>$(NoWarn);CS1591</NoWarn>
2627
<IsWindows>$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::get_Windows())))</IsWindows>

Directory.Packages.props

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,33 @@
11
<Project>
2-
<ItemGroup>
3-
<!-- core build -->
4-
<PackageVersion Include="Microsoft.CSharp" Version="4.7.0"/>
5-
<PackageVersion Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3"/>
6-
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0"/>
7-
<PackageVersion Include="Nerdbank.GitVersioning" Version="3.7.115"/>
8-
9-
<!-- primary library -->
10-
<PackageVersion Include="NetTopologySuite" Version="2.5.0"/>
11-
<PackageVersion Include="System.Text.Json" Version="9.0.2"/>
12-
<PackageVersion Include="StackExchange.Redis" Version="2.8.24"/>
13-
14-
<!-- tests, etc -->
15-
<PackageVersion Include="BouncyCastle.Cryptography" Version="2.5.1"/>
16-
<PackageVersion Include="coverlet.collector" Version="6.0.4"/>
17-
<PackageVersion Include="coverlet.msbuild" Version="6.0.4"/>
18-
<PackageVersion Include="dotenv.net" Version="3.2.1"/>
19-
<PackageVersion Include="GitHubActionsTestLogger" Version="2.4.1"/>
20-
<PackageVersion Include="Microsoft.Azure.StackExchangeRedis" Version="3.1.0"/>
21-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0"/>
22-
<PackageVersion Include="Validation" Version="2.6.68"/>
23-
<PackageVersion Include="xunit" Version="2.9.3"/>
24-
<PackageVersion Include="xunit.assert" Version="2.9.3"/>
25-
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.2"/>
26-
<PackageVersion Include="Xunit.SkippableFact" Version="1.5.23"/>
27-
</ItemGroup>
2+
<ItemGroup>
3+
<!-- core build -->
4+
<PackageVersion Include="Microsoft.CSharp" Version="4.7.0" />
5+
<PackageVersion Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" />
6+
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
7+
<PackageVersion Include="Nerdbank.GitVersioning" Version="3.7.115" />
8+
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="4.14.0">
9+
<PrivateAssets>all</PrivateAssets>
10+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
11+
</PackageVersion>
12+
<!-- primary library -->
13+
<PackageVersion Include="NetTopologySuite" Version="2.6.0" />
14+
<PackageVersion Include="System.Text.Json" Version="9.0.7" />
15+
<PackageVersion Include="StackExchange.Redis" Version="2.8.58" />
16+
<!-- tests, etc -->
17+
<PackageVersion Include="BouncyCastle.Cryptography" Version="2.6.1" />
18+
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
19+
<PackageVersion Include="coverlet.msbuild" Version="6.0.4" />
20+
<PackageVersion Include="dotenv.net" Version="4.0.0" />
21+
<PackageVersion Include="GitHubActionsTestLogger" Version="2.4.1" />
22+
<PackageVersion Include="Microsoft.Azure.StackExchangeRedis" Version="3.2.1" />
23+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
24+
<PackageVersion Include="Validation" Version="2.6.68" />
25+
<PackageVersion Include="xunit" Version="2.9.3" />
26+
<PackageVersion Include="xunit.assert" Version="2.9.3" />
27+
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.3">
28+
<PrivateAssets>all</PrivateAssets>
29+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
30+
</PackageVersion>
31+
<PackageVersion Include="Xunit.SkippableFact" Version="1.5.23" />
32+
</ItemGroup>
2833
</Project>

src/NRedisStack/Auxiliary.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ internal static void SetInfoInPipeline(this IDatabase db)
5454
{
5555
_setInfo = false;
5656
if (_libraryName == null) return;
57-
Pipeline pipeline = new Pipeline(db);
58-
_ = pipeline.Db.ClientSetInfoAsync(SetInfoAttr.LibraryName, _libraryName!);
57+
Pipeline pipeline = new(db);
58+
_ = pipeline.Db.ClientSetInfoAsync(SetInfoAttr.LibraryName, _libraryName);
5959
_ = pipeline.Db.ClientSetInfoAsync(SetInfoAttr.LibraryVersion, GetNRedisStackVersion());
6060
pipeline.Execute();
6161
}

src/NRedisStack/Bloom/BloomCommandBuilder.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@ public static class BloomCommandBuilder
77
{
88
public static SerializedCommand Add(RedisKey key, RedisValue item)
99
{
10-
return new SerializedCommand(BF.ADD, key, item);
10+
return new(BF.ADD, key, item);
1111
}
1212

1313
public static SerializedCommand Card(RedisKey key)
1414
{
15-
return new SerializedCommand(BF.CARD, key);
15+
return new(BF.CARD, key);
1616
}
1717

1818
public static SerializedCommand Exists(RedisKey key, RedisValue item)
1919
{
20-
return new SerializedCommand(BF.EXISTS, key, item);
20+
return new(BF.EXISTS, key, item);
2121
}
2222

2323
public static SerializedCommand Info(RedisKey key)
2424
{
25-
return new SerializedCommand(BF.INFO, key);
25+
return new(BF.INFO, key);
2626
}
2727

2828
public static SerializedCommand Insert(RedisKey key, RedisValue[] items, int? capacity = null,
@@ -34,41 +34,41 @@ public static SerializedCommand Insert(RedisKey key, RedisValue[] items, int? ca
3434

3535
var args = BloomAux.BuildInsertArgs(key, items, capacity, error, expansion, nocreate, nonscaling);
3636

37-
return new SerializedCommand(BF.INSERT, args);
37+
return new(BF.INSERT, args);
3838
}
3939

4040
public static SerializedCommand LoadChunk(RedisKey key, long iterator, Byte[] data)
4141
{
42-
return new SerializedCommand(BF.LOADCHUNK, key, iterator, data);
42+
return new(BF.LOADCHUNK, key, iterator, data);
4343
}
4444

4545
public static SerializedCommand MAdd(RedisKey key, params RedisValue[] items)
4646
{
4747
if (items.Length < 1)
4848
throw new ArgumentOutOfRangeException(nameof(items));
4949

50-
List<object> args = new List<object> { key };
50+
List<object> args = [key];
5151
args.AddRange(items.Cast<object>());
5252

53-
return new SerializedCommand(BF.MADD, args);
53+
return new(BF.MADD, args);
5454
}
5555

5656
public static SerializedCommand MExists(RedisKey key, RedisValue[] items)
5757
{
5858
if (items.Length < 1)
5959
throw new ArgumentOutOfRangeException(nameof(items));
6060

61-
List<object> args = new List<object> { key };
61+
List<object> args = [key];
6262
args.AddRange(items.Cast<object>());
6363

64-
return new SerializedCommand(BF.MEXISTS, args);
64+
return new(BF.MEXISTS, args);
6565

6666
}
6767

6868
public static SerializedCommand Reserve(RedisKey key, double errorRate, long capacity,
6969
int? expansion = null, bool nonscaling = false)
7070
{
71-
List<object> args = new List<object> { key, errorRate, capacity };
71+
List<object> args = [key, errorRate, capacity];
7272

7373
if (expansion != null)
7474
{
@@ -80,11 +80,11 @@ public static SerializedCommand Reserve(RedisKey key, double errorRate, long cap
8080
args.Add(BloomArgs.NONSCALING);
8181
}
8282

83-
return new SerializedCommand(BF.RESERVE, args);
83+
return new(BF.RESERVE, args);
8484
}
8585

8686
public static SerializedCommand ScanDump(RedisKey key, long iterator)
8787
{
88-
return new SerializedCommand(BF.SCANDUMP, key, iterator);
88+
return new(BF.SCANDUMP, key, iterator);
8989
}
9090
}
Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
1-
namespace NRedisStack.Bloom.DataTypes
1+
namespace NRedisStack.Bloom.DataTypes;
2+
3+
/// <summary>
4+
/// This class represents the response for BF.INFO command.
5+
/// This object has Read-only properties and cannot be generated outside a BF.INFO response.
6+
/// </summary>
7+
public class BloomInformation
28
{
3-
/// <summary>
4-
/// This class represents the response for BF.INFO command.
5-
/// This object has Read-only properties and cannot be generated outside a BF.INFO response.
6-
/// </summary>
7-
public class BloomInformation
8-
{
9-
public long Capacity { get; private set; }
10-
public long Size { get; private set; }
11-
public long NumberOfFilters { get; private set; }
12-
public long NumberOfItemsInserted { get; private set; }
13-
public long ExpansionRate { get; private set; }
9+
public long Capacity { get; private set; }
10+
public long Size { get; private set; }
11+
public long NumberOfFilters { get; private set; }
12+
public long NumberOfItemsInserted { get; private set; }
13+
public long ExpansionRate { get; private set; }
1414

15-
internal BloomInformation(long capacity, long size, long numberOfFilters, long numberOfItemsInserted, long expansionRate)
16-
{
17-
Capacity = capacity;
18-
Size = size;
19-
NumberOfFilters = numberOfFilters;
20-
NumberOfItemsInserted = numberOfItemsInserted;
21-
ExpansionRate = expansionRate;
22-
}
15+
internal BloomInformation(long capacity, long size, long numberOfFilters, long numberOfItemsInserted, long expansionRate)
16+
{
17+
Capacity = capacity;
18+
Size = size;
19+
NumberOfFilters = numberOfFilters;
20+
NumberOfItemsInserted = numberOfItemsInserted;
21+
ExpansionRate = expansionRate;
2322
}
2423
}
Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
namespace NRedisStack.Bloom.Literals
1+
namespace NRedisStack.Bloom.Literals;
2+
3+
internal class BloomArgs
24
{
3-
internal class BloomArgs
4-
{
5-
public const string CAPACITY = "CAPACITY";
6-
public const string ERROR = "ERROR";
7-
public const string EXPANSION = "EXPANSION";
8-
public const string NOCREATE = "NOCREATE";
9-
public const string NONSCALING = "NONSCALING";
10-
public const string ITEMS = "ITEMS";
11-
}
5+
public const string CAPACITY = "CAPACITY";
6+
public const string ERROR = "ERROR";
7+
public const string EXPANSION = "EXPANSION";
8+
public const string NOCREATE = "NOCREATE";
9+
public const string NONSCALING = "NONSCALING";
10+
public const string ITEMS = "ITEMS";
1211
}
Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
namespace NRedisStack.Bloom.Literals
1+
namespace NRedisStack.Bloom.Literals;
2+
3+
internal class BF
24
{
3-
internal class BF
4-
{
5-
public const string ADD = "BF.ADD";
6-
public const string CARD = "BF.CARD";
7-
public const string EXISTS = "BF.EXISTS";
8-
public const string INFO = "BF.INFO";
9-
public const string INSERT = "BF.INSERT";
10-
public const string LOADCHUNK = "BF.LOADCHUNK";
11-
public const string MADD = "BF.MADD";
12-
public const string MEXISTS = "BF.MEXISTS";
13-
public const string RESERVE = "BF.RESERVE";
14-
public const string SCANDUMP = "BF.SCANDUMP";
15-
}
5+
public const string ADD = "BF.ADD";
6+
public const string CARD = "BF.CARD";
7+
public const string EXISTS = "BF.EXISTS";
8+
public const string INFO = "BF.INFO";
9+
public const string INSERT = "BF.INSERT";
10+
public const string LOADCHUNK = "BF.LOADCHUNK";
11+
public const string MADD = "BF.MADD";
12+
public const string MEXISTS = "BF.MEXISTS";
13+
public const string RESERVE = "BF.RESERVE";
14+
public const string SCANDUMP = "BF.SCANDUMP";
1615
}

0 commit comments

Comments
 (0)