Skip to content

Commit 6972624

Browse files
authored
chore(Deps): Docker updates, polish deps/tests (#490)
1 parent 3c80c8e commit 6972624

13 files changed

Lines changed: 59 additions & 17 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ The `Unreleased` section name is replaced by the expected version of next releas
1010

1111
### Changed
1212

13-
- `Equinox.SqlStreamStore.MsSql`: Update `System.IdentityModel.Tokens.Jwt` and `Microsoft.Data.SqlClient` to remove transitive vulnerable defaults [#489](https://github.com/jet/equinox/pull/489)
14-
- `Equinox.CosmosStore`: Update `Microsoft.Azure.Cosmos` to remove transitive vulnerable default [#489](https://github.com/jet/equinox/pull/489)
13+
- .NET 10 SDK update & build optimizations; Docker image update to MSSQL 2025
14+
- `Equinox.CosmosStore`: Update `Microsoft.Azure.Cosmos` to >= `3.58.0` to remove transitive vulnerable default [#489](https://github.com/jet/equinox/pull/489)
1515
- `Equinox.DynamoStore`: Update `AWSSDK` dependencies to 4.x (knock-on effect of updating `FSharp.AWS.DynamoDB` dependency to `0.13.0-beta`) [#480](https://github.com/jet/equinox/pull/480) :pray: [@njlr](https://github.com/njlr)
16+
- `Equinox.SqlStreamStore.MsSql`: Update `System.IdentityModel.Tokens.Jwt` to remove transitive vulnerable defaults [#489](https://github.com/jet/equinox/pull/489)
1617

1718
### Added
1819

Equinox.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".project", ".project", "{7E
2424
global.json = global.json
2525
nuget.config = nuget.config
2626
docker-compose-cosmos.sh = docker-compose-cosmos.sh
27+
docker-compose-cosmos.ps1 = docker-compose-cosmos.ps1
2728
EndProjectSection
2829
EndProject
2930
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Domain", "samples\Store\Domain\Domain.fsproj", "{37B4A45F-039E-4515-8A84-D242DDE12D22}"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ The components within this repository are delivered as multi-targeted Nuget pack
170170

171171
- `Equinox.Core` [![NuGet](https://img.shields.io/nuget/v/Equinox.Core.svg)](https://www.nuget.org/packages/Equinox.Core/): Hosts generic utility types frequently useful alongside Equinox: [`TaskCell`](https://github.com/jet/equinox/blob/master/src/Equinox.Core/TaskCell.fs#L36), [`Batcher`, `BatcherCache`, `BatcherDictionary`](https://github.com/jet/equinox/blob/master/src/Equinox.Core/Batching.fs#L44). ([depends](https://www.fuget.org/packages/Equinox.Core) on `System.Runtime.Caching`)
172172
- `Equinox.MemoryStore` [![MemoryStore NuGet](https://img.shields.io/nuget/v/Equinox.MemoryStore.svg)](https://www.nuget.org/packages/Equinox.MemoryStore/): In-memory store for integration testing/performance base-lining/providing out-of-the-box zero dependency storage for examples. ([depends](https://www.fuget.org/packages/Equinox.MemoryStore) on `Equinox`)
173-
- `Equinox.CosmosStore` [![CosmosStore NuGet](https://img.shields.io/nuget/v/Equinox.CosmosStore.svg)](https://www.nuget.org/packages/Equinox.CosmosStore/): Azure CosmosDB Adapter with integrated 'unfolds' feature, facilitating optimal read performance in terms of latency and RU costs, instrumented to meet Jet's production monitoring requirements. ([depends](https://www.fuget.org/packages/Equinox.CosmosStore) on `Equinox`, `Equinox`, `Microsoft.Azure.Cosmos` >= `3.57.1`, `System.Text.Json`, `FSharp.Control.TaskSeq`)
173+
- `Equinox.CosmosStore` [![CosmosStore NuGet](https://img.shields.io/nuget/v/Equinox.CosmosStore.svg)](https://www.nuget.org/packages/Equinox.CosmosStore/): Azure CosmosDB Adapter with integrated 'unfolds' feature, facilitating optimal read performance in terms of latency and RU costs, instrumented to meet Jet's production monitoring requirements. ([depends](https://www.fuget.org/packages/Equinox.CosmosStore) on `Equinox`, `Equinox`, `Microsoft.Azure.Cosmos` >= `3.58.0`, `System.Text.Json`, `FSharp.Control.TaskSeq`)
174174
- `Equinox.CosmosStore.Prometheus` [![CosmosStore.Prometheus NuGet](https://img.shields.io/nuget/v/Equinox.CosmosStore.Prometheus.svg)](https://www.nuget.org/packages/Equinox.CosmosStore.Prometheus/): Integration package providing a `Serilog.Core.ILogEventSink` that extracts detailed metrics information attached to the `LogEvent`s and feeds them to the `prometheus-net`'s `Prometheus.Metrics` static instance. ([depends](https://www.fuget.org/packages/Equinox.CosmosStore.Prometheus) on `Equinox.CosmosStore`, `prometheus-net >= 3.6.0`)
175175
- `Equinox.DynamoStore` [![DynamoStore NuGet](https://img.shields.io/nuget/v/Equinox.DynamoStore.svg)](https://www.nuget.org/packages/Equinox.DynamoStore/): Amazon DynamoDB Adapter with integrated 'unfolds' feature, facilitating optimal read performance in terms of latency and RC costs, patterned after `Equinox.CosmosStore`. ([depends](https://www.fuget.org/packages/Equinox.DynamoStore) on `Equinox`, `FSharp.AWS.DynamoDB` >= `0.12.3-beta`, `FSharp.Control.TaskSeq`)
176176
- `Equinox.DynamoStore.Prometheus` [![DynamoStore.Prometheus NuGet](https://img.shields.io/nuget/v/Equinox.DynamoStore.Prometheus.svg)](https://www.nuget.org/packages/Equinox.DynamoStore.Prometheus/): Integration package providing a `Serilog.Core.ILogEventSink` that extracts detailed metrics information attached to the `LogEvent`s and feeds them to the `prometheus-net`'s `Prometheus.Metrics` static instance. ([depends](https://www.fuget.org/packages/Equinox.CosmosStore.Prometheus) on `Equinox.DynamoStore`, `prometheus-net >= 3.6.0`)

docker-compose-cosmos.ps1

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#requires -Version 7
2+
param(
3+
[alias("sc")][Switch][bool]$skipCert = $false,
4+
[alias("l")][Switch][bool]$bootstrapEqx = $false,
5+
[alias("si")][Switch][bool]$skipInit = $false
6+
)
7+
8+
if (-not $skipCert) {
9+
Write-Host "Please click on the cert import popup to confirm..."
10+
$rgs = @{
11+
Uri = 'https://localhost:8081/_explorer/emulator.pem'
12+
Method = 'GET'
13+
OutFile = "$env:TEMP/emulatorcert.crt"
14+
SkipCertificateCheck = $True
15+
}
16+
Invoke-WebRequest @rgs
17+
$rgs = @{
18+
FilePath = "$env:TEMP/emulatorcert.crt"
19+
CertStoreLocation = 'Cert:\CurrentUser\Root'
20+
}
21+
Import-Certificate @rgs
22+
}
23+
24+
$env:EQUINOX_COSMOS_CONNECTION = "AccountEndpoint=https://localhost:8081/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==;"
25+
$env:EQUINOX_COSMOS_DATABASE = "equinox-test"
26+
$env:EQUINOX_COSMOS_CONTAINER = "equinox-test"
27+
28+
if (-not $skipInit)
29+
{
30+
$local:cmd = $bootstrapEqx ? "dotnet run -c Release --project tools/Equinox.Tool --" : "eqx"
31+
Invoke-Expression "$cmd init cosmos"
32+
Invoke-Expression "$cmd init cosmos -c equinox-test-archive"
33+
}
34+
# Explorer URL: https://localhost:8081/_explorer/index.html, see https://learn.microsoft.com/en-us/azure/cosmos-db/how-to-develop-emulator

docker-compose.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ services:
1717

1818
equinox-mssql:
1919
container_name: equinox-mssql
20-
image: mcr.microsoft.com/mssql/server:2022-latest
20+
image: mcr.microsoft.com/mssql/server:2025-latest
2121
restart: unless-stopped
2222
ports:
2323
- 1433:1433
2424
environment:
25-
- SA_PASSWORD=mssql1Ipw
25+
- MSSQL_SA_PASSWORD=mssql1Ipw
2626
- ACCEPT_EULA=Y
2727
# see https://github.com/microsoft/mssql-docker/issues/2#issuecomment-1683956282
2828
equinox-mssql-init:
29-
image: mcr.microsoft.com/mssql/server:2022-latest
29+
image: mcr.microsoft.com/mssql-tools
3030
network_mode: service:equinox-mssql
3131
command: bash -c 'until /opt/mssql-tools/bin/sqlcmd -U sa -P mssql1Ipw -Q "CREATE DATABASE EQUINOX_TEST_DB"; do echo retry && sleep 1; done'
3232
depends_on:
@@ -41,7 +41,7 @@ services:
4141
environment:
4242
- MYSQL_ALLOW_EMPTY_PASSWORD=1
4343
- MYSQL_DATABASE=EQUINOX_TEST_DB
44-
# it _almost_ (but doesnt) works with the default mysql using the following
44+
# it _almost_ (but doesn't) works with the default mysql using the following
4545
# command: ['mysqld', '--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci']
4646

4747
setup.eventstore:

samples/Tutorial/Tutorial.fsproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<PropertyGroup>
44
<TargetFramework>net10.0</TargetFramework>
55
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
6-
<AzureCosmosDisableNewtonsoftJsonCheck>true</AzureCosmosDisableNewtonsoftJsonCheck>
76
</PropertyGroup>
87

98
<ItemGroup>

src/Equinox.CosmosStore.Prometheus/Equinox.CosmosStore.Prometheus.fsproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
<PropertyGroup>
44
<TargetFramework>net6.0</TargetFramework>
5-
<AzureCosmosDisableNewtonsoftJsonCheck>true</AzureCosmosDisableNewtonsoftJsonCheck>
65
</PropertyGroup>
76

87
<ItemGroup>

src/Equinox.CosmosStore/CosmosStore.fs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,8 +1192,11 @@ type CosmosClientFactory(options) =
11921192
MaxRetryWaitTimeOnRateLimitedRequests = maxRetryWaitTimeOnRateLimitedRequests,
11931193
RequestTimeout = requestTimeout,
11941194
UseSystemTextJsonSerializerWithOptions = JsonSerializerOptions())
1195-
/// Default when rendering/parsing Batch/Tip/Event/Unfold - omitting null values
1196-
static member val DefaultJsonSerializerOptions = JsonSerializerOptions(DefaultIgnoreCondition = Serialization.JsonIgnoreCondition.WhenWritingNull)
1195+
/// Default when rendering/parsing Batch/Tip/Event/Unfold
1196+
static member val DefaultJsonSerializerOptions =
1197+
JsonSerializerOptions(
1198+
DefaultIgnoreCondition = Serialization.JsonIgnoreCondition.WhenWritingNull, // omitting null values
1199+
Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping) // don't need HTML-safe escaping for Cosmos Service invocations in this context
11971200
/// CosmosClientOptions for this CosmosClientFactory as configured (NOTE while the Options object is not immutable, it should not have setters called on it)
11981201
member val Options = options
11991202
/// Creates an instance of CosmosClient without actually validating or establishing the connection

src/Equinox.CosmosStore/Equinox.CosmosStore.fsproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<PropertyGroup>
44
<TargetFramework>net6.0</TargetFramework>
55
<PackageValidationBaselineVersion>4.1.0</PackageValidationBaselineVersion>
6-
<AzureCosmosDisableNewtonsoftJsonCheck>true</AzureCosmosDisableNewtonsoftJsonCheck>
76
</PropertyGroup>
87

98
<ItemGroup>
@@ -25,7 +24,8 @@
2524
<PackageReference Include="FSharp.Core" Version="6.0.7" ExcludeAssets="contentfiles" />
2625

2726
<PackageReference Include="FSharp.Control.TaskSeq" Version="0.4.0" />
28-
<PackageReference Include="Microsoft.Azure.Cosmos" Version="3.57.1" />
27+
<PackageReference Include="Microsoft.Azure.Cosmos" Version="3.58.0" />
28+
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
2929
<PackageReference Include="System.Text.Json" Version="6.0.10" />
3030
</ItemGroup>
3131

tests/Equinox.CosmosStore.Integration/CosmosCoreIntegration.fs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,10 @@ type Tests(testOutputHelper) =
144144
145145
(* Demonstrate benefit/mechanism for using the Position-based API to avail of the etag tracking *)
146146
147-
let extrasCount = match extras with x when x > 50 -> 5000 | x when x < 1 -> 1 | x -> x*100
148-
let! _pos = Async.call (fun ct -> ctx.NonIdempotentAppend(streamName, TestEvents.Create (int pos,extrasCount), ct))
147+
// NOTE limiting to 5000 also works, but makes things flaky with the Cosmos emulator
148+
let range lower upper = max lower >> min upper
149+
let extrasCount = extras |> range 1 50
150+
let! _pos = Async.call (fun ct -> ctx.NonIdempotentAppend(streamName, TestEvents.Create (int pos, extrasCount), ct))
149151
test <@ [EqxAct.Append] = capture.ExternalCalls @>
150152
if eventsInTip then verifyRequestChargesMax 451 // 450.03
151153
else verifyRequestChargesMax 448 // 447.5 // 463.01 observed

0 commit comments

Comments
 (0)