Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
130fd61
Upgrade to .NET 8.0 and update dependencies
HowardvanRooijen Jun 6, 2025
f8cd4fe
Update dependencies and migrate to ReqnRoll framework
HowardvanRooijen Jun 6, 2025
c01338f
Add null-forgiving operators to configuration retrievals
HowardvanRooijen Jun 6, 2025
eb47ff3
Migrate to ZeroFailed
JamesDawson Jun 6, 2025
15f6dea
Ensure build triggers work before & after we rename the default branch
JamesDawson Jun 6, 2025
4496c8b
Update dependencies and clean up project files
HowardvanRooijen Jun 9, 2025
9d0a4a2
Re-generated package lock files to resolve 'dotnet restore' issues
JamesDawson Jun 9, 2025
540a9e9
Switch to matrix build
JamesDawson Jun 9, 2025
224e661
Merge branch 'master' into features/dotnet-8-update
HowardvanRooijen Jun 9, 2025
282165c
Fix build matrix config
JamesDawson Jun 9, 2025
c22499d
Investigating lack of tests under Linux
JamesDawson Jun 10, 2025
4927da5
Remove ADO YAML pipelines
JamesDawson Jun 10, 2025
694a660
Investigating lack of tests under Windows
JamesDawson Jun 10, 2025
f131b26
Test linux-only build
JamesDawson Jun 10, 2025
8e5b95e
Test quote escaping when setting test loggers
JamesDawson Jun 10, 2025
b9ac5b3
Re-enable cross-os caching
JamesDawson Jun 10, 2025
3542c7e
Add IsTestProject property to project file
HowardvanRooijen Jun 10, 2025
3d2cf48
Merge branch 'features/dotnet-8-update' of https://github.com/marain-…
HowardvanRooijen Jun 10, 2025
602748d
Fix loggers path for debug copy of testing task
JamesDawson Jun 10, 2025
5b59624
Disable debug tasks to verify whether the quoting changes made any di…
JamesDawson Jun 10, 2025
92e078b
Remove debug task now Linux test results are confirmed as working wit…
JamesDawson Jun 10, 2025
4f54981
Reinstate running tests under windows
JamesDawson Jun 10, 2025
4410ca5
Update JSON handling and add new package references
HowardvanRooijen Jun 10, 2025
0ac9ea8
Merge branch 'features/dotnet-8-update' of https://github.com/marain-…
HowardvanRooijen Jun 10, 2025
79541fe
Update menes
HowardvanRooijen Jun 11, 2025
69de8d3
Replace Newtonsoft.Json with System.Text.Json
HowardvanRooijen Jun 11, 2025
b95c347
Fix some serialization issues
idg10 Jun 12, 2025
dcb1a9c
Fix various manifest deserialization issues
idg10 Jun 13, 2025
a114e3b
Migrate from System.CommandLine to Spectre.Cli
HowardvanRooijen Jun 13, 2025
cfe8eca
Remove unused method
HowardvanRooijen Jun 13, 2025
9a4a34d
Refactor Table initialization and improve readability
HowardvanRooijen Jun 13, 2025
c4e338b
Add release notes for Marain.TenantManagement v4.0 with major updates…
HowardvanRooijen Jun 13, 2025
d640829
Update IMM scores
HowardvanRooijen Jun 13, 2025
50f0f13
Update to new tenancy client
jongeorge1 Oct 2, 2025
8ad1223
Switch to new tenancy provider and fix up CLI
jongeorge1 Oct 6, 2025
b5ba914
Remove Menes reference and tweak exception handling
jongeorge1 Oct 6, 2025
1eb825f
Update to latest alpha of tenancy client
jongeorge1 Oct 7, 2025
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
94 changes: 94 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: build
on:
push:
branches:
- main
- master
tags:
- '*'
pull_request:
branches:
- main
- master
workflow_dispatch:
inputs:
forcePublish:
description: When true the Publish stage will always be run, otherwise it only runs for tagged versions.
required: false
default: false
type: boolean
forcePublicNugetDestination:
description: When true the NuGet Publish destination will always be set to nuget.org. (Normally, force publishing publishes to the private feed on GitHub.)
required: false
default: false
type: boolean
skipCleanup:
description: When true the pipeline clean-up stage will not be run. For example, the cache used between pipeline stages will be retained.
required: false
default: false
type: boolean

concurrency:
group: ${{ github.workflow }}-${{ github.sha }}
cancel-in-progress: true

permissions:
actions: write # enable cache clean-up
checks: write # enable test result annotations
contents: write # enable creating releases
issues: read
packages: write # enable publishing packages
pull-requests: write # enable test result annotations

jobs:
prepareConfig:
name: Prepare Configuration
runs-on: ubuntu-latest
outputs:
RESOLVED_ENV_VARS: ${{ steps.prepareEnvVarsAndSecrets.outputs.environmentVariablesYamlBase64 }}
RESOLVED_SECRETS: ${{ steps.prepareEnvVarsAndSecrets.outputs.secretsYamlBase64 }}
steps:
# Declare any environment variables and/or secrets that need to be available inside the build process
- uses: endjin/Endjin.RecommendedPractices.GitHubActions/actions/prepare-env-vars-and-secrets@main
id: prepareEnvVarsAndSecrets
with:
environmentVariablesYaml: |
ZF_NUGET_PUBLISH_SOURCE: ${{ (startsWith(github.ref, 'refs/tags/') || github.event.inputs.forcePublicNugetDestination == 'true') && 'https://api.nuget.org/v3/index.json' || format('https://nuget.pkg.github.com/{0}/index.json', github.repository_owner) }}
secretsYaml: |
NUGET_API_KEY: "${{ startsWith(github.ref, 'refs/tags/') && secrets.NUGET_APIKEY || secrets.BUILD_PUBLISHER_PAT }}"
AzureServicesAuthConnectionString: RunAs=Developer;DeveloperTool=AzureCli
TenancyClient__TenancyServiceBaseUri: ${{ vars.TESTS_MARAINTENANCYBASEURL }}
TenancyClient__ResourceIdForMsiAuthentication: ${{ vars.TESTS_MARAINTENANCYRESOURCEIDFORMSIAUTHENTICATION }}
secretsEncryptionKey: ${{ secrets.SHARED_WORKFLOW_KEY }}

build:
needs: prepareConfig
uses: endjin/Endjin.RecommendedPractices.GitHubActions/.github/workflows/scripted-build-matrix-pipeline.yml@main
with:
netSdkVersion: '8.x'
# additionalNetSdkVersion: '9.x'
# workflow_dispatch inputs are always strings, the type property is just for the UI
forcePublish: ${{ github.event.inputs.forcePublish == 'true' }}
skipCleanup: ${{ github.event.inputs.skipCleanup == 'true' }}
enableCrossOsCaching: true
testPhaseMatrixJson: |
{
"os": ["windows-latest", "ubuntu-latest"],
"dotnetFramework": ["net8.0"]
}
# testArtifactName: ''
# testArtifactPath: ''
compilePhaseEnv: ${{ needs.prepareConfig.outputs.RESOLVED_ENV_VARS }}
testPhaseEnv: ${{ needs.prepareConfig.outputs.RESOLVED_ENV_VARS }}
packagePhaseEnv: ${{ needs.prepareConfig.outputs.RESOLVED_ENV_VARS }}
publishPhaseEnv: ${{ needs.prepareConfig.outputs.RESOLVED_ENV_VARS }}
secrets:
compilePhaseAzureCredentials: ${{ secrets.AZURE_READER_CREDENTIALS }}
testPhaseAzureCredentials: ${{ secrets.TESTS_KV_READER_CREDENTIALS }}
# packagePhaseAzureCredentials: ${{ secrets.AZURE_PUBLISH_CREDENTIALS }}
# publishPhaseAzureCredentials: ${{ secrets.AZURE_PUBLISH_CREDENTIALS }}
# compilePhaseSecrets: ${{ needs.prepareConfig.outputs.RESOLVED_SECRETS }}
testPhaseSecrets: ${{ needs.prepareConfig.outputs.RESOLVED_SECRETS }}
# packagePhaseSecrets: ${{ needs.prepareConfig.outputs.RESOLVED_SECRETS }}
publishPhaseSecrets: ${{ needs.prepareConfig.outputs.RESOLVED_SECRETS }}
secretsEncryptionKey: ${{ secrets.SHARED_WORKFLOW_KEY }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -345,4 +345,5 @@ appsettings.json
# Scripted build migration
_codeCoverage/
_packages/
*.sbom.*
*.sbom.*
.zf/extensions/
70 changes: 70 additions & 0 deletions .zf/config.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<#
This example demonstrates a software build process using the 'ZeroFailed.Build.DotNet' extension
to provide the features needed when building a .NET solutions.
#>

$zerofailedExtensions = @(
@{
# References the extension from its GitHub repository. If not already installed, use latest version from 'main' will be downloaded.
Name = "ZeroFailed.Build.DotNet"
GitRepository = "https://github.com/zerofailed/ZeroFailed.Build.DotNet"
GitRef = "main"
}
)

# Load the tasks and process
. ZeroFailed.tasks -ZfPath $here/.zf


#
# Build process control options
#
$SkipInit = $false
$SkipVersion = $false
$SkipBuild = $false
$CleanBuild = $Clean
$SkipTest = $false
$SkipTestReport = $false
$SkipAnalysis = $false
$SkipPackage = $false

#
# Build process configuration
#
$SolutionToBuild = (Resolve-Path (Join-Path $here "Solutions/Marain.TenantManagement.sln")).Path
$ProjectsToPublish = @(
"Solutions/Marain.TenantManagement.Cli/Marain.TenantManagement.Cli.csproj"
)
$NuSpecFilesToPackage = @()
$NugetPublishSource = property ZF_NUGET_PUBLISH_SOURCE "$here/_local-nuget-feed"
$IncludeAssembliesInCodeCoverage = "Marain*"
$ExcludeAssembliesInCodeCoverage = ""


# Customise the build process

task . FullBuild


#
# Build Process Extensibility Points - uncomment and implement as required
#

# task RunFirst {}
# task PreInit {}
# task PostInit {}
# task PreVersion {}
# task PostVersion {}
# task PreBuild {}
# task PostBuild {}
# task PreTest {}
# task PostTest {}
# task PreTestReport {}
# task PostTestReport {}
# task PreAnalysis {}
# task PostAnalysis {}
# task PrePackage {}
# task PostPackage {}
# task PrePublish {}
# task PostPublish {}
# task RunLast {}
2 changes: 1 addition & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ branches:
- feature
- support
- hotfix
next-version: "3.1"
next-version: "4.0"

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Import Project="$(EndjinProjectPropsPath)" Condition="$(EndjinProjectPropsPath) != ''" />

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>true</IsPackable>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand All @@ -15,12 +15,12 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Corvus.Testing.SpecFlow" Version="2.0.1" />
<PackageReference Include="Endjin.RecommendedPractices.GitHub" Version="2.1.5">
<PackageReference Include="Corvus.Testing.ReqnRoll" Version="4.0.5" />
<PackageReference Include="Endjin.RecommendedPractices.GitHub" Version="2.1.18">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="[6.0.*,)" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="[8.0.*,)" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ namespace Marain.TenantManagement.Testing
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using System.Threading.Tasks;

using Corvus.Extensions.Json;
using Corvus.Json;
using Corvus.Json.Serialization;
using Corvus.Tenancy;
using Corvus.Tenancy.Exceptions;

using Newtonsoft.Json;

/// <summary>
/// In-memory implementation of ITenantProvider.
/// </summary>
Expand All @@ -40,7 +39,7 @@ namespace Marain.TenantManagement.Testing
/// </remarks>
public class InMemoryTenantProvider : ITenantStore
{
private readonly IJsonSerializerSettingsProvider jsonSerializerSettingsProvider;
private readonly IJsonSerializerOptionsProvider jsonSerializerOptionsProvider;
private readonly List<StoredTenant> allTenants = new();
private readonly Dictionary<string, List<string>> tenantsByParent = new();
private readonly IPropertyBagFactory propertyBagFactory;
Expand All @@ -49,15 +48,15 @@ public class InMemoryTenantProvider : ITenantStore
/// Creates a new instance of the <see cref="InMemoryTenantProvider"/> class.
/// </summary>
/// <param name="rootTenant">The root tenant.</param>
/// <param name="jsonSerializerSettingsProvider">The serialization settings provider.</param>
/// <param name="jsonSerializerOptionsProvider">The serialization settings provider.</param>
/// <param name="propertyBagFactory">Provides the ability to create and modify property bags.</param>
public InMemoryTenantProvider(
RootTenant rootTenant,
IJsonSerializerSettingsProvider jsonSerializerSettingsProvider,
IJsonSerializerOptionsProvider jsonSerializerOptionsProvider,
IPropertyBagFactory propertyBagFactory)
{
this.Root = rootTenant;
this.jsonSerializerSettingsProvider = jsonSerializerSettingsProvider;
this.jsonSerializerOptionsProvider = jsonSerializerOptionsProvider;
this.propertyBagFactory = propertyBagFactory;
}

Expand All @@ -81,7 +80,7 @@ public async Task<ITenant> CreateWellKnownChildTenantAsync(string parentTenantId

List<string> childrenList = this.GetChildren(parent.Id);
childrenList.Add(newTenant.Id);
this.allTenants.Add(new StoredTenant(newTenant, this.jsonSerializerSettingsProvider.Instance));
this.allTenants.Add(new StoredTenant(newTenant, this.jsonSerializerOptionsProvider.Instance));

return newTenant;
}
Expand Down Expand Up @@ -193,7 +192,7 @@ public List<string> GetChildren(string parentId)
{
if (!this.tenantsByParent.TryGetValue(parentId, out List<string>? children))
{
children = new List<string>();
children = [];
this.tenantsByParent.Add(parentId, children);
}

Expand All @@ -207,12 +206,12 @@ public List<string> GetChildren(string parentId)
/// </summary>
private class StoredTenant
{
private readonly JsonSerializerSettings settings;
private readonly JsonSerializerOptions options;
private string tenant = string.Empty;

public StoredTenant(ITenant tenant, JsonSerializerSettings settings)
public StoredTenant(ITenant tenant, JsonSerializerOptions options)
{
this.settings = settings;
this.options = options;
this.Id = tenant.Id;
this.Name = tenant.Name;
this.Tenant = tenant;
Expand All @@ -224,8 +223,8 @@ public StoredTenant(ITenant tenant, JsonSerializerSettings settings)

public ITenant Tenant
{
get => JsonConvert.DeserializeObject<Tenant>(this.tenant, this.settings)!;
set => this.tenant = JsonConvert.SerializeObject(value, this.settings);
get => JsonSerializer.Deserialize<Tenant>(this.tenant, this.options)!;
set => this.tenant = JsonSerializer.Serialize(value, this.options);
}
}
}
Expand Down
Loading
Loading