Skip to content

Commit 3b62a1d

Browse files
committed
Flag [SER006]; remove [SER001]
1 parent b86557f commit 3b62a1d

26 files changed

Lines changed: 144 additions & 181 deletions

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1111
<CodeAnalysisRuleset>$(MSBuildThisFileDirectory)Shared.ruleset</CodeAnalysisRuleset>
1212
<MSBuildWarningsAsMessages>NETSDK1069</MSBuildWarningsAsMessages>
13-
<NoWarn>$(NoWarn);NU5105;NU1507;SER001;SER002;SER003;SER004;SER005</NoWarn>
13+
<NoWarn>$(NoWarn);NU5105;NU1507;SER001;SER002;SER003;SER004;SER005;SER006</NoWarn>
1414
<PackageReleaseNotes>https://stackexchange.github.io/StackExchange.Redis/ReleaseNotes</PackageReleaseNotes>
1515
<PackageProjectUrl>https://stackexchange.github.io/StackExchange.Redis/</PackageProjectUrl>
1616
<PackageLicenseExpression>MIT</PackageLicenseExpression>

docs/exp/SER006.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Redis 8.8 is currently in preview and may be subject to change.
2+
3+
New features in Redis 8.8:
4+
5+
- `GCRA` for rate-limiting
6+
7+
The corresponding library feature must also be considered subject to change:
8+
9+
1. Existing bindings may cease working correctly if the underlying server API changes.
10+
2. Changes to the server API may require changes to the library API, manifesting in either/both of build-time
11+
or run-time breaks.
12+
13+
While this seems *unlikely*, it must be considered a possibility. If you acknowledge this, you can suppress
14+
this warning by adding the following to your `csproj` file:
15+
16+
```xml
17+
<NoWarn>$(NoWarn);SER006</NoWarn>
18+
```
19+
20+
or more granularly / locally in C#:
21+
22+
``` c#
23+
#pragma warning disable SER006
24+
```

src/RESPite/Shared/Experiments.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ internal static class Experiments
88
public const string UrlFormat = "https://stackexchange.github.io/StackExchange.Redis/exp/";
99

1010
// ReSharper disable InconsistentNaming
11-
public const string VectorSets = "SER001";
1211
public const string Server_8_4 = "SER002";
1312
public const string Server_8_6 = "SER003";
1413
public const string Respite = "SER004";
1514
public const string UnitTesting = "SER005";
15+
public const string Server_8_8 = "SER006";
1616
// ReSharper restore InconsistentNaming
1717
}
1818
}

src/StackExchange.Redis/ChannelMessageQueue.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using System.Buffers.Text;
32
using System.Collections.Generic;
43
using System.Threading;
54
using System.Threading.Channels;

src/StackExchange.Redis/ExtensionMethods.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
using System.Threading;
1111
using System.Threading.Tasks;
1212
using Pipelines.Sockets.Unofficial.Arenas;
13+
using RESPite;
1314

1415
namespace StackExchange.Redis
1516
{
@@ -352,6 +353,7 @@ internal static int VectorSafeIndexOfCRLF(this ReadOnlySpan<byte> span)
352353
/// <param name="flags">The command flags to use.</param>
353354
/// <param name="cancellationToken">The cancellation token.</param>
354355
/// <returns>True if the token was acquired within the allowed time; false otherwise.</returns>
356+
[Experimental(Experiments.Server_8_8, UrlFormat = Experiments.UrlFormat)]
355357
public static async ValueTask<bool> TryAcquireGcraAsync(
356358
this IDatabaseAsync database,
357359
RedisKey key,

src/StackExchange.Redis/Gcra.GcraRateLimitResult.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
using System.Diagnostics.CodeAnalysis;
2+
using RESPite;
3+
14
namespace StackExchange.Redis;
25

36
/// <summary>
47
/// Represents the result of a GCRA (Generic Cell Rate Algorithm) rate limit check.
58
/// </summary>
9+
[Experimental(Experiments.Server_8_8, UrlFormat = Experiments.UrlFormat)]
610
public readonly partial struct GcraRateLimitResult
711
{
812
/// <summary>

src/StackExchange.Redis/HotKeys.StartMessage.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using System.Threading.Tasks;
32

43
namespace StackExchange.Redis;
54

src/StackExchange.Redis/Interfaces/IDatabase.VectorSets.cs

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System;
2-
using System.Diagnostics.CodeAnalysis;
3-
using RESPite;
1+
using System.Diagnostics.CodeAnalysis;
42

53
// ReSharper disable once CheckNamespace
64
namespace StackExchange.Redis;
@@ -20,7 +18,6 @@ public partial interface IDatabase
2018
/// <param name="flags">The flags to use for this operation.</param>
2119
/// <returns><see langword="true"/> if the element was added; <see langword="false"/> if it already existed.</returns>
2220
/// <remarks><seealso href="https://redis.io/commands/vadd"/></remarks>
23-
[Experimental(Experiments.VectorSets, UrlFormat = Experiments.UrlFormat)]
2421
bool VectorSetAdd(
2522
RedisKey key,
2623
VectorSetAddRequest request,
@@ -33,7 +30,6 @@ bool VectorSetAdd(
3330
/// <param name="flags">The flags to use for this operation.</param>
3431
/// <returns>The cardinality of the vectorset.</returns>
3532
/// <remarks><seealso href="https://redis.io/commands/vcard"/></remarks>
36-
[Experimental(Experiments.VectorSets, UrlFormat = Experiments.UrlFormat)]
3733
long VectorSetLength(RedisKey key, CommandFlags flags = CommandFlags.None);
3834

3935
/// <summary>
@@ -43,7 +39,6 @@ bool VectorSetAdd(
4339
/// <param name="flags">The flags to use for this operation.</param>
4440
/// <returns>The dimension of vectors in the vectorset.</returns>
4541
/// <remarks><seealso href="https://redis.io/commands/vdim"/></remarks>
46-
[Experimental(Experiments.VectorSets, UrlFormat = Experiments.UrlFormat)]
4742
int VectorSetDimension(RedisKey key, CommandFlags flags = CommandFlags.None);
4843

4944
/// <summary>
@@ -54,7 +49,6 @@ bool VectorSetAdd(
5449
/// <param name="flags">The flags to use for this operation.</param>
5550
/// <returns>The vector as a pooled memory lease.</returns>
5651
/// <remarks><seealso href="https://redis.io/commands/vemb"/></remarks>
57-
[Experimental(Experiments.VectorSets, UrlFormat = Experiments.UrlFormat)]
5852
Lease<float>? VectorSetGetApproximateVector(
5953
RedisKey key,
6054
RedisValue member,
@@ -68,7 +62,6 @@ bool VectorSetAdd(
6862
/// <param name="flags">The flags to use for this operation.</param>
6963
/// <returns>The attributes as a JSON string.</returns>
7064
/// <remarks><seealso href="https://redis.io/commands/vgetattr"/></remarks>
71-
[Experimental(Experiments.VectorSets, UrlFormat = Experiments.UrlFormat)]
7265
string? VectorSetGetAttributesJson(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None);
7366

7467
/// <summary>
@@ -78,7 +71,6 @@ bool VectorSetAdd(
7871
/// <param name="flags">The flags to use for this operation.</param>
7972
/// <returns>Information about the vectorset.</returns>
8073
/// <remarks><seealso href="https://redis.io/commands/vinfo"/></remarks>
81-
[Experimental(Experiments.VectorSets, UrlFormat = Experiments.UrlFormat)]
8274
VectorSetInfo? VectorSetInfo(RedisKey key, CommandFlags flags = CommandFlags.None);
8375

8476
/// <summary>
@@ -89,7 +81,6 @@ bool VectorSetAdd(
8981
/// <param name="flags">The flags to use for this operation.</param>
9082
/// <returns>True if the member exists, false otherwise.</returns>
9183
/// <remarks><seealso href="https://redis.io/commands/vismember"/></remarks>
92-
[Experimental(Experiments.VectorSets, UrlFormat = Experiments.UrlFormat)]
9384
bool VectorSetContains(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None);
9485

9586
/// <summary>
@@ -100,7 +91,6 @@ bool VectorSetAdd(
10091
/// <param name="flags">The flags to use for this operation.</param>
10192
/// <returns>The linked members.</returns>
10293
/// <remarks><seealso href="https://redis.io/commands/vlinks"/></remarks>
103-
[Experimental(Experiments.VectorSets, UrlFormat = Experiments.UrlFormat)]
10494
Lease<RedisValue>? VectorSetGetLinks(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None);
10595

10696
/// <summary>
@@ -111,7 +101,6 @@ bool VectorSetAdd(
111101
/// <param name="flags">The flags to use for this operation.</param>
112102
/// <returns>The linked members with their similarity scores.</returns>
113103
/// <remarks><seealso href="https://redis.io/commands/vlinks"/></remarks>
114-
[Experimental(Experiments.VectorSets, UrlFormat = Experiments.UrlFormat)]
115104
Lease<VectorSetLink>? VectorSetGetLinksWithScores(
116105
RedisKey key,
117106
RedisValue member,
@@ -124,7 +113,6 @@ bool VectorSetAdd(
124113
/// <param name="flags">The flags to use for this operation.</param>
125114
/// <returns>A random member from the vectorset, or null if the vectorset is empty.</returns>
126115
/// <remarks><seealso href="https://redis.io/commands/vrandmember"/></remarks>
127-
[Experimental(Experiments.VectorSets, UrlFormat = Experiments.UrlFormat)]
128116
RedisValue VectorSetRandomMember(RedisKey key, CommandFlags flags = CommandFlags.None);
129117

130118
/// <summary>
@@ -135,7 +123,6 @@ bool VectorSetAdd(
135123
/// <param name="flags">The flags to use for this operation.</param>
136124
/// <returns>Random members from the vectorset.</returns>
137125
/// <remarks><seealso href="https://redis.io/commands/vrandmember"/></remarks>
138-
[Experimental(Experiments.VectorSets, UrlFormat = Experiments.UrlFormat)]
139126
RedisValue[] VectorSetRandomMembers(RedisKey key, long count, CommandFlags flags = CommandFlags.None);
140127

141128
/// <summary>
@@ -146,7 +133,6 @@ bool VectorSetAdd(
146133
/// <param name="flags">The flags to use for this operation.</param>
147134
/// <returns><see langword="true"/> if the member was removed; <see langword="false"/> if it was not found.</returns>
148135
/// <remarks><seealso href="https://redis.io/commands/vrem"/></remarks>
149-
[Experimental(Experiments.VectorSets, UrlFormat = Experiments.UrlFormat)]
150136
bool VectorSetRemove(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None);
151137

152138
/// <summary>
@@ -158,7 +144,6 @@ bool VectorSetAdd(
158144
/// <param name="flags">The flags to use for this operation.</param>
159145
/// <returns>True if successful.</returns>
160146
/// <remarks><seealso href="https://redis.io/commands/vsetattr"/></remarks>
161-
[Experimental(Experiments.VectorSets, UrlFormat = Experiments.UrlFormat)]
162147
bool VectorSetSetAttributesJson(
163148
RedisKey key,
164149
RedisValue member,
@@ -176,7 +161,6 @@ bool VectorSetSetAttributesJson(
176161
/// <param name="flags">The flags to use for this operation.</param>
177162
/// <returns>Similar vectors with their similarity scores.</returns>
178163
/// <remarks><seealso href="https://redis.io/commands/vsim"/></remarks>
179-
[Experimental(Experiments.VectorSets, UrlFormat = Experiments.UrlFormat)]
180164
Lease<VectorSetSimilaritySearchResult>? VectorSetSimilaritySearch(
181165
RedisKey key,
182166
VectorSetSimilaritySearchRequest query,
@@ -193,7 +177,6 @@ bool VectorSetSetAttributesJson(
193177
/// <param name="flags">The flags to use for this operation.</param>
194178
/// <returns>Members in the specified range as a pooled memory lease.</returns>
195179
/// <remarks><seealso href="https://redis.io/commands/vrange"/></remarks>
196-
[Experimental(Experiments.VectorSets, UrlFormat = Experiments.UrlFormat)]
197180
Lease<RedisValue> VectorSetRange(
198181
RedisKey key,
199182
RedisValue start = default,
@@ -213,7 +196,6 @@ Lease<RedisValue> VectorSetRange(
213196
/// <param name="flags">The flags to use for this operation.</param>
214197
/// <returns>An enumerable of members in the specified range.</returns>
215198
/// <remarks><seealso href="https://redis.io/commands/vrange"/></remarks>
216-
[Experimental(Experiments.VectorSets, UrlFormat = Experiments.UrlFormat)]
217199
System.Collections.Generic.IEnumerable<RedisValue> VectorSetRangeEnumerate(
218200
RedisKey key,
219201
RedisValue start = default,

src/StackExchange.Redis/Interfaces/IDatabase.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3265,6 +3265,7 @@ IEnumerable<SortedSetEntry> SortedSetScan(
32653265
/// <param name="flags">The flags to use for this operation.</param>
32663266
/// <returns>A <see cref="GcraRateLimitResult"/> containing the rate limit decision and metadata.</returns>
32673267
/// <remarks><seealso href="https://redis.io/commands/gcra"/></remarks>
3268+
[Experimental(Experiments.Server_8_8, UrlFormat = Experiments.UrlFormat)]
32683269
GcraRateLimitResult StringGcraRateLimit(RedisKey key, int maxBurst, int requestsPerPeriod, double periodSeconds = 1.0, int count = 1, CommandFlags flags = CommandFlags.None);
32693270

32703271
/// <summary>

src/StackExchange.Redis/Interfaces/IDatabaseAsync.VectorSets.cs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22
using System.Diagnostics.CodeAnalysis;
33
using System.Threading.Tasks;
4-
using RESPite;
54

65
// ReSharper disable once CheckNamespace
76
namespace StackExchange.Redis;
@@ -14,70 +13,57 @@ public partial interface IDatabaseAsync
1413
// Vector Set operations
1514

1615
/// <inheritdoc cref="IDatabase.VectorSetAdd(RedisKey, VectorSetAddRequest, CommandFlags)"/>
17-
[Experimental(Experiments.VectorSets, UrlFormat = Experiments.UrlFormat)]
1816
Task<bool> VectorSetAddAsync(
1917
RedisKey key,
2018
VectorSetAddRequest request,
2119
CommandFlags flags = CommandFlags.None);
2220

2321
/// <inheritdoc cref="IDatabase.VectorSetLength(RedisKey, CommandFlags)"/>
24-
[Experimental(Experiments.VectorSets, UrlFormat = Experiments.UrlFormat)]
2522
Task<long> VectorSetLengthAsync(RedisKey key, CommandFlags flags = CommandFlags.None);
2623

2724
/// <inheritdoc cref="IDatabase.VectorSetDimension(RedisKey, CommandFlags)"/>
28-
[Experimental(Experiments.VectorSets, UrlFormat = Experiments.UrlFormat)]
2925
Task<int> VectorSetDimensionAsync(RedisKey key, CommandFlags flags = CommandFlags.None);
3026

3127
/// <inheritdoc cref="IDatabase.VectorSetGetApproximateVector(RedisKey, RedisValue, CommandFlags)"/>
32-
[Experimental(Experiments.VectorSets, UrlFormat = Experiments.UrlFormat)]
3328
Task<Lease<float>?> VectorSetGetApproximateVectorAsync(
3429
RedisKey key,
3530
RedisValue member,
3631
CommandFlags flags = CommandFlags.None);
3732

3833
/// <inheritdoc cref="IDatabase.VectorSetGetAttributesJson(RedisKey, RedisValue, CommandFlags)"/>
39-
[Experimental(Experiments.VectorSets, UrlFormat = Experiments.UrlFormat)]
4034
Task<string?> VectorSetGetAttributesJsonAsync(
4135
RedisKey key,
4236
RedisValue member,
4337
CommandFlags flags = CommandFlags.None);
4438

4539
/// <inheritdoc cref="IDatabase.VectorSetInfo(RedisKey, CommandFlags)"/>
46-
[Experimental(Experiments.VectorSets, UrlFormat = Experiments.UrlFormat)]
4740
Task<VectorSetInfo?> VectorSetInfoAsync(RedisKey key, CommandFlags flags = CommandFlags.None);
4841

4942
/// <inheritdoc cref="IDatabase.VectorSetContains(RedisKey, RedisValue, CommandFlags)"/>
50-
[Experimental(Experiments.VectorSets, UrlFormat = Experiments.UrlFormat)]
5143
Task<bool> VectorSetContainsAsync(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None);
5244

5345
/// <inheritdoc cref="IDatabase.VectorSetGetLinks(RedisKey, RedisValue, CommandFlags)"/>
54-
[Experimental(Experiments.VectorSets, UrlFormat = Experiments.UrlFormat)]
5546
Task<Lease<RedisValue>?> VectorSetGetLinksAsync(
5647
RedisKey key,
5748
RedisValue member,
5849
CommandFlags flags = CommandFlags.None);
5950

6051
/// <inheritdoc cref="IDatabase.VectorSetGetLinksWithScores(RedisKey, RedisValue, CommandFlags)"/>
61-
[Experimental(Experiments.VectorSets, UrlFormat = Experiments.UrlFormat)]
6252
Task<Lease<VectorSetLink>?> VectorSetGetLinksWithScoresAsync(
6353
RedisKey key,
6454
RedisValue member,
6555
CommandFlags flags = CommandFlags.None);
6656

6757
/// <inheritdoc cref="IDatabase.VectorSetRandomMember(RedisKey, CommandFlags)"/>
68-
[Experimental(Experiments.VectorSets, UrlFormat = Experiments.UrlFormat)]
6958
Task<RedisValue> VectorSetRandomMemberAsync(RedisKey key, CommandFlags flags = CommandFlags.None);
7059

7160
/// <inheritdoc cref="IDatabase.VectorSetRandomMembers(RedisKey, long, CommandFlags)"/>
72-
[Experimental(Experiments.VectorSets, UrlFormat = Experiments.UrlFormat)]
7361
Task<RedisValue[]> VectorSetRandomMembersAsync(RedisKey key, long count, CommandFlags flags = CommandFlags.None);
7462

7563
/// <inheritdoc cref="IDatabase.VectorSetRemove(RedisKey, RedisValue, CommandFlags)"/>
76-
[Experimental(Experiments.VectorSets, UrlFormat = Experiments.UrlFormat)]
7764
Task<bool> VectorSetRemoveAsync(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None);
7865

7966
/// <inheritdoc cref="IDatabase.VectorSetSetAttributesJson(RedisKey, RedisValue, string, CommandFlags)"/>
80-
[Experimental(Experiments.VectorSets, UrlFormat = Experiments.UrlFormat)]
8167
Task<bool> VectorSetSetAttributesJsonAsync(
8268
RedisKey key,
8369
RedisValue member,
@@ -88,14 +74,12 @@ Task<bool> VectorSetSetAttributesJsonAsync(
8874
CommandFlags flags = CommandFlags.None);
8975

9076
/// <inheritdoc cref="IDatabase.VectorSetSimilaritySearch(RedisKey, VectorSetSimilaritySearchRequest, CommandFlags)"/>
91-
[Experimental(Experiments.VectorSets, UrlFormat = Experiments.UrlFormat)]
9277
Task<Lease<VectorSetSimilaritySearchResult>?> VectorSetSimilaritySearchAsync(
9378
RedisKey key,
9479
VectorSetSimilaritySearchRequest query,
9580
CommandFlags flags = CommandFlags.None);
9681

9782
/// <inheritdoc cref="IDatabase.VectorSetRange(RedisKey, RedisValue, RedisValue, long, Exclude, CommandFlags)"/>
98-
[Experimental(Experiments.VectorSets, UrlFormat = Experiments.UrlFormat)]
9983
Task<Lease<RedisValue>?> VectorSetRangeAsync(
10084
RedisKey key,
10185
RedisValue start = default,
@@ -105,7 +89,6 @@ Task<bool> VectorSetSetAttributesJsonAsync(
10589
CommandFlags flags = CommandFlags.None);
10690

10791
/// <inheritdoc cref="IDatabase.VectorSetRangeEnumerate(RedisKey, RedisValue, RedisValue, long, Exclude, CommandFlags)"/>
108-
[Experimental(Experiments.VectorSets, UrlFormat = Experiments.UrlFormat)]
10992
System.Collections.Generic.IAsyncEnumerable<RedisValue> VectorSetRangeEnumerateAsync(
11093
RedisKey key,
11194
RedisValue start = default,

0 commit comments

Comments
 (0)