Commit Graph

37 Commits

Author SHA1 Message Date
Oleksandr Bezdieniezhnykh 3398ec49a0 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.
2026-05-16 10:20:38 +03:00
Oleksandr Bezdieniezhnykh 001e80fe96 [AZ-585] [AZ-586] ResLim+Perf NFT tests; close test cycle 1
Batch 4 of test implementation cycle 1 (existing-code Step 6, final batch).

- AZ-585 SteadyStateLoadTests + ColdStartRssTests: NFT-RES-LIM-01..04.
  SteadyStateLoadFixture runs one 5-min sustained-load window and samples
  RSS (docker stats), Npgsql conns (pg_stat_activity), and FDs
  (/proc/1/fd) every 5s; three test methods assert independently. All
  SkippableFact-gated on docker primitives.
- AZ-586 PerformanceTests: NFT-PERF-01..04. Sequential single-client,
  5 warm-ups + N measured calls, P50+P95 via LatencyPercentiles, recorded
  to PERF_RESULTS_FILE. Tagged Category=Perf so default gate excludes them.

Infrastructure:
- entrypoint.sh now applies --filter "${TEST_FILTER:-Category!=Perf}"
  per AZ-586 (default CI gate excludes performance).
- MetricCsvRecorder: idempotent CSV appender keyed on env var, used by
  both Perf and ResLim categories.

Step 6 (Implement Tests) is complete. Final report at
_docs/03_implementation/implementation_report_tests.md handoffs the
full-suite gate to test-run/SKILL.md (Step 7).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-15 09:11:53 +03:00
Oleksandr Bezdieniezhnykh 26126e6216 [AZ-581] [AZ-582] [AZ-583] [AZ-584] Cumulative review batches 01-03
Every-K=3 cumulative slice over the test-implementation cycle so far.
Scope: tests/, _docs/ — production source not touched. 48/48 ACs traced;
4 Low findings (3 follow-up + 1 baseline-carried). Verdict: PASS_WITH_WARNINGS.
Continue to Batch 4 (AZ-585, AZ-586).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-15 09:01:23 +03:00
Oleksandr Bezdieniezhnykh 24c4561bef [AZ-581] [AZ-582] [AZ-583] [AZ-584] Sec+Res NFT tests
Batch 3 of test implementation cycle 1 (existing-code Step 6).

- AZ-581 AuthClaimsTests: NFT-SEC-01..06+04b (foreign-keypair, byte-flip,
  30s skew, iss/aud/perms, multi-value permissions array).
- AZ-582 CrossCutting/ErrorRedaction/JwksRotation/StartupConfig/CorsConfig:
  NFT-SEC-07..13 (alg pin, kid rotation grace window, env fail-fast, CORS
  Production gate).
- AZ-583 CascadeF3/CascadeF4/MigratorRestart: NFT-RES-01..04. CascadeF4
  pins current walk-order divergence with carry_forward AC-4.6.
- AZ-584 ConfigDbStartup/JwksRotationNoRestart/DefaultVehicleRace:
  NFT-RES-05..08. NFT-RES-08 pins current behaviour (unique-index closes
  the race) with carry_forward AC-1.4.

Mock contract: SignBody accepts permissions OR permissions_array (mutually
exclusive). TokenSigner validates kid_override against published keys so
NFT-SEC-11 can assert "mock refuses old kid post-grace".

Helpers added: ForeignKeypair (test-only ECDSA P-256),
MissionsContainerHelper (docker-run wrapper for startup-time scenarios),
DockerLogs.

7 of 22 new tests are Skippable, gated on COMPOSE_RESTART_ENABLED + docker
CLI in the e2e-consumer image (explicit skip reason; no silent pass).

Build green: test csproj + jwks-mock csproj.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-15 08:58:59 +03:00
Oleksandr Bezdieniezhnykh 6b2c2d998e [AZ-577] [AZ-578] [AZ-579] [AZ-580] Implement E2E test batch 2
Adds 26 blackbox tests (FT-P-01..18, FT-N-01..08) covering full AC
matrices for Vehicles/Missions/Waypoints/Health/Errors. Three
spec-vs-code carry-forwards documented in batch_02_report.md and
pinned with [Trait("carry_forward", ...)].

Shared scaffolding: ApiDtos.cs, AssertProblemEnvelopeAsync helper,
Seeds.cs, StubSchema.cs, CascadeF3/F4 fixtures, PostgresStopStart
fixture (gated by COMPOSE_RESTART_ENABLED). Removes the 4 placeholder
Sanity.cs files (now superseded). docker-compose.test.yml gains the
expected_results volume mount + FIXTURE_SQL_DIR for the consumer.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-15 08:28:37 +03:00
Oleksandr Bezdieniezhnykh 3c5354e56c [AZ-575] Update autodev state: batch 1 done, 10 tasks remain
Step 6 (Implement Tests) sub_step batch-loop pointer updated after AZ-576
landed and was pushed to origin/dev. Re-entry on next /autodev resumes at
batch 2 (AZ-577..AZ-580 by complexity-aware topological sort).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-15 06:59:28 +03:00
Oleksandr Bezdieniezhnykh ccd85a09df [AZ-576] Add e2e test infrastructure (xUnit + jwks-mock + reporting)
ci/woodpecker/push/build-arm Pipeline failed
Scaffold the blackbox test project the rest of epic AZ-575 (AZ-577..AZ-586)
will build on. Two new csprojs under tests/, plus the TLS materials and
TRX->CSV reporting hand-off the existing docker-compose.test.yml already
calls for.

JWKS mock (tests/Azaion.Missions.JwksMock/):
- ASP.NET Core minimal API on .NET 10, no NuGet deps; JWS is hand-rolled
  to keep the surface tight and avoid version drift with the SUT
- KeyStore with one in-memory ECDSA P-256 keypair + retired-key grace
  window for NFT-RES-07 / NFT-SEC-11 rotation observability
- Endpoints: GET /.well-known/jwks.json, POST /sign, POST /rotate-key
- Mock-only alg_override / kid_override switches drive NFT-SEC-09/10/11
- TLS keypair committed under tls/; tests/jwks-mock-ca.crt is a copy
  mounted into both missions and e2e-consumer per docker-compose.test.yml

E2E consumer (tests/Azaion.Missions.E2E.Tests/):
- xUnit 2.9.2 + Bogus 35.6.1 + Npgsql 10.0.2 + Xunit.SkippableFact 1.4.13
- TestBase / TokenMinter scaffolding for downstream tasks
- Fixtures/ for DbReset, DbSeed, ComposeRestart, JwksRotate, JwksMockReverse
- Helpers/ for DbAssertions (side-channel), HttpAssertions, FixtureSql
- 8 Tests/<category>/Sanity.cs discovery smoke tests (AC-3)
- Tests/InfrastructureSanity.cs SkippableFacts for AC-1/2/5/6
- Tests/AaaPatternEnforcement.cs greps source files for AC-7
- Tests/Reporting/TrxToCsvPostProcessorTests.cs covers AC-4
- Reporting/TrxToCsvPostProcessor.cs handles VSTest TRX -> environment.md
  CSV; xUnit traits are not propagated by the TRX logger so the converter
  reflects them out of the test DLL via GetCustomAttributesData
- Reporting.Cli/ is a separate console csproj that links the converter
  source files (test project excludes Reporting.Cli/** from compile)
- Dockerfile + entrypoint.sh wire dotnet test -> trx -> csv inside the
  e2e-consumer container the compose file already references

Local verification: 13 pass, 3 skip (with explicit reasons), 0 fail.
End-to-end TRX->CSV manually verified against environment.md header spec.
Docker stack build is handed off to autodev Step 7 (test-run skill).

Reports under _docs/03_implementation/.
AZ-576 task spec moved to _docs/tasks/done/.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-15 06:57:40 +03:00
Oleksandr Bezdieniezhnykh b0c7132889 [AZ-575] Add 11 blackbox test task specs from decompose Step 5
Decompose Step 5 (tests-only mode) produced the test-task ladder for
the Blackbox Tests epic. Test infrastructure (AZ-576) blocks the rest;
all 10 blackbox child tasks fan out from it.

Tasks (epic AZ-575):
- AZ-576 test_infrastructure (5 SP)
- AZ-577 test_vehicles_positive (5 SP)
- AZ-578 test_missions_positive (5 SP)
- AZ-579 test_waypoints_health_positive (5 SP)
- AZ-580 test_validation_authz_negative (3 SP)
- AZ-581 test_security_auth_claims (5 SP)
- AZ-582 test_security_alg_rotation_cors (5 SP)
- AZ-583 test_resilience_cascade_migrator (3 SP)
- AZ-584 test_resilience_config_db_rotation_race (5 SP)
- AZ-585 test_resource_limits (3 SP)
- AZ-586 test_performance (3 SP)

Total: 45 SP across 11 tasks. Coverage verified against
blackbox/security/resilience/resource-limit/performance test specs
(56 scenarios). _docs/_autodev_state.md advanced to Step 6 (Implement
Tests).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-15 06:37:00 +03:00
Oleksandr Bezdieniezhnykh 2840ccb9b6 refactor: rename project from Flights to Missions and update related components
ci/woodpecker/push/build-arm Pipeline was successful
This commit transitions the project from Azaion.Flights to Azaion.Missions, updating namespaces, DTOs, services, and database entities accordingly. The Docker configuration and entry points have been modified to reflect the new project structure. Additionally, the README and documentation have been updated to clarify the ongoing renaming process and its implications. All references to flights have been replaced with missions, ensuring consistency across the codebase.
2026-05-15 04:35:49 +03:00
Oleksandr Bezdieniezhnykh 4f226e91d5 feat: implement missions and vehicles management with CRUD operations
Added new project structure for Azaion.Missions, including the MissionsController and VehiclesController for handling mission and vehicle management. Implemented DTOs for mission and vehicle creation and updates, along with service classes for business logic. Introduced database entities for Mission and Vehicle, and established relationships for data handling. Configured project dependencies and set up initial project properties.
2026-05-15 04:35:40 +03:00
Oleksandr Bezdieniezhnykh 78dea8ebab chore: update configuration and Docker setup for JWT and test results
ci/woodpecker/push/build-arm Pipeline was successful
Enhanced the .gitignore to exclude test results and updated the Dockerfile to include a new entrypoint script for improved container initialization. Refactored JWT configuration to support additional parameters for automatic refresh intervals, ensuring better control over token management. Updated the ConfigurationResolver to enforce required environment variables without hardcoded fallbacks, enhancing security and flexibility.
2026-05-15 03:23:23 +03:00
Oleksandr Bezdieniezhnykh 7025f4d075 refactor: enhance JWT authentication and CORS configuration
Updated JWT authentication to use configuration values instead of hardcoded secrets, improving security and flexibility. Enhanced CORS policy to conditionally allow origins based on configuration settings, with logging for permissive defaults. Updated README to reflect project renaming and clarify service context.
2026-05-14 19:48:25 +03:00
Oleksandr Bezdieniezhnykh 2fe394d732 chore: sync .cursor from suite
ci/woodpecker/push/build-arm Pipeline was successful
2026-05-09 05:18:09 +03:00
Oleksandr Bezdieniezhnykh c307560a2d chore: sync .cursor from suite
ci/woodpecker/push/build-arm Pipeline was successful
2026-05-05 01:08:47 +03:00
Oleksandr Bezdieniezhnykh 2cd68ec7ea chore: sync .cursor skills from suite
ci/woodpecker/push/build-arm Pipeline was successful
2026-05-03 17:43:26 +03:00
Oleksandr Bezdieniezhnykh 773fb030eb chore: sync .cursor skills from suite
ci/woodpecker/push/build-arm Pipeline was successful
2026-04-29 17:03:56 +03:00
Oleksandr Bezdieniezhnykh 19ec38cffc chore: sync .cursor from suite
ci/woodpecker/push/build-arm Pipeline was successful
Made-with: Cursor
2026-04-25 19:44:37 +03:00
Oleksandr Bezdieniezhnykh 25d244c840 Update Woodpecker CI configuration for Docker login and image tagging
ci/woodpecker/manual/build-arm Pipeline was successful
Replaced HARBOR_USER and HARBOR_TOKEN with REGISTRY_USER and REGISTRY_TOKEN for improved clarity and consistency. Adjusted Docker login command and updated image tagging to include the 'azaion' prefix in the registry path.
2026-04-21 20:32:59 +03:00
Oleksandr Bezdieniezhnykh f523f26231 [AZ-205] Authenticate to Harbor before pushing build images
Add HARBOR_USER/HARBOR_TOKEN from Woodpecker secrets and a docker login
step before the existing build/push, so pipelines can push to the new
TLS-authenticated Harbor registry.
2026-04-20 04:10:42 +03:00
Oleksandr Bezdieniezhnykh 0b4866bf29 [AZ-204] OCI revision labels + AZAION_REVISION env
Made-with: Cursor
2026-04-20 03:58:47 +03:00
Oleksandr Bezdieniezhnykh 7790b4cf16 [AZ-203] Parameterize registry host via REGISTRY_HOST secret
Pipeline reads $REGISTRY_HOST from the Woodpecker global secret
'registry_host' instead of hardcoding 'localhost:5000'. The full
host:port lives in the secret, so Harbor migration (AZ-205) becomes
one secret edit rather than editing every submodule pipeline.

Made-with: Cursor
2026-04-20 03:49:21 +03:00
Oleksandr Bezdieniezhnykh d8ac1606d6 Sync .cursor from suite (autodev orchestrator + monorepo skills) 2026-04-18 22:04:12 +03:00
Oleksandr Bezdieniezhnykh c51cb9b4a5 Enhance coding standards and testing rules
- Updated coderule.mdc to emphasize readability, meaningful comments, and maintainability.
- Revised testing.mdc to set a 75% coverage threshold for business logic and clarified expected results requirements.
- Improved clarity in git-workflow.mdc regarding commit message formatting and length.
- Added completeness audit requirements in research steps and quality checklists to ensure thoroughness in test specifications.

Made-with: Cursor
2026-04-17 20:28:55 +03:00
Oleksandr Bezdieniezhnykh bead15f492 Allow manual CI builds
ci/woodpecker/manual/build-arm Pipeline failed
Made-with: Cursor
2026-04-12 05:41:33 +03:00
Oleksandr Bezdieniezhnykh c5617926df Update Woodpecker CI configuration to trigger builds on push events 2026-04-12 05:10:30 +03:00
Oleksandr Bezdieniezhnykh 95a3e9ae4a Sync .cursor from detections 2026-04-12 05:05:10 +03:00
Oleksandr Bezdieniezhnykh 722061b296 CI: main tag without prefix
Made-with: Cursor
2026-04-12 04:12:07 +03:00
Oleksandr Bezdieniezhnykh ebae2c50cf update woodpecker add dev branch
Made-with: Cursor
2026-04-11 20:40:30 +03:00
Oleksandr Bezdieniezhnykh 524747337d Switch to Woodpecker CI
Made-with: Cursor
2026-04-10 01:28:46 +03:00
Oleksandr Bezdieniezhnykh 2c1c4ed1df Comment out amd64 matrix
Made-with: Cursor
2026-04-09 23:33:16 +03:00
Oleksandr Bezdieniezhnykh 1824c4374f Remove Woodpecker CI configuration file
- Delete the .woodpecker.yml file, which contained multi-platform build configurations for the CI pipeline.
- This change reflects a shift in CI strategy or tooling.
2026-04-09 19:17:57 +03:00
Oleksandr Bezdieniezhnykh b7ac1fd0a7 Add multi-platform support in Woodpecker CI configuration
- Introduce a matrix for building on both linux/arm64 and linux/amd64 platforms.
- Update image tagging to include platform-specific tags for better versioning.
- Enhance the CI configuration for improved build clarity and organization.
2026-04-09 13:27:41 +03:00
Oleksandr Bezdieniezhnykh 85921fa1ae Refactor Dockerfile and update coding standards
- Refactor Dockerfile to improve build efficiency and clarity.
- Enhance coding standards in coderule.mdc for better maintainability.
- Add new rules to python.mdc to improve code quality.
2026-04-08 06:32:54 +03:00
Oleksandr Bezdieniezhnykh 37bee961ab Update Dockerfile for multi-architecture support and enhance coding rules
- Modify Dockerfile to support multi-platform builds using TARGETARCH.
- Update coderule.mdc to enforce source code organization under the `src/` directory.
- Remove outdated rule from python.mdc regarding `src/` layout.
2026-04-06 05:03:27 +03:00
Oleksandr Bezdieniezhnykh 2528a1e995 Add .cursor AI autodevelopment harness (agents, skills, rules)
Made-with: Cursor
2026-03-26 01:06:55 +02:00
Oleksandr Bezdieniezhnykh e64bd9a805 Add .gitignore and remove build artifacts from tracking
Made-with: Cursor
2026-03-25 05:21:18 +02:00
Oleksandr Bezdieniezhnykh 0625cd4157 Initial commit
Made-with: Cursor
2026-03-25 05:21:08 +02:00