Enhance test infrastructure and configuration for JWKS and Docker setup
ci/woodpecker/push/build-arm Pipeline was successful

- Updated Azaion.Missions.csproj to exclude test sources from service compilation, preventing build failures due to test project dependencies.
- Modified docker-compose.test.yml to preload the pg_stat_statements extension for testing and adjusted JWT refresh intervals for better test execution timing.
- Enhanced Dockerfile to install wget for health checks and ensure proper initialization of the container.
- Introduced a test-only endpoint for JWKS refresh to facilitate end-to-end testing without relying on the default refresh intervals.
- Updated DTOs in ApiDtos.cs to reflect camelCase naming conventions for consistency with service responses.
- Improved test cases to handle JWKS rotation and refresh scenarios effectively, ensuring robust validation of JWT handling.

This commit lays the groundwork for more reliable and efficient testing of the Azaion.Missions project.
This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-05-16 10:20:38 +03:00
parent 001e80fe96
commit 3398ec49a0
29 changed files with 785 additions and 111 deletions
@@ -0,0 +1,52 @@
# Research Findings — `02-baseline-cleanup`
**Date**: 2026-05-16
**Mode**: automatic (quick-assessment)
**Scope**: residual baseline-scan F4 partial — two empty scaffolding directories at the repo root
## Project Constraint Matrix
Extracted from `_docs/00_problem/problem.md`, `_docs/02_document/architecture.md` (incl. `## Architecture Vision`), `_docs/02_document/module-layout.md`, and the .NET 10 / Sdk.Web build constraints.
| Constraint | Source | Impact on this run |
|------------|--------|--------------------|
| Source layout is layer-organized at repo root (no `src/`); component ownership is by file-path glob per `module-layout.md` | `architecture.md` § Architecture Vision | Removing two empty directories aligns layout with this principle (no component owns them) |
| `Sdk.Web` recursive `**/*.cs` glob picks up everything not under `bin/`, `obj/`, or `tests/` (the latter excluded by `Compile Remove="tests/**"` in csproj) | `Azaion.Missions.csproj` | Empty directories contribute zero `.cs` files; removal is a pure no-op for the compile graph |
| Test suite must pass after any structural change | `_docs/02_document/tests/environment.md`, autodev existing-code Step 7 gate | Verified pre-change baseline (48 pass / 0 fail / 30 env-skip on 2026-05-15 14:03); will re-run post-change |
| Functional contracts (HTTP, DB schema, JWT) are preserved | `_docs/02_document/architecture.md` § 7, FT-P-* and NFT-SEC-* tests | No contract is touched; pure on-disk cleanup |
## Current State Analysis
The codebase has already converged on its target layout following the May 14 missions/vehicles rename:
- Entities live under `Database/Entities/*.cs` (6 files: Vehicle, Mission, Waypoint, MapObject, Annotation, Detection, Media).
- Request DTOs live directly under `DTOs/*.cs` (Create/Update/Get… per resource).
- Cross-cutting infrastructure lives under `Infrastructure/` (now populated with `ConfigurationResolver.cs` and `CorsConfigurationValidator.cs`).
- Auth, middleware, controllers, services follow established `Auth/`, `Middleware/`, `Controllers/`, `Services/` directories.
**Strengths**: small (37 files / 1,306 LOC / avg 35 LOC per file), no cycles, no cross-component public-API bypass, all tests green, baseline scan was PASS_WITH_WARNINGS.
**Weaknesses (this run's scope only)**: two empty placeholder directories (`Entities/`, `DTOs/Requests/`) survived the rename and now masquerade as alternate trees that don't exist. Misleading for new readers.
## Alternative Approaches Considered
No library / framework / SDK / service replacement is being proposed.
**Per-mode API capability verification (`context7` / MVE) is therefore N/A** — the SKILL.md and Phase 2a both gate that requirement on "replaces (or adds) a library/SDK/framework/service". Pure directory removal does not.
| Option | Pros | Cons | Verdict |
|--------|------|------|---------|
| Remove the directories outright (`git rm -r`) | Simplest; aligns with Architecture Vision; zero risk (no `.cs` content) | None for the actual files | **Selected** |
| Repurpose the directories with `.gitkeep` + a `README.md` explaining intent | Preserves the placeholder for future use | Speculative — no documented intent to use either path; the existing layout works | Rejected — speculative scaffolding violates "don't keep dead code" |
| Move existing `Database/Entities/*` up to `Entities/` and reorganize | Could collapse two trees into one | Touches every entity file, every `using` directive, every test reference; risks the green test suite for cosmetic gain; contradicts the Architecture Vision principle that persistence owns its own subtree | Rejected — out of scope for a quick-assessment cleanup; would weaken constraint fit |
## Constraint-Fit Table
| Recommendation | Pinned mode/config | Constraints checked | API capability evidence (MVE) | Evidence | Mismatches/disqualifiers | Status |
|----------------|--------------------|---------------------|-------------------------------|----------|--------------------------|--------|
| C01 — Delete `Entities/` and `DTOs/Requests/` | N/A (no library; pure `git rm -r`) | Architecture Vision § layer-organized at repo root; csproj Sdk.Web glob; full test suite gate | N/A — no library; no MVE required per SKILL.md gate | `architecture_compliance_baseline.md` F4; `logical_flow_analysis.md` (zero references); `report.csv` 48/0/30 baseline | None | **Selected** |
## References
- `_docs/02_document/architecture_compliance_baseline.md` — F4 source.
- `_docs/04_refactoring/02-baseline-cleanup/discovery/logical_flow_analysis.md` — flow-by-flow impact verification.
- `_docs/02_document/architecture.md` § Architecture Vision — confirmed structural intent.
- `_docs/03_implementation/implementation_report_tests.md` — baseline test outcomes (48 pass / 0 fail / 30 skip).