Skip to content
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
23 changes: 17 additions & 6 deletions eng/public-api.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
# abstract/override/static/virtual block and a bare one.
MODIFIERS = ("abstract ", "override ", "static ", "virtual ", "readonly ", "const ", "sealed ")

REMOVED = "*REMOVED*"


def sort_key(line):
s = line
Expand Down Expand Up @@ -97,21 +99,30 @@ def main():

rel = os.path.relpath(shipped_path, root)
entries = list(shipped.entries)
promoted = []
promoted, removed, emptied = [], [], False

if args.promote and unshipped and unshipped.entries:
promoted = list(unshipped.entries)
# '*REMOVED*Foo' in unshipped retracts the shipped entry 'Foo': promoting it means dropping
# both, not copying the marker across (it means nothing in the shipped file)
removed = [e[len(REMOVED):] for e in unshipped.entries if e.startswith(REMOVED)]
missing = [e for e in removed if e not in set(entries)]
if missing:
problems.append(f"{rel}: {len(missing)} removal(s) of API that is not shipped, e.g. {missing[0]}")
continue
entries = [e for e in entries if e not in set(removed)]
promoted = [e for e in unshipped.entries if not e.startswith(REMOVED)]
# an entry in both files is not something to silently dedupe: the analyzer rejects
# duplicates (RS0025), and it means one of the two was hand-edited
clash = [e for e in promoted if e in set(entries)]
if clash:
problems.append(f"{rel}: {len(clash)} entr(y/ies) already shipped, e.g. {clash[0]}")
continue
entries += promoted
emptied = True

new_shipped = sorted(entries, key=sort_key)
if shipped.render(new_shipped) != shipped.render(shipped.entries) or promoted:
note = f" (+{len(promoted)} promoted)" if promoted else ""
if shipped.render(new_shipped) != shipped.render(shipped.entries) or emptied:
note = f" (+{len(promoted)} promoted, -{len(removed)} removed)" if emptied else ""
changed.append(rel + note)
if not args.check:
shipped.write(new_shipped)
Expand All @@ -120,9 +131,9 @@ def main():
rel_un = os.path.relpath(unshipped_path, root)
# promoted entries leave; whatever remains is sorted too, so that appending to it from two
# branches collides less often
new_unshipped = [] if promoted else sorted(unshipped.entries, key=sort_key)
new_unshipped = [] if emptied else sorted(unshipped.entries, key=sort_key)
if unshipped.render(new_unshipped) != unshipped.render(unshipped.entries):
if not promoted:
if not emptied:
changed.append(rel_un)
if not args.check:
unshipped.write(new_unshipped)
Expand Down
30 changes: 29 additions & 1 deletion src/NRedisStack/PublicAPI/PublicAPI.Shipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ static NRedisStack.CmsCommandBuilder.IncrBy(StackExchange.Redis.RedisKey key, St
static NRedisStack.CmsCommandBuilder.IncrBy(StackExchange.Redis.RedisKey key, System.Tuple<StackExchange.Redis.RedisValue, long>![]! itemIncrements) -> NRedisStack.RedisStackCommands.SerializedCommand!
static NRedisStack.CmsCommandBuilder.Info(StackExchange.Redis.RedisKey key) -> NRedisStack.RedisStackCommands.SerializedCommand!
static NRedisStack.CmsCommandBuilder.InitByDim(StackExchange.Redis.RedisKey key, long width, long depth) -> NRedisStack.RedisStackCommands.SerializedCommand!
static NRedisStack.CmsCommandBuilder.InitByDim(StackExchange.Redis.RedisKey key, long width, long depth, int cellSize) -> NRedisStack.RedisStackCommands.SerializedCommand!
static NRedisStack.CmsCommandBuilder.InitByProb(StackExchange.Redis.RedisKey key, double error, double probability) -> NRedisStack.RedisStackCommands.SerializedCommand!
static NRedisStack.CmsCommandBuilder.InitByProb(StackExchange.Redis.RedisKey key, double error, double probability, int cellSize) -> NRedisStack.RedisStackCommands.SerializedCommand!
static NRedisStack.CmsCommandBuilder.Merge(StackExchange.Redis.RedisValue destination, long numKeys, StackExchange.Redis.RedisValue[]! source, long[]? weight = null) -> NRedisStack.RedisStackCommands.SerializedCommand!
static NRedisStack.CmsCommandBuilder.Query(StackExchange.Redis.RedisKey key, params StackExchange.Redis.RedisValue[]! items) -> NRedisStack.RedisStackCommands.SerializedCommand!
NRedisStack.CmsCommands
Expand All @@ -69,7 +71,9 @@ NRedisStack.CmsCommands.IncrBy(StackExchange.Redis.RedisKey key, StackExchange.R
NRedisStack.CmsCommands.IncrBy(StackExchange.Redis.RedisKey key, System.Tuple<StackExchange.Redis.RedisValue, long>![]! itemIncrements) -> long[]!
NRedisStack.CmsCommands.Info(StackExchange.Redis.RedisKey key) -> NRedisStack.CountMinSketch.DataTypes.CmsInformation!
NRedisStack.CmsCommands.InitByDim(StackExchange.Redis.RedisKey key, long width, long depth) -> bool
NRedisStack.CmsCommands.InitByDim(StackExchange.Redis.RedisKey key, long width, long depth, int cellSize) -> bool
NRedisStack.CmsCommands.InitByProb(StackExchange.Redis.RedisKey key, double error, double probability) -> bool
NRedisStack.CmsCommands.InitByProb(StackExchange.Redis.RedisKey key, double error, double probability, int cellSize) -> bool
NRedisStack.CmsCommands.Merge(StackExchange.Redis.RedisValue destination, long numKeys, StackExchange.Redis.RedisValue[]! source, long[]? weight = null) -> bool
NRedisStack.CmsCommands.Query(StackExchange.Redis.RedisKey key, params StackExchange.Redis.RedisValue[]! items) -> long[]!
NRedisStack.CmsCommandsAsync
Expand All @@ -78,7 +82,9 @@ NRedisStack.CmsCommandsAsync.IncrByAsync(StackExchange.Redis.RedisKey key, Stack
NRedisStack.CmsCommandsAsync.IncrByAsync(StackExchange.Redis.RedisKey key, System.Tuple<StackExchange.Redis.RedisValue, long>![]! itemIncrements) -> System.Threading.Tasks.Task<long[]!>!
NRedisStack.CmsCommandsAsync.InfoAsync(StackExchange.Redis.RedisKey key) -> System.Threading.Tasks.Task<NRedisStack.CountMinSketch.DataTypes.CmsInformation!>!
NRedisStack.CmsCommandsAsync.InitByDimAsync(StackExchange.Redis.RedisKey key, long width, long depth) -> System.Threading.Tasks.Task<bool>!
NRedisStack.CmsCommandsAsync.InitByDimAsync(StackExchange.Redis.RedisKey key, long width, long depth, int cellSize) -> System.Threading.Tasks.Task<bool>!
NRedisStack.CmsCommandsAsync.InitByProbAsync(StackExchange.Redis.RedisKey key, double error, double probability) -> System.Threading.Tasks.Task<bool>!
NRedisStack.CmsCommandsAsync.InitByProbAsync(StackExchange.Redis.RedisKey key, double error, double probability, int cellSize) -> System.Threading.Tasks.Task<bool>!
NRedisStack.CmsCommandsAsync.MergeAsync(StackExchange.Redis.RedisValue destination, long numKeys, StackExchange.Redis.RedisValue[]! source, long[]? weight = null) -> System.Threading.Tasks.Task<bool>!
NRedisStack.CmsCommandsAsync.QueryAsync(StackExchange.Redis.RedisKey key, params StackExchange.Redis.RedisValue[]! items) -> System.Threading.Tasks.Task<long[]!>!
NRedisStack.Core.DataTypes.MinMaxModifier
Expand Down Expand Up @@ -308,15 +314,19 @@ NRedisStack.ICmsCommands.IncrBy(StackExchange.Redis.RedisKey key, StackExchange.
NRedisStack.ICmsCommands.IncrBy(StackExchange.Redis.RedisKey key, System.Tuple<StackExchange.Redis.RedisValue, long>![]! itemIncrements) -> long[]!
NRedisStack.ICmsCommands.Info(StackExchange.Redis.RedisKey key) -> NRedisStack.CountMinSketch.DataTypes.CmsInformation!
NRedisStack.ICmsCommands.InitByDim(StackExchange.Redis.RedisKey key, long width, long depth) -> bool
NRedisStack.ICmsCommands.InitByDim(StackExchange.Redis.RedisKey key, long width, long depth, int cellSize) -> bool
NRedisStack.ICmsCommands.InitByProb(StackExchange.Redis.RedisKey key, double error, double probability) -> bool
NRedisStack.ICmsCommands.InitByProb(StackExchange.Redis.RedisKey key, double error, double probability, int cellSize) -> bool
NRedisStack.ICmsCommands.Merge(StackExchange.Redis.RedisValue destination, long numKeys, StackExchange.Redis.RedisValue[]! source, long[]? weight = null) -> bool
NRedisStack.ICmsCommands.Query(StackExchange.Redis.RedisKey key, params StackExchange.Redis.RedisValue[]! items) -> long[]!
NRedisStack.ICmsCommandsAsync
NRedisStack.ICmsCommandsAsync.IncrByAsync(StackExchange.Redis.RedisKey key, StackExchange.Redis.RedisValue item, long increment) -> System.Threading.Tasks.Task<long>!
NRedisStack.ICmsCommandsAsync.IncrByAsync(StackExchange.Redis.RedisKey key, System.Tuple<StackExchange.Redis.RedisValue, long>![]! itemIncrements) -> System.Threading.Tasks.Task<long[]!>!
NRedisStack.ICmsCommandsAsync.InfoAsync(StackExchange.Redis.RedisKey key) -> System.Threading.Tasks.Task<NRedisStack.CountMinSketch.DataTypes.CmsInformation!>!
NRedisStack.ICmsCommandsAsync.InitByDimAsync(StackExchange.Redis.RedisKey key, long width, long depth) -> System.Threading.Tasks.Task<bool>!
NRedisStack.ICmsCommandsAsync.InitByDimAsync(StackExchange.Redis.RedisKey key, long width, long depth, int cellSize) -> System.Threading.Tasks.Task<bool>!
NRedisStack.ICmsCommandsAsync.InitByProbAsync(StackExchange.Redis.RedisKey key, double error, double probability) -> System.Threading.Tasks.Task<bool>!
NRedisStack.ICmsCommandsAsync.InitByProbAsync(StackExchange.Redis.RedisKey key, double error, double probability, int cellSize) -> System.Threading.Tasks.Task<bool>!
NRedisStack.ICmsCommandsAsync.MergeAsync(StackExchange.Redis.RedisValue destination, long numKeys, StackExchange.Redis.RedisValue[]! source, long[]? weight = null) -> System.Threading.Tasks.Task<bool>!
NRedisStack.ICmsCommandsAsync.QueryAsync(StackExchange.Redis.RedisKey key, params StackExchange.Redis.RedisValue[]! items) -> System.Threading.Tasks.Task<long[]!>!
NRedisStack.ICuckooCommands
Expand Down Expand Up @@ -770,13 +780,21 @@ NRedisStack.Pipeline.TopK.get -> NRedisStack.TopKCommandsAsync!
NRedisStack.Pipeline.Ts.get -> NRedisStack.TimeSeriesCommandsAsync!
NRedisStack.RedisStackCommands.ModulePrefixes
static NRedisStack.RedisStackCommands.ModulePrefixes.BF(this StackExchange.Redis.IDatabase! db) -> NRedisStack.BloomCommands!
static NRedisStack.RedisStackCommands.ModulePrefixes.BF(this StackExchange.Redis.IDatabaseAsync! db) -> NRedisStack.BloomCommandsAsync!
static NRedisStack.RedisStackCommands.ModulePrefixes.CF(this StackExchange.Redis.IDatabase! db) -> NRedisStack.CuckooCommands!
static NRedisStack.RedisStackCommands.ModulePrefixes.CF(this StackExchange.Redis.IDatabaseAsync! db) -> NRedisStack.CuckooCommandsAsync!
static NRedisStack.RedisStackCommands.ModulePrefixes.CMS(this StackExchange.Redis.IDatabase! db) -> NRedisStack.CmsCommands!
static NRedisStack.RedisStackCommands.ModulePrefixes.CMS(this StackExchange.Redis.IDatabaseAsync! db) -> NRedisStack.CmsCommandsAsync!
static NRedisStack.RedisStackCommands.ModulePrefixes.FT(this StackExchange.Redis.IDatabase! db, int? searchDialect = 2) -> NRedisStack.SearchCommands!
static NRedisStack.RedisStackCommands.ModulePrefixes.FT(this StackExchange.Redis.IDatabaseAsync! db, int? searchDialect = 2) -> NRedisStack.SearchCommandsAsync!
static NRedisStack.RedisStackCommands.ModulePrefixes.JSON(this StackExchange.Redis.IDatabase! db) -> NRedisStack.JsonCommands!
static NRedisStack.RedisStackCommands.ModulePrefixes.JSON(this StackExchange.Redis.IDatabaseAsync! db) -> NRedisStack.JsonCommandsAsync!
static NRedisStack.RedisStackCommands.ModulePrefixes.TDIGEST(this StackExchange.Redis.IDatabase! db) -> NRedisStack.TdigestCommands!
static NRedisStack.RedisStackCommands.ModulePrefixes.TDIGEST(this StackExchange.Redis.IDatabaseAsync! db) -> NRedisStack.TdigestCommandsAsync!
static NRedisStack.RedisStackCommands.ModulePrefixes.TOPK(this StackExchange.Redis.IDatabase! db) -> NRedisStack.TopKCommands!
static NRedisStack.RedisStackCommands.ModulePrefixes.TOPK(this StackExchange.Redis.IDatabaseAsync! db) -> NRedisStack.TopKCommandsAsync!
static NRedisStack.RedisStackCommands.ModulePrefixes.TS(this StackExchange.Redis.IDatabase! db) -> NRedisStack.TimeSeriesCommands!
static NRedisStack.RedisStackCommands.ModulePrefixes.TS(this StackExchange.Redis.IDatabaseAsync! db) -> NRedisStack.TimeSeriesCommandsAsync!
NRedisStack.RedisStackCommands.SerializedCommand
NRedisStack.RedisStackCommands.SerializedCommand.Args.get -> object![]!
NRedisStack.RedisStackCommands.SerializedCommand.Command.get -> string!
Expand Down Expand Up @@ -868,6 +886,7 @@ NRedisStack.Search.AggregationRequest.SortBy(params NRedisStack.Search.Aggregati
NRedisStack.Search.AggregationRequest.SortBy(string! property) -> NRedisStack.Search.AggregationRequest!
NRedisStack.Search.AggregationRequest.Timeout(long timeout) -> NRedisStack.Search.AggregationRequest!
NRedisStack.Search.AggregationRequest.Verbatim() -> NRedisStack.Search.AggregationRequest!
NRedisStack.Search.AggregationRequest.WithCount(bool? value = true) -> NRedisStack.Search.AggregationRequest!
NRedisStack.Search.AggregationRequest.dialect.get -> int?
NRedisStack.Search.AggregationResult
NRedisStack.Search.AggregationResult.CursorId.get -> long
Expand Down Expand Up @@ -1085,6 +1104,7 @@ NRedisStack.Search.Query.SetPayload(string! payload) -> NRedisStack.Search.Query
NRedisStack.Search.Query.SetScorer(string! scorer) -> NRedisStack.Search.Query!
NRedisStack.Search.Query.SetSortBy(string! field, bool? ascending = null) -> NRedisStack.Search.Query!
NRedisStack.Search.Query.SetVerbatim(bool value = true) -> NRedisStack.Search.Query!
NRedisStack.Search.Query.SetWithCount(bool? value = true) -> NRedisStack.Search.Query!
NRedisStack.Search.Query.SetWithPayloads() -> NRedisStack.Search.Query!
NRedisStack.Search.Query.SetWithScores(bool value = true) -> NRedisStack.Search.Query!
NRedisStack.Search.Query.Slop(int slop) -> NRedisStack.Search.Query!
Expand All @@ -1097,6 +1117,8 @@ NRedisStack.Search.Query.SummarizeFields(params string![]! fields) -> NRedisStac
NRedisStack.Search.Query.Timeout(long timeout) -> NRedisStack.Search.Query!
NRedisStack.Search.Query.Verbatim.get -> bool
NRedisStack.Search.Query.Verbatim.set -> void
NRedisStack.Search.Query.WithCount.get -> bool?
NRedisStack.Search.Query.WithCount.set -> void
NRedisStack.Search.Query.WithPayloads.get -> bool
NRedisStack.Search.Query.WithPayloads.set -> void
NRedisStack.Search.Query.WithScores.get -> bool
Expand All @@ -1109,7 +1131,8 @@ NRedisStack.Search.Schema.AddGeoField(NRedisStack.Search.FieldName! name, bool s
NRedisStack.Search.Schema.AddGeoField(string! name, bool sortable = false, bool noIndex = false, bool missingIndex = false) -> NRedisStack.Search.Schema!
NRedisStack.Search.Schema.AddGeoShapeField(NRedisStack.Search.FieldName! name, NRedisStack.Search.Schema.GeoShapeField.CoordinateSystem system, bool missingIndex = false) -> NRedisStack.Search.Schema!
NRedisStack.Search.Schema.AddGeoShapeField(string! name, NRedisStack.Search.Schema.GeoShapeField.CoordinateSystem system, bool missingIndex = false) -> NRedisStack.Search.Schema!
NRedisStack.Search.Schema.AddHnswVectorField(NRedisStack.Search.FieldName! name, NRedisStack.Search.Schema.VectorField.VectorType type, int dimensions, NRedisStack.Search.Schema.VectorField.VectorDistanceMetric distanceMetric, int maxOutgoingConnections = 16, int maxConnectedNeighbors = 200, int maxTopCandidates = 10, double boundaryFactor = 0.01, System.Collections.Generic.Dictionary<string!, object!>? attributes = null, bool missingIndex = false) -> NRedisStack.Search.Schema!
NRedisStack.Search.Schema.AddHnswVectorField(NRedisStack.Search.FieldName! name, NRedisStack.Search.Schema.VectorField.VectorType type, int dimensions, NRedisStack.Search.Schema.VectorField.VectorDistanceMetric distanceMetric, int maxOutgoingConnections = 16, int maxConnectedNeighbors = 200, int maxTopCandidates = 10, double boundaryFactor = 0.01, System.Collections.Generic.Dictionary<string!, object!>? attributes = null, bool missingIndex = false, NRedisStack.Search.Schema.VectorField.VectorCompressionAlgorithm compressionAlgorithm = NRedisStack.Search.Schema.VectorField.VectorCompressionAlgorithm.NotSpecified, int trainingThreshold = 0) -> NRedisStack.Search.Schema!
NRedisStack.Search.Schema.AddHnswVectorField(NRedisStack.Search.FieldName! name, NRedisStack.Search.Schema.VectorField.VectorType type, int dimensions, NRedisStack.Search.Schema.VectorField.VectorDistanceMetric distanceMetric, int maxOutgoingConnections, int maxConnectedNeighbors, int maxTopCandidates, double boundaryFactor, System.Collections.Generic.Dictionary<string!, object!>? attributes, bool missingIndex) -> NRedisStack.Search.Schema!
NRedisStack.Search.Schema.AddNumericField(NRedisStack.Search.FieldName! name, bool sortable = false, bool noIndex = false, bool missingIndex = false) -> NRedisStack.Search.Schema!
NRedisStack.Search.Schema.AddNumericField(string! name, bool sortable = false, bool noIndex = false, bool missingIndex = false) -> NRedisStack.Search.Schema!
NRedisStack.Search.Schema.AddSvsVanamaVectorField(NRedisStack.Search.FieldName! name, NRedisStack.Search.Schema.VectorField.VectorType type, int dimensions, NRedisStack.Search.Schema.VectorField.VectorDistanceMetric distanceMetric, NRedisStack.Search.Schema.VectorField.VectorCompressionAlgorithm compressionAlgorithm = NRedisStack.Search.Schema.VectorField.VectorCompressionAlgorithm.NotSpecified, int constructionWindowSize = 200, int graphMaxDegree = 32, int searchWindowSize = 10, double rangeSearchApproximationFactor = 0.01, int trainingThreshold = 0, int reducedDimensions = 0, System.Collections.Generic.Dictionary<string!, object!>? attributes = null, bool missingIndex = false) -> NRedisStack.Search.Schema!
Expand Down Expand Up @@ -1144,13 +1167,17 @@ NRedisStack.Search.Schema.GeoShapeField.MissingIndex.get -> bool
NRedisStack.Search.Schema.HnswVectorField
NRedisStack.Search.Schema.HnswVectorField.BoundaryFactor.get -> double
NRedisStack.Search.Schema.HnswVectorField.BoundaryFactor.set -> void
NRedisStack.Search.Schema.HnswVectorField.CompressionAlgorithm.get -> NRedisStack.Search.Schema.VectorField.VectorCompressionAlgorithm
NRedisStack.Search.Schema.HnswVectorField.CompressionAlgorithm.set -> void
NRedisStack.Search.Schema.HnswVectorField.HnswVectorField(NRedisStack.Search.FieldName! name, NRedisStack.Search.Schema.VectorField.VectorType type, int dimensions, NRedisStack.Search.Schema.VectorField.VectorDistanceMetric distanceMetric, System.Collections.Generic.Dictionary<string!, object!>? attributes = null, bool missingIndex = false) -> void
NRedisStack.Search.Schema.HnswVectorField.MaxConnectedNeighbors.get -> int
NRedisStack.Search.Schema.HnswVectorField.MaxConnectedNeighbors.set -> void
NRedisStack.Search.Schema.HnswVectorField.MaxOutgoingConnections.get -> int
NRedisStack.Search.Schema.HnswVectorField.MaxOutgoingConnections.set -> void
NRedisStack.Search.Schema.HnswVectorField.MaxTopCandidates.get -> int
NRedisStack.Search.Schema.HnswVectorField.MaxTopCandidates.set -> void
NRedisStack.Search.Schema.HnswVectorField.TrainingThreshold.get -> int
NRedisStack.Search.Schema.HnswVectorField.TrainingThreshold.set -> void
NRedisStack.Search.Schema.NumericField
NRedisStack.Search.Schema.NumericField.MissingIndex.get -> bool
NRedisStack.Search.Schema.NumericField.NoIndex.get -> bool
Expand Down Expand Up @@ -1215,6 +1242,7 @@ NRedisStack.Search.Schema.VectorField.VectorCompressionAlgorithm.LVQ8 = 1 -> NRe
NRedisStack.Search.Schema.VectorField.VectorCompressionAlgorithm.LeanVec4x8 = 5 -> NRedisStack.Search.Schema.VectorField.VectorCompressionAlgorithm
NRedisStack.Search.Schema.VectorField.VectorCompressionAlgorithm.LeanVec8x8 = 6 -> NRedisStack.Search.Schema.VectorField.VectorCompressionAlgorithm
NRedisStack.Search.Schema.VectorField.VectorCompressionAlgorithm.NotSpecified = 0 -> NRedisStack.Search.Schema.VectorField.VectorCompressionAlgorithm
NRedisStack.Search.Schema.VectorField.VectorCompressionAlgorithm.SQ8 = 7 -> NRedisStack.Search.Schema.VectorField.VectorCompressionAlgorithm
NRedisStack.Search.Schema.VectorField.VectorDistanceMetric
NRedisStack.Search.Schema.VectorField.VectorDistanceMetric.CosineDistance = 3 -> NRedisStack.Search.Schema.VectorField.VectorDistanceMetric
NRedisStack.Search.Schema.VectorField.VectorDistanceMetric.EuclideanDistance = 1 -> NRedisStack.Search.Schema.VectorField.VectorDistanceMetric
Expand Down
Loading
Loading