Skip to content

Commit 0f10f3f

Browse files
author
Mike McDougall
committed
feat: spatial query support and guardrails (#7)
1 parent 4e97bd5 commit 0f10f3f

File tree

19 files changed

+515
-505
lines changed

19 files changed

+515
-505
lines changed

.github/workflows/ci.yml

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ jobs:
7171
name: Integration Tests (Testcontainers + PostGIS)
7272
runs-on: ubuntu-latest
7373
needs: build
74+
outputs:
75+
needs_integration: ${{ steps.changes.outputs.integration }}
7476
services:
7577
# Testcontainers will manage containers, but we need Docker available
7678
docker:
@@ -79,6 +81,23 @@ jobs:
7981
steps:
8082
- uses: actions/checkout@v4
8183

84+
- name: Detect Integration Test Scope
85+
id: changes
86+
uses: dorny/paths-filter@v3
87+
with:
88+
filters: |
89+
integration:
90+
- 'src/**'
91+
- 'tests/**'
92+
- 'docker/**'
93+
- 'Dockerfile'
94+
- 'docker-compose.yml'
95+
- '**/*.csproj'
96+
- 'Directory.Build.props'
97+
- 'Honua.sln'
98+
- '.github/workflows/**'
99+
- 'scripts/**'
100+
82101
- name: Setup .NET
83102
uses: actions/setup-dotnet@v4
84103
with:
@@ -88,6 +107,7 @@ jobs:
88107
run: dotnet restore Honua.sln
89108

90109
- name: Run Integration Tests
110+
if: steps.changes.outputs.integration == 'true'
91111
run: |
92112
dotnet test Honua.sln \
93113
--no-restore \
@@ -101,7 +121,7 @@ jobs:
101121

102122
- name: Upload Test Results
103123
uses: actions/upload-artifact@v4
104-
if: always()
124+
if: steps.changes.outputs.integration == 'true'
105125
with:
106126
name: integration-test-results
107127
path: tests/TestResults/
@@ -152,6 +172,7 @@ jobs:
152172

153173
- name: Download Integration Test Results
154174
uses: actions/download-artifact@v4
175+
if: needs.test-integration.outputs.needs_integration == 'true'
155176
with:
156177
name: integration-test-results
157178
path: ./coverage/integration
@@ -193,16 +214,14 @@ jobs:
193214
BRANCH_COVERAGE=$(grep -oP 'Branch coverage: \K[\d.]+' ./coverage/report/Summary.txt || echo "0")
194215
echo "Branch coverage: ${BRANCH_COVERAGE}%"
195216
196-
# Phase 0: Lower thresholds for infrastructure setup phase
197-
# TODO: Restore to 80%/70% once we have more implementation
198-
# Temporarily reduced to 30% for Issue #3 - PostgresFeatureStore has excellent coverage
199-
# but overall project coverage low due to greenfield nature
200-
if (( $(echo "$COVERAGE < 30" | bc -l) )); then
201-
echo "::error::Coverage ${COVERAGE}% is below 30% threshold"
217+
# Phase 0-1: Staged thresholds to keep velocity while increasing coverage
218+
# TODO: Restore to 80%/70% once core FeatureServer endpoints are complete
219+
if (( $(echo "$COVERAGE < 40" | bc -l) )); then
220+
echo "::error::Coverage ${COVERAGE}% is below 40% threshold"
202221
exit 1
203222
fi
204-
if (( $(echo "$BRANCH_COVERAGE < 25" | bc -l) )); then
205-
echo "::error::Branch coverage ${BRANCH_COVERAGE}% is below 25% threshold"
223+
if (( $(echo "$BRANCH_COVERAGE < 30" | bc -l) )); then
224+
echo "::error::Branch coverage ${BRANCH_COVERAGE}% is below 30% threshold"
206225
exit 1
207226
fi
208227

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ When porting behavior, document the source:
3232
### Quality Standards
3333

3434
- **Warnings as errors**: All builds must pass with `TreatWarningsAsErrors=true`
35-
- **Coverage gates**: 80%+ line coverage, 70%+ branch coverage
35+
- **Coverage gates**: Target 80%+ line coverage, 70%+ branch coverage; CI enforces staged thresholds (40%/30%) during Phase 0-1
3636
- **API surface coverage**: 100% - every endpoint must have integration tests
3737
- **AOT compatibility**: No reflection in hot paths, source-generated JSON/logging
3838
- **Dependency limits**: Max 5 dependencies per endpoint, max 4 per handler

CODEX.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ When porting behavior, document the source:
3232
### Quality Standards
3333

3434
- **Warnings as errors**: All builds must pass with `TreatWarningsAsErrors=true`
35-
- **Coverage gates**: 80%+ line coverage, 70%+ branch coverage
35+
- **Coverage gates**: Target 80%+ line coverage, 70%+ branch coverage; CI enforces staged thresholds (40%/30%) during Phase 0-1
3636
- **API surface coverage**: 100% - every endpoint must have integration tests
3737
- **AOT compatibility**: No reflection in hot paths, source-generated JSON/logging
3838
- **Dependency limits**: Max 5 dependencies per endpoint, max 4 per handler

docs/CI_MONITORING.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ CI runs in dependency order. Fix failures from top to bottom:
1515
3. **Integration Tests** (parallel with unit tests)
1616
- May fail due to environment differences
1717
- Uses Testcontainers + PostGIS
18+
- Skipped when only docs/config changes are detected
1819

1920
4. **Architecture Tests** (parallel with other tests)
2021
- Enforces project rules
@@ -95,7 +96,7 @@ dotnet test --filter "Category=Architecture"
9596
9697
#### Line Coverage Below Threshold
9798
```bash
98-
# Current: 30%, target: 80%
99+
# Current: 40% line / 30% branch, target: 80%/70%
99100
# Add tests for uncovered code paths
100101

101102
dotnet test --collect:"XPlat Code Coverage"
@@ -260,4 +261,4 @@ gh pr view # View PR details and comments
260261
# Clean up Docker if integration tests fail
261262
docker system prune -f
262263
docker volume prune -f
263-
```
264+
```

0 commit comments

Comments
 (0)