Skip to content

feat(flight): KML trajectory export endpoint#73

Open
aasitvora99 wants to merge 2 commits into
enh/tank-geometry-fluid-densityfrom
enh/flight-kml-export
Open

feat(flight): KML trajectory export endpoint#73
aasitvora99 wants to merge 2 commits into
enh/tank-geometry-fluid-densityfrom
enh/flight-kml-export

Conversation

@aasitvora99

Copy link
Copy Markdown
Member

GET /flights/{id}/kml returns a KML file of the flight trajectory.

GET /flights/{id}/kml returns a KML file of the flight trajectory.
@aasitvora99
aasitvora99 marked this pull request as ready for review May 17, 2026 20:04
@coderabbitai

coderabbitai Bot commented May 17, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 815cd99f-c76f-458a-a7db-b48d17cc9812

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch enh/flight-kml-export

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}/kml route 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.

Comment thread src/services/flight.py
) as tmp:
tmp_path = tmp.name
try:
FlightDataExporter(self._flight).export_kml(file_name=tmp_path)
Gui-FernandesBR added a commit that referenced this pull request Jul 23, 2026
…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>
@Gui-FernandesBR

Copy link
Copy Markdown
Member

CI unblocked ✅ (same pylint fix) — stacked on #72

Cherry-picked the same one-line CI fix as #72 (this branch is stacked on enh/tank-geometry-fluid-density, so it inherited the same pylint W0613 failure in the tank-validation tests). build (3.12.5) now passes.

Why this matters for Jarvis: the results screen defaults to a Cesium/KML 3D trajectory hero and calls GET /flights/{id}/kml, which doesn't exist on master — so today it 404s and silently falls back to Plotly, and the headline 3D hero never renders. This PR is what lights it up. See RocketPy-Team/jarvis-ts#70 and the handoff doc (§4).

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants