Skip to content

Commit 4f1fc8c

Browse files
authored
V0.5.1/service update (#18)
🚚 move PackageReleaseNotesFile property to props file ✨ add guidelines for ai πŸ‘· updated ci to include codeql again ⬆️ bump dependencies πŸ’¬ updated community health pages πŸ—‚οΈ replace .sln with .slnx for modern solution structure πŸ“¦οΈ updated NuGet package definition
1 parent cc22c2b commit 4f1fc8c

14 files changed

Lines changed: 809 additions & 64 deletions

β€Ž.docfx/Dockerfile.docfxβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
ο»ΏARG NGINX_VERSION=1.29.3-alpine
1+
ο»ΏARG NGINX_VERSION=1.29.4-alpine
22

33
FROM --platform=$BUILDPLATFORM nginx:${NGINX_VERSION} AS base
44
RUN rm -rf /usr/share/nginx/html/*
55

6-
FROM --platform=$BUILDPLATFORM codebeltnet/docfx:2.78.3 AS build
6+
FROM --platform=$BUILDPLATFORM codebeltnet/docfx:2.78.4 AS build
77

88
ADD [".", "docfx"]
99

β€Ž.docfx/docfx.jsonβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
],
4545
"globalMetadata": {
4646
"_appTitle": "Shared Kernel (DDD) for .NET",
47-
"_appFooter": "<span>Generated by <strong>DocFX</strong>. Copyright 2024-2025 Geekle. All rights reserved. Code with passion; love your work; deploy with confidence πŸ‘¨β€πŸ’»οΈπŸ”₯β€οΈπŸš€πŸ˜Ž</span>",
47+
"_appFooter": "<span>Generated by <strong>DocFX</strong>. Copyright 2024-2026 Geekle. All rights reserved. Code with passion; love your work; deploy with confidence πŸ‘¨β€πŸ’»οΈπŸ”₯β€οΈπŸš€πŸ˜Ž</span>",
4848
"_appLogoPath": "images/50x50.png",
4949
"_appFaviconPath": "images/favicon.ico",
5050
"_googleAnalyticsTagId": "G-NQMBRNRZ5X",

β€Ž.github/copilot-instructions.mdβ€Ž

Lines changed: 610 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
---
2+
mode: agent
3+
description: 'Writing Performance Benchmarks'
4+
---
5+
6+
# Benchmark Fixture Prompt (Tuning Benchmarks)
7+
8+
This prompt defines how to generate performance tests (β€œbenchmarks”) for a project/solution using BenchmarkDotNet.
9+
Benchmarks are *not* unit tests β€” they are micro- or component-level performance measurements that belong under the `tuning/` directory and follow strict conventions.
10+
11+
Copilot must follow these guidelines when generating benchmark fixtures.
12+
13+
---
14+
15+
## 1. Naming and Placement
16+
17+
- All benchmark projects live under the `tuning/` folder.
18+
Examples:
19+
- `tuning/<ProjectName>.Benchmarks/`
20+
- `tuning/<ProjectName>.Console.Benchmarks/`
21+
22+
- **Namespaces must NOT end with `.Benchmarks`.**
23+
They must mirror the production assembly’s namespace.
24+
25+
Example:
26+
If benchmarking a type inside `YourProject.Console`, then:
27+
28+
```csharp
29+
namespace YourProject.Console
30+
{
31+
public class Sha512256Benchmark { … }
32+
}
33+
```
34+
35+
* **Benchmark class names must end with `Benchmark`.**
36+
Example: `DateSpanBenchmark`, `FowlerNollVoBenchmark`.
37+
38+
* Benchmark files should be located in the matching benchmark project
39+
(e.g., benchmarks for `YourProject.Console` go in `YourProject.Console.Benchmarks.csproj`).
40+
41+
* In the `.csproj` for each benchmark project, set the root namespace to the production namespace, for example:
42+
43+
```xml
44+
<RootNamespace>YourProject.Console</RootNamespace>
45+
```
46+
47+
---
48+
49+
## 2. Attributes and Configuration
50+
51+
Each benchmark class should use:
52+
53+
```csharp
54+
[MemoryDiagnoser]
55+
[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)]
56+
```
57+
58+
Optional but strongly recommended where meaningful:
59+
60+
* `[Params(...)]` β€” define small, medium, large input sizes.
61+
* `[GlobalSetup]` β€” deterministic initialization of benchmark data.
62+
* `[Benchmark(Description = "...")]` β€” always add descriptions.
63+
* `[Benchmark(Baseline = true)]` β€” when comparing two implementations.
64+
65+
Avoid complex global configs; prefer explicit attributes inside the class.
66+
67+
---
68+
69+
## 3. Structure and Best Practices
70+
71+
A benchmark fixture must:
72+
73+
* Measure a **single logical operation** per benchmark method.
74+
* Avoid I/O, networking, disk access, logging, or side effects.
75+
* Avoid expensive setup inside `[Benchmark]` methods.
76+
* Use deterministic data (e.g., seeded RNG or predefined constants).
77+
* Use `[GlobalSetup]` to allocate buffers, random payloads, or reusable test data only once.
78+
* Avoid shared mutable state unless reset per iteration.
79+
80+
Use representative input sizes such as:
81+
82+
```csharp
83+
[Params(8, 256, 4096)]
84+
public int Count { get; set; }
85+
```
86+
87+
BenchmarkDotNet will run each benchmark for each parameter value.
88+
89+
---
90+
91+
## 4. Method Naming Conventions
92+
93+
Use descriptive names that communicate intent:
94+
95+
* `Parse_Short`
96+
* `Parse_Long`
97+
* `ComputeHash_Small`
98+
* `ComputeHash_Large`
99+
* `Serialize_Optimized`
100+
* `Serialize_Baseline`
101+
102+
When comparing approaches, always list them clearly and tag one as the baseline.
103+
104+
---
105+
106+
## 5. Example Benchmark Fixture
107+
108+
```csharp
109+
using BenchmarkDotNet.Attributes;
110+
using BenchmarkDotNet.Configs;
111+
112+
namespace YourProject
113+
{
114+
[MemoryDiagnoser]
115+
[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)]
116+
public class SampleOperationBenchmark
117+
{
118+
[Params(8, 256, 4096)]
119+
public int Count { get; set; }
120+
121+
private byte[] _payload;
122+
123+
[GlobalSetup]
124+
public void Setup()
125+
{
126+
_payload = new byte[Count];
127+
// deterministic initialization
128+
}
129+
130+
[Benchmark(Baseline = true, Description = "Operation - baseline")]
131+
public int Operation_Baseline() => SampleOperation.Process(_payload);
132+
133+
[Benchmark(Description = "Operation - optimized")]
134+
public int Operation_Optimized() => SampleOperation.ProcessOptimized(_payload);
135+
}
136+
}
137+
```
138+
139+
---
140+
141+
## 6. Reporting and CI
142+
143+
* Benchmark projects live exclusively under `tuning/`. They must not affect production builds.
144+
* Heavy BenchmarkDotNet runs should *not* run in CI unless explicitly configured.
145+
* Reports are produced by the benchmark runner and stored under the configured artifacts directory.
146+
147+
---
148+
149+
## 7. Additional Guidelines
150+
151+
* Keep benchmark fixtures focused and readable.
152+
* Document non-obvious reasoning in short comments.
153+
* Prefer realistic but deterministic data sets.
154+
* When benchmarks reveal regressions or improvements, reference the associated PR or issue in a comment.
155+
* Shared benchmark helpers belong in `tuning/` projects, not in production code.
156+
157+
---
158+
159+
## Final Notes
160+
161+
* Benchmarks are performance tests, not unit tests.
162+
* Use `[Benchmark]` only for pure performance measurement.
163+
* Avoid `MethodImplOptions.NoInlining` unless absolutely necessary.
164+
* Use small sets of meaningful benchmark scenarios β€” avoid combinatorial explosion.
Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
name: Shared Kernel CI/CD Pipeline
1+
name: Shared Kernel CI Pipeline
22
on:
33
pull_request:
44
branches: [main]
5-
paths-ignore:
6-
- .codecov/**
7-
- .docfx/**
8-
- .nuget/**
9-
- '**/*.md'
105
workflow_dispatch:
116
inputs:
127
configuration:
@@ -50,7 +45,7 @@ jobs:
5045
strategy:
5146
fail-fast: false
5247
matrix:
53-
os: [ubuntu-24.04, windows-2022]
48+
os: [ubuntu-24.04, windows-2025, ubuntu-24.04-arm, windows-11-arm]
5449
configuration: [Debug, Release]
5550
uses: codebeltnet/jobs-dotnet-test/.github/workflows/default.yml@v3
5651
with:

β€Ž.nuget/Codebelt.SharedKernel/PackageReleaseNotes.txtβ€Ž

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Version: 0.5.1
2+
Availability: .NET 10 and .NET 9
3+
Β 
4+
# ALM
5+
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)
6+
Β 
17
Version: 0.5.0
28
Availability: .NET 10 and .NET 9
39

β€ŽCHANGELOG.mdβ€Ž

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
44

55
For more details, please refer to `PackageReleaseNotes.txt` on a per assembly basis in the `.nuget` folder.
66

7+
## [0.5.1] - 2026-01-24
8+
9+
This is a service update that focuses on package dependencies.
10+
711
## [0.5.0] - 2025-11-15
812

913
This is a major release that focuses on adapting the latest `.NET 10` release (LTS) in exchange for current `.NET 8` (LTS).

β€ŽCodebelt.SharedKernel.slnβ€Ž

Lines changed: 0 additions & 39 deletions
This file was deleted.

β€ŽCodebelt.SharedKernel.slnxβ€Ž

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Solution>
2+
<Folder Name="/src/">
3+
<Project Path="src/Codebelt.SharedKernel/Codebelt.SharedKernel.csproj" />
4+
</Folder>
5+
<Folder Name="/test/">
6+
<Project Path="test/Codebelt.SharedKernel.Tests/Codebelt.SharedKernel.Tests.csproj" />
7+
</Folder>
8+
</Solution>

β€ŽDirectory.Build.propsβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<IsMainAuthor Condition="'$(EMAIL)' == 'michael@geekle.io'">true</IsMainAuthor>
55
<SkipSignAssembly>false</SkipSignAssembly>
66
<LangVersion>latest</LangVersion>
7+
<PackageReleaseNotesFile>..\..\.nuget\$(MSBuildProjectName)\PackageReleaseNotes.txt</PackageReleaseNotesFile>
78
</PropertyGroup>
89

910
<PropertyGroup Condition="'$(CI)' == 'true'">
@@ -13,7 +14,7 @@
1314

1415
<PropertyGroup Condition="'$(IsTestProject)' == 'false'">
1516
<TargetFrameworks>net10.0;net9.0</TargetFrameworks>
16-
<Copyright>Copyright Β© Geekle 2024-2025. All rights reserved.</Copyright>
17+
<Copyright>Copyright Β© Geekle 2024-2026. All rights reserved.</Copyright>
1718
<Authors>gimlichael</Authors>
1819
<Company>Geekle</Company>
1920
<Product>Codebelt Shared Kernel (DDD)</Product>

0 commit comments

Comments
Β (0)