feat(flight): KML trajectory export endpoint#73
Conversation
GET /flights/{id}/kml returns a KML file of the flight trajectory.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Adds support for exporting a flight’s trajectory as a Google Earth KML download via a new GET /flights/{id}/kml endpoint, integrating the route/controller/service layers and covering the new behavior with unit tests.
Changes:
- Added
GET /flights/{flight_id}/kmlroute returning a KML file download response. - Implemented controller + service support for generating KML bytes using RocketPy’s
FlightDataExporter. - Added route unit tests for success, 404, and 500 cases.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
tests/unit/test_routes/test_flights_route.py |
Adds unit tests validating KML endpoint response bytes, headers, and error propagation. |
src/services/flight.py |
Implements KML export in FlightService using FlightDataExporter and a temporary file. |
src/routes/flight.py |
Adds the /flights/{flight_id}/kml endpoint returning a KML file download response. |
src/controllers/flight.py |
Exposes get_flight_kml() controller method with standard exception handling wrapper. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ) as tmp: | ||
| tmp_path = tmp.name | ||
| try: | ||
| FlightDataExporter(self._flight).export_kml(file_name=tmp_path) |
…n tests pylint W0613 (unused-argument) on 5 schema-validation tests failed the build step (pylint exit 4), blocking this PR and the stacked KML PR #73. These tests only assert a 422 from schema validation, so they never touch the controller; and mock_controller_instance is @pytest.fixture(autouse=True), so it still runs for every test regardless — the parameter was vestigial. No behavior change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…n tests pylint W0613 (unused-argument) on 5 schema-validation tests failed the build step (pylint exit 4), blocking this PR and the stacked KML PR #73. These tests only assert a 422 from schema validation, so they never touch the controller; and mock_controller_instance is @pytest.fixture(autouse=True), so it still runs for every test regardless — the parameter was vestigial. No behavior change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
CI unblocked ✅ (same pylint fix) — stacked on #72Cherry-picked the same one-line CI fix as #72 (this branch is stacked on Why this matters for Jarvis: the results screen defaults to a Cesium/KML 3D trajectory hero and calls Merge order: #72 first (this is stacked on it), then this one, then deploy. — pushed as part of a Claude Code audit of the beta (Gui). |
GET /flights/{id}/kml returns a KML file of the flight trajectory.