Skip to content

Build cleanup #431

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

Merged
merged 12 commits into from
Aug 5, 2025
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
8 changes: 5 additions & 3 deletions .github/actions/run-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ runs:
using: "composite"
steps:
- uses: actions/checkout@v4

- name: Install .NET Core
- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{inputs.dotnet-version}}
dotnet-version: |
9.0.x
${{inputs.dotnet-version}}
dotnet-quality: 'ga'

- name: Setup Environment variables and run Redis
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
fail-fast: false
matrix:
redis-version: [ '8.2-rc2-pre', '${{ needs.redis_version.outputs.CURRENT }}', '7.4.1', '7.2.6', '6.2.16']
dotnet-version: ['6.0', '7.0', '8.0']
dotnet-version: ['8.0', '9.0']
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
name: Redis ${{ matrix.redis-version }}; .NET ${{ matrix.dotnet-version }};
Expand Down
45 changes: 45 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<Project>
<PropertyGroup>
<Copyright>2022- Redis, inc.</Copyright>
<Nullable>enable</Nullable>
<LangVersion>13</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Authors>Redis Open Source</Authors>
<Owners>Redis OSS</Owners>
<Description>.Net Client for Redis Stack</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/redis/nRedisStack/</RepositoryUrl>
<PackageReleaseNotes>https://github.com/redis/NRedisStack/releases</PackageReleaseNotes>
<PackageProjectUrl>https://redis.io/docs/latest/develop/clients/dotnet/</PackageProjectUrl>
<Deterministic>false</Deterministic>
<DebugSymbols>true</DebugSymbols>
<DebugType>embedded</DebugType>
<DefaultLanguage>en-US</DefaultLanguage>
<IncludeSymbols>false</IncludeSymbols>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<CheckEolTargetFramework>false</CheckEolTargetFramework>
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
<SuppressTfmSupportBuildErrors>true</SuppressTfmSupportBuildErrors>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<IsWindows>$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::get_Windows())))</IsWindows>
</PropertyGroup>

<!-- release builds should be deterministic for packaging -->
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<Deterministic>true</Deterministic>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>
<ItemGroup Condition="'$(Configuration)' == 'Release' and '$(SourceRoot)'==''">
<SourceRoot Include="$(MSBuildThisFileDirectory)/"/>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" PrivateAssets="All" IncludeAssets="runtime; build; native; contentfiles; analyzers"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All"/>
<!--<PackageReference Include="Nerdbank.GitVersioning" PrivateAssets="all"/>-->
</ItemGroup>
</Project>
33 changes: 33 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<Project>
<ItemGroup>
<!-- core build -->
<PackageVersion Include="Microsoft.CSharp" Version="4.7.0" />
<PackageVersion Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
<PackageVersion Include="Nerdbank.GitVersioning" Version="3.7.115" />
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="4.14.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageVersion>
<!-- primary library -->
<PackageVersion Include="NetTopologySuite" Version="2.6.0" />
<PackageVersion Include="System.Text.Json" Version="9.0.7" />
<PackageVersion Include="StackExchange.Redis" Version="2.8.58" />
<!-- tests, etc -->
<PackageVersion Include="BouncyCastle.Cryptography" Version="2.6.1" />
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
<PackageVersion Include="coverlet.msbuild" Version="6.0.4" />
<PackageVersion Include="dotenv.net" Version="4.0.0" />
<PackageVersion Include="GitHubActionsTestLogger" Version="2.4.1" />
<PackageVersion Include="Microsoft.Azure.StackExchangeRedis" Version="3.2.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageVersion Include="Validation" Version="2.6.68" />
<PackageVersion Include="xunit" Version="2.9.3" />
<PackageVersion Include="xunit.assert" Version="2.9.3" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="Xunit.SkippableFact" Version="1.5.23" />
</ItemGroup>
</Project>
8 changes: 8 additions & 0 deletions NRedisStack.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NRedisStack.Tests", "tests\
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Doc", "tests\Doc\Doc.csproj", "{F14F6342-14A0-4DDD-AB05-C425B1AD8001}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{84D6210F-9A65-427A-965F-57E7B76424AB}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
Directory.Packages.props = Directory.Packages.props
global.json = global.json
version.json = version.json
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
7 changes: 7 additions & 0 deletions NRedisStack.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<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">
<s:Boolean x:Key="/Default/UserDictionary/Words/=geoshape/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=hnsw/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=indexempty/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=indexmissing/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=ismissing/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=vamana/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
Binary file added Redis.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/NRedisStack/Auxiliary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ internal static void SetInfoInPipeline(this IDatabase db)
{
_setInfo = false;
if (_libraryName == null) return;
Pipeline pipeline = new Pipeline(db);
_ = pipeline.Db.ClientSetInfoAsync(SetInfoAttr.LibraryName, _libraryName!);
Pipeline pipeline = new(db);
_ = pipeline.Db.ClientSetInfoAsync(SetInfoAttr.LibraryName, _libraryName);
_ = pipeline.Db.ClientSetInfoAsync(SetInfoAttr.LibraryVersion, GetNRedisStackVersion());
pipeline.Execute();
}
Expand Down
26 changes: 13 additions & 13 deletions src/NRedisStack/Bloom/BloomCommandBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ public static class BloomCommandBuilder
{
public static SerializedCommand Add(RedisKey key, RedisValue item)
{
return new SerializedCommand(BF.ADD, key, item);
return new(BF.ADD, key, item);
}

public static SerializedCommand Card(RedisKey key)
{
return new SerializedCommand(BF.CARD, key);
return new(BF.CARD, key);
}

public static SerializedCommand Exists(RedisKey key, RedisValue item)
{
return new SerializedCommand(BF.EXISTS, key, item);
return new(BF.EXISTS, key, item);
}

public static SerializedCommand Info(RedisKey key)
{
return new SerializedCommand(BF.INFO, key);
return new(BF.INFO, key);
}

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

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

return new SerializedCommand(BF.INSERT, args);
return new(BF.INSERT, args);
}

public static SerializedCommand LoadChunk(RedisKey key, long iterator, Byte[] data)
{
return new SerializedCommand(BF.LOADCHUNK, key, iterator, data);
return new(BF.LOADCHUNK, key, iterator, data);
}

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

List<object> args = new List<object> { key };
List<object> args = [key];
args.AddRange(items.Cast<object>());

return new SerializedCommand(BF.MADD, args);
return new(BF.MADD, args);
}

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

List<object> args = new List<object> { key };
List<object> args = [key];
args.AddRange(items.Cast<object>());

return new SerializedCommand(BF.MEXISTS, args);
return new(BF.MEXISTS, args);

}

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

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

return new SerializedCommand(BF.RESERVE, args);
return new(BF.RESERVE, args);
}

public static SerializedCommand ScanDump(RedisKey key, long iterator)
{
return new SerializedCommand(BF.SCANDUMP, key, iterator);
return new(BF.SCANDUMP, key, iterator);
}
}
39 changes: 19 additions & 20 deletions src/NRedisStack/Bloom/DataTypes/BloomInformation.cs
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
namespace NRedisStack.Bloom.DataTypes
namespace NRedisStack.Bloom.DataTypes;

/// <summary>
/// This class represents the response for BF.INFO command.
/// This object has Read-only properties and cannot be generated outside a BF.INFO response.
/// </summary>
public class BloomInformation
{
/// <summary>
/// This class represents the response for BF.INFO command.
/// This object has Read-only properties and cannot be generated outside a BF.INFO response.
/// </summary>
public class BloomInformation
{
public long Capacity { get; private set; }
public long Size { get; private set; }
public long NumberOfFilters { get; private set; }
public long NumberOfItemsInserted { get; private set; }
public long ExpansionRate { get; private set; }
public long Capacity { get; private set; }
public long Size { get; private set; }
public long NumberOfFilters { get; private set; }
public long NumberOfItemsInserted { get; private set; }
public long ExpansionRate { get; private set; }

internal BloomInformation(long capacity, long size, long numberOfFilters, long numberOfItemsInserted, long expansionRate)
{
Capacity = capacity;
Size = size;
NumberOfFilters = numberOfFilters;
NumberOfItemsInserted = numberOfItemsInserted;
ExpansionRate = expansionRate;
}
internal BloomInformation(long capacity, long size, long numberOfFilters, long numberOfItemsInserted, long expansionRate)
{
Capacity = capacity;
Size = size;
NumberOfFilters = numberOfFilters;
NumberOfItemsInserted = numberOfItemsInserted;
ExpansionRate = expansionRate;
}
}
19 changes: 9 additions & 10 deletions src/NRedisStack/Bloom/Literals/CommandArgs.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
namespace NRedisStack.Bloom.Literals
namespace NRedisStack.Bloom.Literals;

internal class BloomArgs
{
internal class BloomArgs
{
public const string CAPACITY = "CAPACITY";
public const string ERROR = "ERROR";
public const string EXPANSION = "EXPANSION";
public const string NOCREATE = "NOCREATE";
public const string NONSCALING = "NONSCALING";
public const string ITEMS = "ITEMS";
}
public const string CAPACITY = "CAPACITY";
public const string ERROR = "ERROR";
public const string EXPANSION = "EXPANSION";
public const string NOCREATE = "NOCREATE";
public const string NONSCALING = "NONSCALING";
public const string ITEMS = "ITEMS";
}
27 changes: 13 additions & 14 deletions src/NRedisStack/Bloom/Literals/Commands.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
namespace NRedisStack.Bloom.Literals
namespace NRedisStack.Bloom.Literals;

internal class BF
{
internal class BF
{
public const string ADD = "BF.ADD";
public const string CARD = "BF.CARD";
public const string EXISTS = "BF.EXISTS";
public const string INFO = "BF.INFO";
public const string INSERT = "BF.INSERT";
public const string LOADCHUNK = "BF.LOADCHUNK";
public const string MADD = "BF.MADD";
public const string MEXISTS = "BF.MEXISTS";
public const string RESERVE = "BF.RESERVE";
public const string SCANDUMP = "BF.SCANDUMP";
}
public const string ADD = "BF.ADD";
public const string CARD = "BF.CARD";
public const string EXISTS = "BF.EXISTS";
public const string INFO = "BF.INFO";
public const string INSERT = "BF.INSERT";
public const string LOADCHUNK = "BF.LOADCHUNK";
public const string MADD = "BF.MADD";
public const string MEXISTS = "BF.MEXISTS";
public const string RESERVE = "BF.RESERVE";
public const string SCANDUMP = "BF.SCANDUMP";
}
Loading
Loading