Skip to content

Commit ca1ae5b

Browse files
authored
Build cleanup (#431)
Build cleanup: apply standard package rules, net9 build SDK, modern C# conventions, and API tracking
1 parent 31373dd commit ca1ae5b

File tree

200 files changed

+15806
-14450
lines changed

Some content is hidden

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

200 files changed

+15806
-14450
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.2-rc2-pre', '${{ needs.redis_version.outputs.CURRENT }}', '7.4.1', '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: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<Project>
2+
<PropertyGroup>
3+
<Copyright>2022- Redis, inc.</Copyright>
4+
<Nullable>enable</Nullable>
5+
<LangVersion>13</LangVersion>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Authors>Redis Open Source</Authors>
8+
<Owners>Redis OSS</Owners>
9+
<Description>.Net Client for Redis Stack</Description>
10+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
11+
<RepositoryType>git</RepositoryType>
12+
<RepositoryUrl>https://github.com/redis/nRedisStack/</RepositoryUrl>
13+
<PackageReleaseNotes>https://github.com/redis/NRedisStack/releases</PackageReleaseNotes>
14+
<PackageProjectUrl>https://redis.io/docs/latest/develop/clients/dotnet/</PackageProjectUrl>
15+
<Deterministic>false</Deterministic>
16+
<DebugSymbols>true</DebugSymbols>
17+
<DebugType>embedded</DebugType>
18+
<DefaultLanguage>en-US</DefaultLanguage>
19+
<IncludeSymbols>false</IncludeSymbols>
20+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
21+
<CheckEolTargetFramework>false</CheckEolTargetFramework>
22+
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
23+
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
24+
<SuppressTfmSupportBuildErrors>true</SuppressTfmSupportBuildErrors>
25+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
26+
<NoWarn>$(NoWarn);CS1591</NoWarn>
27+
<IsWindows>$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::get_Windows())))</IsWindows>
28+
</PropertyGroup>
29+
30+
<!-- release builds should be deterministic for packaging -->
31+
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
32+
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
33+
<Deterministic>true</Deterministic>
34+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
35+
</PropertyGroup>
36+
<ItemGroup Condition="'$(Configuration)' == 'Release' and '$(SourceRoot)'==''">
37+
<SourceRoot Include="$(MSBuildThisFileDirectory)/"/>
38+
</ItemGroup>
39+
40+
<ItemGroup>
41+
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" PrivateAssets="All" IncludeAssets="runtime; build; native; contentfiles; analyzers"/>
42+
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All"/>
43+
<!--<PackageReference Include="Nerdbank.GitVersioning" PrivateAssets="all"/>-->
44+
</ItemGroup>
45+
</Project>

Directory.Packages.props

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<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+
<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>
33+
</Project>

NRedisStack.sln

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NRedisStack.Tests", "tests\
99
EndProject
1010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Doc", "tests\Doc\Doc.csproj", "{F14F6342-14A0-4DDD-AB05-C425B1AD8001}"
1111
EndProject
12+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{84D6210F-9A65-427A-965F-57E7B76424AB}"
13+
ProjectSection(SolutionItems) = preProject
14+
Directory.Build.props = Directory.Build.props
15+
Directory.Packages.props = Directory.Packages.props
16+
global.json = global.json
17+
version.json = version.json
18+
EndProjectSection
19+
EndProject
1220
Global
1321
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1422
Debug|Any CPU = Debug|Any CPU

NRedisStack.sln.DotSettings

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2+
<s:Boolean x:Key="/Default/UserDictionary/Words/=geoshape/@EntryIndexedValue">True</s:Boolean>
3+
<s:Boolean x:Key="/Default/UserDictionary/Words/=hnsw/@EntryIndexedValue">True</s:Boolean>
4+
<s:Boolean x:Key="/Default/UserDictionary/Words/=indexempty/@EntryIndexedValue">True</s:Boolean>
5+
<s:Boolean x:Key="/Default/UserDictionary/Words/=indexmissing/@EntryIndexedValue">True</s:Boolean>
6+
<s:Boolean x:Key="/Default/UserDictionary/Words/=ismissing/@EntryIndexedValue">True</s:Boolean>
7+
<s:Boolean x:Key="/Default/UserDictionary/Words/=vamana/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

Redis.png

954 Bytes
Loading

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
}

0 commit comments

Comments
 (0)