mirror of
https://github.com/azaion/missions.git
synced 2026-06-21 12:11:07 +00:00
chore: update configuration and Docker setup for JWT and test results
ci/woodpecker/push/build-arm Pipeline was successful
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.
This commit is contained in:
@@ -97,36 +97,36 @@ erDiagram
|
||||
}
|
||||
MISSION {
|
||||
uuid id PK
|
||||
timestamp created_date
|
||||
timestamp created_date "PG TIMESTAMP (no TZ), DEFAULT NOW()"
|
||||
text name
|
||||
uuid vehicle_id FK
|
||||
uuid vehicle_id FK "REFERENCES vehicles(id), NO ACTION on delete"
|
||||
}
|
||||
WAYPOINT {
|
||||
uuid id PK
|
||||
uuid mission_id FK
|
||||
uuid mission_id FK "REFERENCES missions(id), NO ACTION on delete"
|
||||
decimal lat "nullable"
|
||||
decimal lon "nullable"
|
||||
text mgrs "nullable"
|
||||
int waypoint_source "WaypointSource enum"
|
||||
int waypoint_objective "WaypointObjective enum"
|
||||
int order_num
|
||||
decimal height
|
||||
int waypoint_source "WaypointSource enum, DEFAULT 0"
|
||||
int waypoint_objective "WaypointObjective enum, DEFAULT 0"
|
||||
int order_num "DEFAULT 0"
|
||||
decimal height "DEFAULT 0"
|
||||
}
|
||||
MAP_OBJECT {
|
||||
uuid id PK
|
||||
uuid mission_id FK
|
||||
uuid mission_id FK "REFERENCES missions(id), NO ACTION on delete"
|
||||
text h3_index "Uber H3 hex grid"
|
||||
text mgrs
|
||||
decimal lat "nullable"
|
||||
decimal lon "nullable"
|
||||
int class_num
|
||||
text label
|
||||
decimal size_width_m
|
||||
decimal size_length_m
|
||||
decimal confidence
|
||||
int object_status "ObjectStatus enum"
|
||||
timestamp first_seen_at
|
||||
timestamp last_seen_at
|
||||
int class_num "DEFAULT 0"
|
||||
text label "DEFAULT ''"
|
||||
decimal size_width_m "DEFAULT 0"
|
||||
decimal size_length_m "DEFAULT 0"
|
||||
decimal confidence "DEFAULT 0"
|
||||
int object_status "ObjectStatus enum, DEFAULT 0"
|
||||
timestamp first_seen_at "PG TIMESTAMP (no TZ), DEFAULT NOW()"
|
||||
timestamp last_seen_at "PG TIMESTAMP (no TZ), DEFAULT NOW()"
|
||||
}
|
||||
MEDIA {
|
||||
text id PK "XxHash64-based; computed by annotations service"
|
||||
@@ -148,10 +148,12 @@ The diagram above is a scoped restatement of `../../suite/_docs/00_database_sche
|
||||
|
||||
### Owned-table invariants
|
||||
|
||||
- **`mission.vehicle_id` MUST reference an existing `vehicle.id`** — enforced by FK + by `MissionService` existence check at create / update. The two together close the TOCTOU gap (FK rejects insert if the vehicle was deleted between check and insert; UX surfaces as a `500` instead of a `400` in that race window — see `02_mission_planning` Caveats #4).
|
||||
- **`waypoint.mission_id` MUST reference an existing `mission.id`** — enforced by FK + by `WaypointService` existence check at create.
|
||||
- **`mission.vehicle_id` MUST reference an existing `vehicle.id`** — enforced by FK (`REFERENCES vehicles(id)` declared in the migrator) + by `MissionService` existence check at create / update. The two together close the TOCTOU gap (FK rejects insert with PostgreSQL error `23503` if the vehicle was deleted between check and insert; UX surfaces as a `500` instead of a `400` in that race window — see `02_mission_planning` Caveats #4 and the AC-2.8 entry in `00_problem/acceptance_criteria.md`).
|
||||
- **`waypoint.mission_id` MUST reference an existing `mission.id`** — enforced by FK + by `WaypointService` existence check at create. The composite WHERE on update/delete (`w.MissionId == missionId && w.Id == waypointId`) collapses "parent missing" and "child missing" into a single 404 — see `service_waypoint.md` Caveats #2.
|
||||
- **`map_object.mission_id` MUST reference an existing `mission.id`** — enforced by FK only. `autopilot` is the writer; `missions` is the cascade-deleter.
|
||||
- **At most one `vehicle.is_default = TRUE`** is the spec invariant. Code enforces "exactly one default" by clearing the flag on every other row before setting it on the target — **stricter than spec, race-prone without a transaction.** Tracked under Jira AZ-551 (B12) for resolution.
|
||||
- **All FK columns have `REFERENCES` declared in the migrator** (no `ON DELETE` clause; PostgreSQL defaults to `NO ACTION`). The in-code cascade walks in `MissionService.DeleteMission` and `WaypointService.DeleteWaypoint` delete child rows before parent rows — see `architecture.md` ADR-003 for why the cascade lives in code instead of `ON DELETE CASCADE`.
|
||||
- **All timestamp columns use PostgreSQL `TIMESTAMP`** (no timezone): `missions.created_date`, `map_objects.first_seen_at`, `map_objects.last_seen_at`. `DateTime.Kind` round-trips as `Unspecified` from the database; the application writes `DateTime.UtcNow` and treats values as UTC by convention.
|
||||
|
||||
### Cross-service-table invariants (cascade only)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user