Skip to content

Commit 75f423e

Browse files
petesramekPete Sramekgithub-actions[bot]dependabot[bot]Copilot
authored
Complete rewrite and v1.0 release preparation (#146)
## Complete rewrite and v1.0 release preparation This PR represents a full rewrite of the PolylineAlgorithm library, modernizing the API surface, improving extensibility, and preparing for a stable v1.0 release targeting .NET Standard 2.1+. --- ### Breaking Changes / New Public API - **New generic interfaces** `IPolylineEncoder<TCoordinate, TPolyline>` and `IPolylineDecoder<TPolyline, TCoordinate>` replace the old encoding abstraction, allowing callers to use any coordinate and polyline representation. - **Abstract base classes** `AbstractPolylineEncoder<TCoordinate, TPolyline>` and `AbstractPolylineDecoder<TPolyline, TCoordinate>` provide the shared encoding/decoding algorithm; consumers override only `GetLatitude`, `GetLongitude`, `CreatePolyline` (encoder) or `CreateCoordinate`, `GetReadOnlyMemory` (decoder). - **Extension methods** `PolylineEncoderExtensions` and `PolylineDecoderExtensions` add convenience overloads for `List<T>` and arrays. - **`PolylineEncoding`** static utility class exposes low-level normalization, validation, encoding and decoding primitives. - **`PolylineEncodingOptions`** and **`PolylineEncodingOptionsBuilder`** expose configurable precision, stack-alloc buffer limit and `ILoggerFactory` integration. - **`InvalidPolylineException`** added for descriptive error reporting on malformed input. - All `Encode`/`Decode` methods accept an optional `CancellationToken`. ### Other Changes - Integrated `Microsoft.Extensions.Logging` support for diagnostics / CI audit trails. - Added `PolylineAlgorithm.NetTopologySuite.Sample` demonstrating integration with NetTopologySuite. - Comprehensive XML doc comments on all public APIs. - Updated README, CONTRIBUTING, AGENTS and all guide docs under `api-reference/guide/` (getting-started, advanced-scenarios, configuration, FAQ). - DocFX API reference updated for v1.0 under `api-reference/1.0/`. - Updated unit tests and benchmarks. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Pete Sramek <petr.sramek@dropoutcoder.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent a71090d commit 75f423e

147 files changed

Lines changed: 9038 additions & 4969 deletions

File tree

Some content is hidden

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

.editorconfig

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ csharp_prefer_simple_using_statement = false
131131
csharp_prefer_system_threading_lock = true
132132
csharp_style_namespace_declarations = file_scoped
133133
csharp_style_prefer_method_group_conversion = false
134-
csharp_style_prefer_primary_constructors = true
134+
csharp_style_prefer_primary_constructors = false
135135
csharp_style_prefer_top_level_statements = false
136136

137137
# Expression-level preferences
@@ -270,3 +270,7 @@ dotnet_naming_style.underscore_camel_case.required_prefix = _
270270
dotnet_naming_style.underscore_camel_case.required_suffix =
271271
dotnet_naming_style.underscore_camel_case.word_separator =
272272
dotnet_naming_style.underscore_camel_case.capitalization = camel_case
273+
274+
# Public API analyzer
275+
276+
dotnet_public_api_analyzer.require_api_files = true

.github/actions/documentation/docfx-build/action.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,10 @@ inputs:
2121
runs:
2222
using: composite
2323
steps:
24-
- name: 'Checkout ${{ github.head_ref || github.ref }}'
25-
uses: actions/checkout@v5
2624
- name: Dotnet Setup
2725
uses: actions/setup-dotnet@v4
2826
with:
29-
dotnet-version: ${{ env.dotnet-sdk-version }}
27+
dotnet-version: ${{ inputs.dotnet_sdk_version }}
3028
- name: 'testing variables'
3129
shell: bash
3230
run: |
@@ -41,7 +39,7 @@ runs:
4139
run: docfx build ${{ inputs.docfx-json-manifest }}
4240
shell: bash
4341
- name: Upload artifact
44-
uses: actions/upload-artifact@v4
42+
uses: actions/upload-artifact@v7
4543
with:
4644
name: ${{ inputs.artifact-name }}
4745
path: ${{ inputs.output-directory }}

.github/actions/documentation/docfx-metadata/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ runs:
2626
using: composite
2727
steps:
2828
- name: 'Checkout ${{ github.head_ref || github.ref }}'
29-
uses: actions/checkout@v5
29+
uses: actions/checkout@v6
3030
- name: Dotnet Setup
3131
uses: actions/setup-dotnet@v4
3232
with:
@@ -59,7 +59,7 @@ runs:
5959
mkdir -p ${{ inputs.output-directory }}
6060
cp -r ${{ inputs.temporary-directory }}/* ${{ inputs.output-directory }}
6161
- name: 'Upload artifact'
62-
uses: actions/upload-artifact@v4
62+
uses: actions/upload-artifact@v7
6363
with:
6464
name: ${{ inputs.artifact-name }}
6565
path: ${{ inputs.output-directory }}

.github/actions/git/push-changes/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ runs:
2828
using: "composite"
2929
steps:
3030
- name: 'Checkout ${{ github.head_ref || github.ref }}'
31-
uses: actions/checkout@v5
31+
uses: actions/checkout@v6
3232

3333
- name: Dotnet Setup
3434
uses: actions/setup-dotnet@v4
@@ -37,7 +37,7 @@ runs:
3737

3838
- name: Download a single artifact
3939
if: ${{ inputs.artifact-name != '' }}
40-
uses: actions/download-artifact@v4
40+
uses: actions/download-artifact@v8
4141
with:
4242
name: ${{ inputs.artifact-name }}
4343
path: ${{ inputs.working-directory }}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: 'Lock branch'
2+
author: 'Pete Sramek'
3+
description: 'Apply branch protection to prevent direct pushes. Requires PRs with at least one approval.'
4+
inputs:
5+
branch:
6+
description: 'Branch name to lock.'
7+
required: true
8+
9+
runs:
10+
using: composite
11+
steps:
12+
- name: 'Lock branch ${{ inputs.branch }}'
13+
shell: bash
14+
env:
15+
GH_TOKEN: ${{ github.token }}
16+
run: |
17+
if ! gh api --method PUT /repos/${{ github.repository }}/branches/${{ inputs.branch }}/protection \
18+
--input - << 'EOF'
19+
{
20+
"required_status_checks": null,
21+
"enforce_admins": false,
22+
"required_pull_request_reviews": {
23+
"dismiss_stale_reviews": true,
24+
"require_code_owner_reviews": false,
25+
"required_approving_review_count": 1
26+
},
27+
"restrictions": null,
28+
"allow_force_pushes": false,
29+
"allow_deletions": false,
30+
"lock_branch": false
31+
}
32+
EOF
33+
then
34+
echo "::error::Failed to apply branch protection to '${{ inputs.branch }}'. Ensure the token has 'administration: write' permission and the branch exists."
35+
exit 1
36+
fi
37+
echo "🔒 Branch '${{ inputs.branch }}' is now protected." >> $GITHUB_STEP_SUMMARY
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: 'Unlock branch'
2+
author: 'Pete Sramek'
3+
description: 'Remove branch protection to allow a workflow to push directly. Always re-lock after the operation.'
4+
inputs:
5+
branch:
6+
description: 'Branch name to unlock.'
7+
required: true
8+
9+
runs:
10+
using: composite
11+
steps:
12+
- name: 'Unlock branch ${{ inputs.branch }}'
13+
shell: bash
14+
env:
15+
GH_TOKEN: ${{ github.token }}
16+
run: |
17+
gh api --method DELETE /repos/${{ github.repository }}/branches/${{ inputs.branch }}/protection || true
18+
echo "🔓 Branch protection removed from '${{ inputs.branch }}'." >> $GITHUB_STEP_SUMMARY

.github/actions/github/create-release/action.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'Create GitHub release'
1+
name: 'Create GitHub release'
22
author: 'Pete Sramek'
33
description: 'Create GitHub release.'
44
inputs:
@@ -17,14 +17,18 @@ runs:
1717
using: composite
1818
steps:
1919
- name: 'Checkout ${{ github.head_ref || github.ref }}'
20-
uses: actions/checkout@v5
20+
uses: actions/checkout@v6
2121
- run: |
2222
echo "release-version=${{ inputs.release-version }}"
2323
echo "is-preview=${{ inputs.is-preview }}"
2424
echo "preview-argument=${{ inputs.is-preview == 'true' && '--prerelease' || '' }}"
2525
echo "notes-start-tag=${{ inputs.notes-start-tag }}"
2626
echo "notes-start-tag-argument="${{ inputs.notes-start-tag != '' && '--notes-start-tag $(inputs.notes-start-tag)' || '' }}"
2727
shell: bash
28+
- name: 'Create git tag ${{ env.release-version }}'
29+
shell: bash
30+
run: |
31+
git tag -a ${{ env.release-version }} -m "${{ env.release-version }}"
2832
- name: 'Create GitHub release PolylineAlgorithm ${{ env.release-version }}'
2933
shell: bash
3034
env:

.github/actions/github/write-file-to-summary/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'Write file to step summary'
1+
name: 'Write file to step summary'
22
author: 'Pete Sramek'
33
description: 'Writes file contents to step summary.'
44
inputs:
@@ -17,7 +17,7 @@ runs:
1717
using: composite
1818
steps:
1919
- name: 'Checkout ${{ github.head_ref || github.ref }}'
20-
uses: actions/checkout@v5
20+
uses: actions/checkout@v6
2121

2222
- name: Writing ${{ inputs.file }} to step summary
2323
shell: bash

.github/actions/nuget/publish-package/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ runs:
3838
exit 1
3939
4040
- name: 'Checkout ${{ github.head_ref || github.ref }}'
41-
uses: actions/checkout@v5
41+
uses: actions/checkout@v6
4242

4343
- name: Download package artifact
44-
uses: actions/download-artifact@v5
44+
uses: actions/download-artifact@v8
4545
with:
4646
name: ${{ inputs.package-artifact-name }}
4747

.github/actions/source/compile/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ runs:
5050
using: "composite"
5151
steps:
5252
- name: 'Checkout ${{ github.head_ref || github.ref }}'
53-
uses: actions/checkout@v5
53+
uses: actions/checkout@v6
5454

5555
- name: 'Setup .NET ${{ inputs.dotnet_sdk_version }}'
5656
uses: actions/setup-dotnet@v4
@@ -68,7 +68,7 @@ runs:
6868

6969
- name: 'Upload build artifacts'
7070
if: ${{ inputs.upload-build-artifacts == 'true' }}
71-
uses: actions/upload-artifact@v4
71+
uses: actions/upload-artifact@v7
7272
with:
7373
name: ${{ inputs.build-artifacts-name }}
7474
path: ${{ inputs.build-artifacts-glob-pattern }}

0 commit comments

Comments
 (0)