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
7 changes: 4 additions & 3 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
"isRoot": true,
"tools": {
"csharpier": {
"version": "0.27.0",
"version": "1.2.6",
"commands": [
"dotnet-csharpier"
]
"csharpier"
],
"rollForward": false
}
}
}
5 changes: 5 additions & 0 deletions .csharpierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.config
*.csproj
*.props
*.targets
*.xml
12 changes: 6 additions & 6 deletions .github/workflows/ci-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ jobs:
# ASPNETCORE_ENVIRONMENT: Development

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6

# get version of machine.py - MACHINE_PY_IMAGE will force the docker compose to use the proper version of machine.py
- name: Install regctl
uses: iarekylew00t/regctl-installer@v1
uses: iarekylew00t/regctl-installer@v4.0.8

- name: Set proper version of Machine.py
run: |
Expand All @@ -43,12 +43,12 @@ jobs:
echo $MACHINE_PY_IMAGE $MACHINE_PY_CPU_IMAGE

- name: Setup .NET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.0.x
dotnet-version: 10.0.x

- name: Start containers
run: dotnet build && docker compose -f "docker-compose.yml" up -d && sleep 20 #allow time for mongo to start up properly
run: dotnet build && docker compose -f "docker-compose.yml" up -d && sleep 20 #allow time for mongo to start up properly

- name: Debug network
run: docker ps -a && docker logs --since 10m serval_cntr && docker logs --since 10m echo_cntr && docker logs --since 10m machine-engine-cntr && docker logs --since 10m serval-mongo-1 && docker logs --since 10m machine-job-cntr
Expand All @@ -63,7 +63,7 @@ jobs:
run: docker ps -a && docker logs --since 10m serval_cntr && docker logs --since 10m echo_cntr && docker logs --since 10m machine-engine-cntr && docker logs --since 10m serval-mongo-1 && docker logs --since 10m machine-job-cntr

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.0.x
dotnet-version: 10.0.x
- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.8.0
uses: supercharge/mongodb-github-action@1.12.1
with:
mongodb-version: "8.0"
mongodb-replica-set: rs0
Expand All @@ -34,21 +34,21 @@ jobs:
- name: Restore dependencies
run: dotnet restore
- name: Check formatting
run: dotnet csharpier --check .
run: dotnet csharpier check .
- name: Build
run: dotnet build --no-restore -c Release
- name: Pre-Test
run: sudo mkdir -p /var/lib/serval && sudo chmod 777 /var/lib/serval
- name: Test
run: dotnet test --verbosity normal --filter "TestCategory!=E2E&TestCategory!=E2EMissingServices" --collect:"Xplat Code Coverage" --logger "trx;LogFileName=test-results.trx"
- name: Test report
uses: dorny/test-reporter@v1
uses: dorny/test-reporter@v2.5.0
if: success() || failure()
with:
name: NUnit Tests
path: src/**/TestResults/test-results.trx
reporter: dotnet-trx
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
14 changes: 7 additions & 7 deletions .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ name: docker build
on:
push:
tags:
- 'docker_*'
- "docker_*"

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v5
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
- name: Generate Docker metadata
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}
Expand All @@ -24,15 +24,15 @@ jobs:
flavor: |
latest=true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
uses: docker/build-push-action@v6
with:
context: .
push: true
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/missing-services-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

# get version of machine.py - MACHINE_PY_IMAGE will force the docker compose to use the proper version of machine.py
- name: Install regctl
uses: iarekylew00t/regctl-installer@v1
uses: iarekylew00t/regctl-installer@v4.0.8

- name: Set proper version of Machine.py
run: |
Expand All @@ -41,7 +41,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.0.x
dotnet-version: 10.0.x

- name: Get Machine
run: cd .. && git clone https://github.com/sillsdev/machine.git && cd machine && dotnet build && cd ../serval && dotnet build
Expand Down Expand Up @@ -114,7 +114,7 @@ jobs:

#Coverage export
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v5
with:
dotnet-version: 6.0.x
dotnet-version: 10.0.x
- name: Pack
run: dotnet pack src/Serval/src/Serval.Grpc/Serval.Grpc.csproj -c Release -o artifacts
- name: Upload package
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v6
with:
name: nuget-package
path: artifacts/*.nupkg
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.0.x
dotnet-version: 10.0.x
- name: Pack
run: dotnet pack src/Serval/src/Serval.Client/Serval.Client.csproj -c Release -o artifacts
- name: Upload package
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: nuget-package
path: artifacts/*.nupkg
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release-data-access.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v5
with:
dotnet-version: 6.0.x
dotnet-version: 10.0.x
- name: Pack
run: dotnet pack src/Serval/src/SIL.DataAccess/SIL.DataAccess.csproj -c Release -o artifacts
- name: Upload package
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v6
with:
name: nuget-package
path: artifacts/*.nupkg
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,5 @@ artifacts
*src_test*
*trg_test*
*.pyc
scripts/clearml_stats/*
scripts/clearml_stats/*
.idea
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/Serval/src/Serval.ApiServer/bin/Debug/net8.0/Serval.ApiServer.dll",
"program": "${workspaceFolder}/src/Serval/src/Serval.ApiServer/bin/Debug/net10.0/Serval.ApiServer.dll",
"args": [],
"cwd": "${workspaceFolder}/src/Serval/src/Serval.ApiServer",
"stopAtEntry": false,
Expand All @@ -77,7 +77,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/Echo/src/EchoEngine/bin/Debug/net8.0/EchoEngine.dll",
"program": "${workspaceFolder}/src/Echo/src/EchoEngine/bin/Debug/net10.0/EchoEngine.dll",
"args": [],
"cwd": "${workspaceFolder}/src/Echo/src/EchoEngine",
"stopAtEntry": false,
Expand Down
4 changes: 2 additions & 2 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0-noble AS build-env
FROM mcr.microsoft.com/dotnet/sdk:10.0-noble AS build-env
WORKDIR /app

RUN apt-get update && apt-get install -y g++ curl cmake
Expand All @@ -14,7 +14,7 @@ RUN dotnet publish ./src/Machine/src/Serval.Machine.EngineServer/Serval.Machine.
RUN dotnet publish ./src/Machine/src/Serval.Machine.JobServer/Serval.Machine.JobServer.csproj -c Release -o out_machine_job_server

# Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:8.0-noble as production
FROM mcr.microsoft.com/dotnet/aspnet:10.0-noble AS production
# libgomp needed for thot
RUN apt-get update && apt-get install -y libgomp1
WORKDIR /app
Expand Down
2 changes: 1 addition & 1 deletion dockerfile.development
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0-noble
FROM mcr.microsoft.com/dotnet/sdk:10.0-noble
WORKDIR /tools
RUN dotnet tool install --tool-path /tools dotnet-trace \
&& dotnet tool install --tool-path /tools dotnet-counters \
Expand Down
2 changes: 1 addition & 1 deletion local_check.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
dotnet tool restore
dotnet restore
dotnet csharpier --check .
dotnet csharpier check .
if [ $? -ne 0 ]; then
exit 1
fi
Expand Down
8 changes: 4 additions & 4 deletions samples/ApiExample/ApiExample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<UserSecretsId>4d0606c3-0fc7-4d76-b43b-236485004e81</UserSecretsId>
Expand All @@ -18,9 +18,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Duende.AccessTokenManagement" Version="4.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="9.0.10" />
<PackageReference Include="Serval.Client" Version="1.12.1" />
<PackageReference Include="Duende.AccessTokenManagement" Version="4.1.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="10.0.3" />
<PackageReference Include="Serval.Client" Version="1.13.0" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion samples/ApiExample/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This example application will generate a pre-translation USFM draft using the Se

## Pre-Requisites

* .NET SDK 8.0
* .NET SDK 10.0
* You must have a Serval Client ID and Client Secret before running this example.

## Setup
Expand Down
2 changes: 1 addition & 1 deletion src/DataAccess/src/SIL.DataAccess/EntityChange.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ public enum EntityChangeType
None,
Insert,
Update,
Delete
Delete,
}

public readonly record struct EntityChange<T>(EntityChangeType Type, T? Entity)
Expand Down
15 changes: 7 additions & 8 deletions src/DataAccess/src/SIL.DataAccess/MemoryRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ namespace SIL.DataAccess;
public class MemoryRepository<T> : IRepository<T>
where T : IEntity
{
private static readonly JsonSerializerSettings Settings =
new()
{
TypeNameHandling = TypeNameHandling.Auto,
ContractResolver = new WritableContractResolver(),
// add converter to support IReadOnlyList properties that were initialized using collection expressions
Converters = { new ReadOnlyCollectionConverter() }
};
private static readonly JsonSerializerSettings Settings = new()
{
TypeNameHandling = TypeNameHandling.Auto,
ContractResolver = new WritableContractResolver(),
// add converter to support IReadOnlyList properties that were initialized using collection expressions
Converters = { new ReadOnlyCollectionConverter() },
};

private readonly Dictionary<string, string> _entities;
private readonly Func<T, object>[] _uniqueKeySelectors;
Expand Down
2 changes: 1 addition & 1 deletion src/DataAccess/src/SIL.DataAccess/MemoryUpdateBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ Expression<Func<TEntity, TField>> field
nameof(DataAccessExtensions.AllElements) => ArrayPosition.All,
nameof(DataAccessExtensions.FirstMatchingElement) => ArrayPosition.FirstMatching,
"get_Item" => ExpressionHelper.FindConstantValue(methodExpr.Arguments[0]),
_ => throw new ArgumentException("Invalid method call in field expression.", nameof(field))
_ => throw new ArgumentException("Invalid method call in field expression.", nameof(field)),
};

break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ async Task<IClientSessionHandle> Start()
ReadConcern.Majority,
ReadPreference.Primary,
WriteConcern.WMajority
)
),
};
IClientSessionHandle handle = await _client
.StartSessionAsync(sessionOptions, cancellationToken)
Expand Down
4 changes: 2 additions & 2 deletions src/DataAccess/src/SIL.DataAccess/MongoRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ await _collection
var options = new FindOneAndUpdateOptions<T>
{
IsUpsert = upsert,
ReturnDocument = returnOriginal ? ReturnDocument.Before : ReturnDocument.After
ReturnDocument = returnOriginal ? ReturnDocument.Before : ReturnDocument.After,
};
if (arrayFilters.Count > 0)
options.ArrayFilters = arrayFilters;
Expand Down Expand Up @@ -251,7 +251,7 @@ public async Task<ISubscription<T>> SubscribeAsync(
{ "find", _collection.CollectionNamespace.CollectionName },
{ "filter", renderedFilter },
{ "limit", 1 },
{ "singleBatch", true }
{ "singleBatch", true },
};
BsonDocument result;
if (_context.Session is not null)
Expand Down
Loading