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 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) |
GET /flights/{id}/kml returns a KML file of the flight trajectory.