Skip to content

Commit b15f4e7

Browse files
committed
Introduce doc publishing via MkDocs, add custom CSS & assets, and refactor GitHub workflows
- Added `.github/workflows/docs.yml` for deploying MkDocs-based docs to GitHub Pages. - Introduced `docs/assets/styles.css` with minimal theme overrides. - Added new assets: `agenix-logo.svg`, `agenix-favicon.svg` under `docs/assets/logos`. - Updated `README.md` with improved formatting and consistent line breaks. - Added extensive documentation structure, including new pages and navigation. - Refactor license headers across multiple files for consistency.
1 parent 858943d commit b15f4e7

File tree

89 files changed

+3449
-1329
lines changed

Some content is hidden

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

89 files changed

+3449
-1329
lines changed

.editorconfig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,4 +152,7 @@ csharp_prefer_static_local_functions = true:suggestion
152152
csharp_style_prefer_switch_expression = true:suggestion
153153

154154
# Enable file header template
155-
file_header_template = unset
155+
# To auto-apply to existing files, run: dotnet format --severity warn
156+
# IDEs (Rider/VS) will insert this header automatically for new C# files.
157+
dotnet_diagnostic.IDE0073.severity = warning
158+
file_header_template = #region License\n// Copyright (c) 2025 Agenix\n//\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the "License");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an "AS IS" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n#endregion

.github/workflows/docs.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Docs
2+
3+
on:
4+
push:
5+
paths:
6+
- 'docs/**'
7+
- 'mkdocs.yml'
8+
pull_request:
9+
paths:
10+
- 'docs/**'
11+
- 'mkdocs.yml'
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: '3.x'
24+
cache: 'pip'
25+
26+
- name: Install MkDocs and plugins
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install -r requirements.txt
30+
31+
- name: Build site
32+
run: mkdocs build --strict
33+
34+
- name: Upload built site (PRs only)
35+
if: ${{ github.event_name == 'pull_request' }}
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: site
39+
path: site
40+
41+
deploy:
42+
# Deploy only on direct pushes to main or develop
43+
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop') }}
44+
needs: build
45+
runs-on: ubuntu-latest
46+
permissions:
47+
contents: write
48+
steps:
49+
- name: Checkout
50+
uses: actions/checkout@v4
51+
52+
- name: Set up Python
53+
uses: actions/setup-python@v5
54+
with:
55+
python-version: '3.x'
56+
cache: 'pip'
57+
58+
- name: Install MkDocs and plugins
59+
run: |
60+
python -m pip install --upgrade pip
61+
pip install -r requirements.txt
62+
63+
- name: Build site
64+
run: mkdocs build --strict
65+
66+
- name: Deploy to GitHub Pages
67+
uses: peaceiris/actions-gh-pages@v3
68+
with:
69+
github_token: ${{ secrets.GITHUB_TOKEN }}
70+
publish_branch: gh-pages
71+
publish_dir: ./site

Agenix.PlaywrightGrid.Domain.Tests/Agenix.PlaywrightGrid.Domain.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
<RootNamespace>Agenix.PlaywrightGrid.Domain.Tests</RootNamespace>
55
</PropertyGroup>
66
<ItemGroup>
7-
<ProjectReference Include="../Agenix.PlaywrightGrid.Domain/Agenix.PlaywrightGrid.Domain.csproj" />
7+
<ProjectReference Include="../Agenix.PlaywrightGrid.Domain/Agenix.PlaywrightGrid.Domain.csproj"/>
88
</ItemGroup>
99
</Project>

Agenix.PlaywrightGrid.Domain.Tests/LabelKeyTests.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
1-
using Agenix.PlaywrightGrid.Domain;
21
using NUnit.Framework;
2+
#region License
3+
// Copyright (c) 2025 Agenix
4+
//
5+
// SPDX-License-Identifier: Apache-2.0
6+
//
7+
// Licensed under the Apache License, Version 2.0 (the "License");
8+
// you may not use this file except in compliance with the License.
9+
// You may obtain a copy of the License at
10+
//
11+
// https://www.apache.org/licenses/LICENSE-2.0
12+
//
13+
// Unless required by applicable law or agreed to in writing, software
14+
// distributed under the License is distributed on an "AS IS" BASIS,
15+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
// See the License for the specific language governing permissions and
17+
// limitations under the License.
18+
#endregion
319

420
namespace Agenix.PlaywrightGrid.Domain.Tests;
521

Agenix.PlaywrightGrid.Domain.Tests/LabelMatcherTests.cs

Lines changed: 47 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
1+
#region License
2+
// Copyright (c) 2025 Agenix
3+
//
4+
// SPDX-License-Identifier: Apache-2.0
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// https://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
#endregion
18+
119
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using Agenix.PlaywrightGrid.Domain;
520
using NUnit.Framework;
621

722
namespace Agenix.PlaywrightGrid.Domain.Tests;
@@ -11,7 +26,11 @@ public class LabelMatcherTests
1126
private static LabelKey L(string s)
1227
{
1328
var opts = new LabelKeyParsingOptions { EnforceBrowserSecond = false };
14-
if (!LabelKey.TryParse(s, out var lk, opts)) throw new ArgumentException($"Invalid label: {s}");
29+
if (!LabelKey.TryParse(s, out var lk, opts))
30+
{
31+
throw new ArgumentException($"Invalid label: {s}");
32+
}
33+
1534
return lk!;
1635
}
1736

@@ -32,7 +51,9 @@ public void Trailing_Fallback_Drops_To_MinSegments_Default_2()
3251
{
3352
var requested = L("AppA:Chromium:UAT:EU");
3453
var available = new[] { L("AppA:Chromium"), L("AppA:Chromium:UAT") };
35-
var matcher = new LabelMatcher(new LabelMatchingOptions { TrailingFallbackEnabled = true, PrefixExpansionEnabled = false });
54+
var matcher =
55+
new LabelMatcher(
56+
new LabelMatchingOptions { TrailingFallbackEnabled = true, PrefixExpansionEnabled = false });
3657

3758
var match = matcher.TryMatch(requested, available);
3859
// exact missing; fallback from 4->3 matches 3-segment entry
@@ -45,7 +66,12 @@ public void Trailing_Fallback_Respects_MinSegmentsForFallback()
4566
{
4667
var requested = L("AppA:Chromium:UAT");
4768
var available = new[] { L("AppA:Chromium") };
48-
var matcher = new LabelMatcher(new LabelMatchingOptions { TrailingFallbackEnabled = true, MinSegmentsForFallback = 3, PrefixExpansionEnabled = false });
69+
var matcher = new LabelMatcher(new LabelMatchingOptions
70+
{
71+
TrailingFallbackEnabled = true,
72+
MinSegmentsForFallback = 3,
73+
PrefixExpansionEnabled = false
74+
});
4975

5076
var match = matcher.TryMatch(requested, available);
5177
Assert.That(match, Is.Null, "Should not fallback below 3 segments");
@@ -56,7 +82,9 @@ public void Prefix_Expansion_Picks_Shortest_More_Specific_Then_Lexicographical()
5682
{
5783
var requested = L("AppB:Chromium");
5884
var available = new[] { L("AppB:Chromium:UAT:x"), L("AppB:Chromium:UAT:y"), L("AppB:Chromium:UAT:zz") };
59-
var matcher = new LabelMatcher(new LabelMatchingOptions { PrefixExpansionEnabled = true, TrailingFallbackEnabled = false });
85+
var matcher =
86+
new LabelMatcher(
87+
new LabelMatchingOptions { PrefixExpansionEnabled = true, TrailingFallbackEnabled = false });
6088

6189
var match = matcher.TryMatch(requested, available);
6290
Assert.That(match, Is.Not.Null);
@@ -69,7 +97,12 @@ public void Wildcards_Disabled_Do_Not_Match_Asterisk_Segments()
6997
{
7098
var requested = L("AppA:*:UAT");
7199
var available = new[] { L("AppA:Firefox:UAT") };
72-
var matcher = new LabelMatcher(new LabelMatchingOptions { WildcardsEnabled = false, PrefixExpansionEnabled = true, TrailingFallbackEnabled = true });
100+
var matcher = new LabelMatcher(new LabelMatchingOptions
101+
{
102+
WildcardsEnabled = false,
103+
PrefixExpansionEnabled = true,
104+
TrailingFallbackEnabled = true
105+
});
73106

74107
var match = matcher.TryMatch(requested, available);
75108
Assert.That(match, Is.Null);
@@ -80,7 +113,12 @@ public void Wildcards_Enabled_Match_Any_Segment_In_Exact_And_Prefix()
80113
{
81114
var requested = L("AppA:*:UAT");
82115
var available = new[] { L("AppA:Firefox:UAT"), L("AppA:Chromium:UAT:EU") };
83-
var matcher = new LabelMatcher(new LabelMatchingOptions { WildcardsEnabled = true, TrailingFallbackEnabled = false, PrefixExpansionEnabled = true });
116+
var matcher = new LabelMatcher(new LabelMatchingOptions
117+
{
118+
WildcardsEnabled = true,
119+
TrailingFallbackEnabled = false,
120+
PrefixExpansionEnabled = true
121+
});
84122

85123
var match = matcher.TryMatch(requested, available);
86124
// Exact should win (3 segments) before prefix expansion to 4
Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,32 @@
1-
using System.Collections.Generic;
1+
#region License
2+
// Copyright (c) 2025 Agenix
3+
//
4+
// SPDX-License-Identifier: Apache-2.0
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// https://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
#endregion
218

319
namespace Agenix.PlaywrightGrid.Domain;
420

521
/// <summary>
6-
/// Central label matching strategy service.
7-
/// Implements ordered resolution: exact → trailing fallback → prefix expansion → optional wildcards.
22+
/// Central label matching strategy service.
23+
/// Implements ordered resolution: exact → trailing fallback → prefix expansion → optional wildcards.
824
/// </summary>
925
public interface ILabelMatcher
1026
{
1127
/// <summary>
12-
/// Attempts to find the best matching available label for the requested <see cref="LabelKey"/>.
13-
/// Returns null when no match is found according to the configured <see cref="LabelMatchingOptions"/>.
28+
/// Attempts to find the best matching available label for the requested <see cref="LabelKey" />.
29+
/// Returns null when no match is found according to the configured <see cref="LabelMatchingOptions" />.
1430
/// </summary>
1531
LabelKey? TryMatch(LabelKey requested, IEnumerable<LabelKey> available);
1632
}

0 commit comments

Comments
 (0)