Skip to content

Commit d8d937e

Browse files
committed
Release Orleans Graph for .NET 10
1 parent e27e01d commit d8d937e

48 files changed

Lines changed: 573 additions & 349 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.config/dotnet-tools.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"coverlet.console": {
6+
"version": "10.0.0",
7+
"commands": [
8+
"coverlet"
9+
],
10+
"rollForward": false
11+
},
12+
"dotnet-reportgenerator-globaltool": {
13+
"version": "5.5.10",
14+
"commands": [
15+
"reportgenerator"
16+
],
17+
"rollForward": false
18+
},
19+
"roslynator.dotnet.cli": {
20+
"version": "0.12.0",
21+
"commands": [
22+
"roslynator"
23+
],
24+
"rollForward": false
25+
}
26+
}
27+
}

.github/workflows/ci.yml

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@ on:
77
branches: [ main ]
88

99
env:
10-
DOTNET_VERSION: '9.0.x'
10+
DOTNET_VERSION: '10.0.x'
11+
12+
permissions:
13+
contents: read
1114

1215
jobs:
13-
build:
14-
name: Build and Test
16+
build-and-test:
17+
name: Build, Test, and Coverage
1518
runs-on: ubuntu-latest
1619

1720
steps:
@@ -23,11 +26,51 @@ jobs:
2326
with:
2427
dotnet-version: ${{ env.DOTNET_VERSION }}
2528

26-
- name: Restore dependencies
29+
- name: Restore local tools
30+
run: dotnet tool restore
31+
32+
- name: Restore
2733
run: dotnet restore Orleans.Graph.slnx
2834

2935
- name: Build
3036
run: dotnet build Orleans.Graph.slnx --configuration Release --no-restore
3137

38+
- name: Analyze
39+
run: dotnet build Orleans.Graph.slnx --configuration Release --no-restore -p:RunAnalyzers=true
40+
41+
- name: Verify formatting
42+
run: dotnet format Orleans.Graph.slnx --verify-no-changes
43+
3244
- name: Test
33-
run: dotnet test Orleans.Graph.slnx --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage"
45+
run: dotnet test --solution Orleans.Graph.slnx --configuration Release --no-build --verbosity normal --report-trx --results-directory ./artifacts/test-results
46+
47+
- name: Collect coverage
48+
run: dotnet tool run coverlet ManagedCode.Orleans.Graph.Tests/bin/Release/net10.0/ManagedCode.Orleans.Graph.Tests.dll --target "dotnet" --targetargs "test --project ManagedCode.Orleans.Graph.Tests/ManagedCode.Orleans.Graph.Tests.csproj --configuration Release --no-build --no-restore" --format cobertura --output artifacts/coverage/coverage.cobertura.xml --exclude "[ManagedCode.Orleans.Graph.Tests]*" --threshold 80 --threshold-type line --threshold-stat total
49+
50+
- name: Render coverage report
51+
run: dotnet tool run reportgenerator -reports:"artifacts/coverage/coverage.cobertura.xml" -targetdir:"artifacts/coverage-report" -reporttypes:"HtmlSummary;MarkdownSummaryGithub"
52+
53+
- name: Upload test artifacts
54+
if: always()
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: test-results
58+
path: ./artifacts/test-results/**
59+
retention-days: 5
60+
61+
- name: Upload coverage artifacts
62+
if: always()
63+
uses: actions/upload-artifact@v4
64+
with:
65+
name: coverage-report
66+
path: |
67+
./artifacts/coverage/**
68+
./artifacts/coverage-report/**
69+
retention-days: 5
70+
71+
- name: Upload coverage reports to Codecov
72+
uses: codecov/codecov-action@v5
73+
with:
74+
token: ${{ secrets.CODECOV_TOKEN }}
75+
files: ./artifacts/coverage/coverage.cobertura.xml
76+
fail_ci_if_error: false

.github/workflows/codeql-analysis.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
- cron: '0 0 * * 1'
1010

1111
env:
12-
DOTNET_VERSION: '9.0.x'
12+
DOTNET_VERSION: '10.0.x'
1313

1414
jobs:
1515
analyze:
@@ -29,17 +29,17 @@ jobs:
2929
- name: Checkout repository
3030
uses: actions/checkout@v5
3131

32-
- name: Setup .NET
33-
uses: actions/setup-dotnet@v4
34-
with:
35-
dotnet-version: ${{ env.DOTNET_VERSION }}
36-
3732
- name: Initialize CodeQL
3833
uses: github/codeql-action/init@v4
3934
with:
4035
languages: ${{ matrix.language }}
4136

42-
- name: Restore dependencies
37+
- name: Setup .NET
38+
uses: actions/setup-dotnet@v4
39+
with:
40+
dotnet-version: ${{ env.DOTNET_VERSION }}
41+
42+
- name: Restore
4343
run: dotnet restore Orleans.Graph.slnx
4444

4545
- name: Build

.github/workflows/release.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ on:
66
workflow_dispatch:
77

88
env:
9-
DOTNET_VERSION: '9.0.x'
9+
DOTNET_VERSION: '10.0.x'
10+
11+
permissions:
12+
contents: write
1013

1114
jobs:
1215
build:
@@ -32,17 +35,20 @@ jobs:
3235
echo "version=$VERSION" >> $GITHUB_OUTPUT
3336
echo "Version from Directory.Build.props: $VERSION"
3437
38+
- name: Restore local tools
39+
run: dotnet tool restore
40+
3541
- name: Restore dependencies
3642
run: dotnet restore Orleans.Graph.slnx
3743

3844
- name: Build
3945
run: dotnet build Orleans.Graph.slnx --configuration Release --no-restore
4046

4147
- name: Test
42-
run: dotnet test Orleans.Graph.slnx --configuration Release --no-build --verbosity normal
48+
run: dotnet test --solution Orleans.Graph.slnx --configuration Release --no-build --verbosity normal
4349

4450
- name: Pack NuGet packages
45-
run: dotnet pack ManagedCode.Orleans.Graph/ManagedCode.Orleans.Graph.csproj --configuration Release --no-build --output ./artifacts
51+
run: dotnet pack Orleans.Graph.slnx --configuration Release --no-build -p:IncludeSymbols=false -p:SymbolPackageFormat=snupkg --output ./artifacts
4652

4753
- name: Upload artifacts
4854
uses: actions/upload-artifact@v4

AGENTS.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ Update guidelines:
3232
- **Call Tracking**: Resolve outgoing call identities from the Orleans context (`SourceId`/interface metadata) instead of guessing via reflection order to avoid mislabelling callers.
3333
- **Configuration Flags**: Treat `AllowAll`/`DisallowAll` on `GrainCallsBuilder` as authoritative defaults; ensure runtime checks respect the builder’s chosen baseline before reporting violations.
3434
- **Testing Scope**: Exercise new behavior through the Orleans-hosted integration tests in `ManagedCode.Orleans.Graph.Tests`, covering both positive and negative paths to mirror real cluster flows.
35+
- **Test Framework**: Use TUnit for tests and Shouldly for assertions; do not introduce FluentAssertions, so the test style stays aligned with the newer ManagedCode Orleans projects.
36+
- **Migration Releases**: For major framework/package migrations, complete three strict code-review-and-fix iterations before README polish, feature additions, commit, push, and CI verification, so release branches are hardened before publication.
3537
- **Code Style**: Use enums or constants over magic literals, keep documentation and comments in English, and avoid template placeholders—name files and types for their real domain roles.
3638

3739

@@ -44,7 +46,7 @@ Update guidelines:
4446
- `Directory.Build.props` – shared project metadata, target framework, and packaging settings.
4547

4648
## Current Status
47-
The directed-graph engine, grain call filters, and builder DSL compile against .NET 9 and are validated by unit and integration tests. Recent fixes ensure additive transition rules, consistent caller identification, and respect for `AllowAll` defaults; coverage now guards against regressions in these areas.
49+
The directed-graph engine, grain call filters, and builder DSL compile against .NET 10 / Orleans 10 and are validated by TUnit unit and integration tests. Recent fixes ensure additive transition rules, consistent caller identification, respect for `AllowAll` defaults, and reentrant policy-cycle handling; coverage now guards against regressions in these areas.
4850

4951
## Next Steps
5052
- Expand test fixtures to cover mixed client/grain scenarios and additional reentrancy configurations.

Directory.Build.props

Lines changed: 47 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,53 @@
11
<Project>
2+
<PropertyGroup>
3+
<TargetFramework>net10.0</TargetFramework>
4+
<LangVersion>14</LangVersion>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
<Deterministic>true</Deterministic>
8+
<DebugType>embedded</DebugType>
9+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
10+
<EnableNETAnalyzers>true</EnableNETAnalyzers>
11+
<AnalysisLevel>latest-recommended</AnalysisLevel>
12+
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
13+
<NoWarn>$(NoWarn);CS1591;CA1707;CA1848;CA1859;CA1873</NoWarn>
14+
<Version>10.0.0</Version>
15+
<PackageVersion>$(Version)</PackageVersion>
16+
</PropertyGroup>
217

3-
<!--C# version-->
4-
<PropertyGroup>
5-
<TargetFramework>net9.0</TargetFramework>
6-
<LangVersion>13</LangVersion>
7-
<EnableNETAnalyzers>true</EnableNETAnalyzers>
8-
<Nullable>enable</Nullable>
9-
<DebugType>embedded</DebugType>
10-
<GenerateDocumentationFile>true</GenerateDocumentationFile>
11-
</PropertyGroup>
18+
<PropertyGroup>
19+
<Authors>ManagedCode</Authors>
20+
<Company>ManagedCode</Company>
21+
<Copyright>Copyright © 2021-$([System.DateTime]::Now.ToString(`yyyy`)) ManagedCode SAS</Copyright>
22+
<Product>ManagedCode.Orleans.Graph</Product>
23+
<RepositoryType>GitHub</RepositoryType>
24+
<RepositoryUrl>https://github.com/managedcode/Orleans.Graph</RepositoryUrl>
25+
<PackageProjectUrl>https://github.com/managedcode/Orleans.Graph</PackageProjectUrl>
26+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
27+
<PackageReadmeFile>README.md</PackageReadmeFile>
28+
<PackageIcon>logo.png</PackageIcon>
29+
<Description Condition="'$(Description)' == ''">Grain-to-grain call policy enforcement for Microsoft Orleans.</Description>
30+
<PackageTags>orleans;graph;grain-calls;call-policy;dotnet10</PackageTags>
31+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
32+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
33+
<IncludeSymbols>true</IncludeSymbols>
34+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
35+
<EnablePackageValidation>true</EnablePackageValidation>
36+
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
37+
</PropertyGroup>
1238

13-
<!--NuGet-->
14-
<PropertyGroup>
15-
<Authors>ManagedCode</Authors>
16-
<Copyright>Copyright © 2021-$([System.DateTime]::Now.ToString(`yyyy`)) ManagedCode SAS</Copyright>
17-
<EmbedUntrackedSources>true</EmbedUntrackedSources>
18-
<PublishRepositoryUrl>true</PublishRepositoryUrl>
19-
<IncludeSymbols>true</IncludeSymbols>
20-
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
21-
<RepositoryType>Github</RepositoryType>
22-
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
23-
<PackageIcon>logo.png</PackageIcon>
24-
<PackageLicenseExpression>MIT</PackageLicenseExpression>
25-
<EnablePackageValidation>true</EnablePackageValidation>
26-
<PackageReadmeFile>README.md</PackageReadmeFile>
39+
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true' or '$(CI)' == 'true' or '$(TF_BUILD)' == 'true'">
40+
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
41+
</PropertyGroup>
2742

28-
<RepositoryUrl>https://github.com/managedcode/Orleans.Graph</RepositoryUrl>
29-
<PackageProjectUrl>https://github.com/managedcode/Orleans.Graph</PackageProjectUrl>
30-
<Product>Managed Code - Orleans Graph</Product>
31-
<Version>9.0.0</Version>
32-
<PackageVersion>9.0.0</PackageVersion>
43+
<ItemGroup Condition="'$(IsPackable)' == 'true'">
44+
<None Include="$(MSBuildThisFileDirectory)README.md" Pack="true" PackagePath="\" Link="README.md" Visible="false" />
45+
<None Include="$(MSBuildThisFileDirectory)LICENSE" Pack="true" PackagePath="\" Link="LICENSE" Visible="false" />
46+
<None Include="$(MSBuildThisFileDirectory)logo.png" Pack="true" PackagePath="\" Link="logo.png" Visible="false" />
47+
</ItemGroup>
3348

34-
</PropertyGroup>
35-
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
36-
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
37-
</PropertyGroup>
38-
39-
<ItemGroup>
40-
<None Include="..\logo.png" Pack="true" Visible="false" PackagePath="/">
41-
<Link>logo.png</Link>
42-
</None>
43-
<None Include="..\README.md" Pack="true" Visible="false" PackagePath="/">
44-
<Link>README.md</Link>
45-
</None>
46-
</ItemGroup>
47-
48-
<ItemGroup>
49-
<PackageReference Include="DotNet.ReproducibleBuilds" Version="1.2.25">
50-
<PrivateAssets>all</PrivateAssets>
51-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
52-
</PackageReference>
53-
</ItemGroup>
49+
<ItemGroup>
50+
<PackageReference Include="DotNet.ReproducibleBuilds" PrivateAssets="all" />
51+
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="all" />
52+
</ItemGroup>
5453
</Project>

Directory.Packages.props

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<Project>
2+
<PropertyGroup>
3+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
4+
</PropertyGroup>
5+
6+
<ItemGroup>
7+
<PackageVersion Include="coverlet.collector" Version="10.0.0" />
8+
<PackageVersion Include="coverlet.msbuild" Version="10.0.0" />
9+
<PackageVersion Include="DotNet.ReproducibleBuilds" Version="2.0.2" />
10+
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="5.3.0" />
11+
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="5.3.0" />
12+
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.8" />
13+
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.8" />
14+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.5.1" />
15+
<PackageVersion Include="Microsoft.Orleans.Analyzers" Version="10.1.0" />
16+
<PackageVersion Include="Microsoft.Orleans.Client" Version="10.1.0" />
17+
<PackageVersion Include="Microsoft.Orleans.Runtime" Version="10.1.0" />
18+
<PackageVersion Include="Microsoft.Orleans.Sdk" Version="10.1.0" />
19+
<PackageVersion Include="Microsoft.Orleans.Serialization" Version="10.1.0" />
20+
<PackageVersion Include="Microsoft.Orleans.Serialization.Abstractions" Version="10.1.0" />
21+
<PackageVersion Include="Microsoft.Orleans.Server" Version="10.1.0" />
22+
<PackageVersion Include="Microsoft.Orleans.TestingHost" Version="10.1.0" />
23+
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="10.0.300" />
24+
<PackageVersion Include="Shouldly" Version="4.3.0" />
25+
<PackageVersion Include="TUnit" Version="1.44.39" />
26+
</ItemGroup>
27+
</Project>

ManagedCode.Orleans.Graph.Tests/AttributeCluster/TestAttributeClusterApplication.cs

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
using Orleans.TestingHost;
2-
using Xunit;
32

43
namespace ManagedCode.Orleans.Graph.Tests.AttributeCluster;
54

6-
[CollectionDefinition(nameof(TestAttributeClusterApplication))]
7-
public class TestAttributeClusterApplication : ICollectionFixture<TestAttributeClusterApplication>, IDisposable
5+
public class TestAttributeClusterApplication : IDisposable, IAsyncDisposable
86
{
7+
private bool _disposed;
8+
99
public TestCluster Cluster { get; }
1010

1111
public TestAttributeClusterApplication()
@@ -19,6 +19,25 @@ public TestAttributeClusterApplication()
1919

2020
public void Dispose()
2121
{
22+
if (_disposed)
23+
{
24+
return;
25+
}
26+
27+
_disposed = true;
2228
Cluster.Dispose();
29+
GC.SuppressFinalize(this);
30+
}
31+
32+
public async ValueTask DisposeAsync()
33+
{
34+
if (_disposed)
35+
{
36+
return;
37+
}
38+
39+
_disposed = true;
40+
await Cluster.DisposeAsync();
41+
GC.SuppressFinalize(this);
2342
}
2443
}

0 commit comments

Comments
 (0)