Skip to content

Conversation

@MarcosMulari
Copy link

@MarcosMulari MarcosMulari commented Dec 7, 2025

Changes

Core Implementation

  • Create FastAPI dependency providers for all controllers (RocketController, MotorController, EnvironmentController, FlightController)
  • Implement singleton pattern using @lru_cache(maxsize=1) for thread-safe controller reuse
  • Add type aliases (RocketControllerDep, MotorControllerDep, etc.) using Annotated[Controller, Depends(...)]
  • Improves performance by avoiding controller re-instantiation on every request

Routes Refactoring

  • Replace manual controller instantiation with dependency injection across all endpoints:
    • Environment routes (CRUD + simulate + binary)
    • Motor routes (CRUD + simulate + binary)
    • Rocket routes (CRUD + simulate + binary + motor-reference flows)
    • Flight routes (CRUD + simulate + binary + environment/rocket updates + references)
  • Maintains backward compatibility with existing API contracts

Test Updates

  • Update test fixtures to patch src.dependencies controllers instead of src.routes
  • Use AsyncMock for all controller methods (they are async functions)
  • Clear lru_cache before and after each test to ensure fresh mock instances
  • Pattern: patch('src.dependencies.ControllerClass')

Related Files

  • src/dependencies.py - Dependency providers
  • src/routes/environment.py
  • src/routes/motor.py
  • src/routes/rocket.py
  • src/routes/flight.py
  • tests/unit/test_routes/test_environments_route.py
  • tests/unit/test_routes/test_motors_route.py
  • tests/unit/test_routes/test_rockets_route.py
  • tests/unit/test_routes/test_flights_route.py

Testing

All route tests updated and passing with the new dependency injection pattern. Controllers are properly mocked and isolated for unit testing.
image

Testing Strategy Discussion

Initial confusion: I didn't understand why tests call the endpoint through the client instead of directly testing the controller function. Seemed redundant at first.

What I learned: This is actually an intentional integration test pattern with specific benefits:

  1. End-to-end verification: By calling through client.post(), we test the entire request pipeline:

    • FastAPI request parsing and validation
    • Dependency injection resolution
    • Route handler execution
    • Response serialization
    • HTTP status codes
  2. Real-world scenarios: The endpoint test simulates actual HTTP usage, catching issues that direct function calls would miss:

    • Pydantic validation errors
    • Request body parsing
    • Response formatting
  3. Test isolation: Mocking the controller ensures we're testing the route layer independently without touching the actual database/services

Summary by CodeRabbit

  • Documentation

    • Added guidance for systems with uvloop compatibility constraints, recommending Docker as an alternative deployment solution.
  • Refactor

    • Refactored internal architecture to implement dependency injection patterns across all route handlers and controllers, enhancing code maintainability and testability.

✏️ Tip: You can customize this high-level summary in your review settings.

- Create FastAPI dependency providers for all controllers
- Implement singleton pattern using lru_cache for thread-safety
- Add type aliases (RocketControllerDep, MotorControllerDep, etc.)
- Improves performance by avoiding controller re-instantiation on every request

References:
- FastAPI Dependencies: https://fastapi.tiangolo.com/tutorial/dependencies/
- Replace manual FlightController instantiation with FlightControllerDep
- Apply DI pattern across all flight endpoints (CRUD + simulate + binary)
- Maintains backward compatibility with existing API contracts
- Replace manual RocketController instantiation with RocketControllerDep
- Apply DI pattern to all rocket endpoints including motor-reference flows
- Replace manual MotorController instantiation with MotorControllerDep
- Apply DI pattern to all motor endpoints (CRUD + simulate + binary)
- Replace manual EnvironmentController instantiation with EnvironmentControllerDep
- Complete DI migration across all API routes
- All controllers now use singleton pattern for optimal performance
- Replace patch from src.routes to src.dependencies for controller mocking
- Use AsyncMock for all controller methods (they are async functions)
- Clear lru_cache before and after each test to ensure fresh mock instances
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 7, 2025

Walkthrough

This PR introduces a dependency injection pattern for controller management. A new dependencies module creates singleton controller factories using LRU caching and provides Annotated type aliases for FastAPI injection. Route handlers across all four resource types (environment, flight, motor, rocket) are updated to receive injected controllers instead of instantiating them locally. Test fixtures are updated to mock at the dependencies layer and manage cache state.

Changes

Cohort / File(s) Summary
Documentation
README.md
Added Windows Users section documenting uvloop installation issue and Docker workaround.
Dependency Injection Setup
src/dependencies.py
New module providing four singleton controller factory functions (get_rocket_controller, get_motor_controller, get_environment_controller, get_flight_controller) with LRU caching and four corresponding Annotated dependency type aliases for FastAPI injection.
Route Handlers - Environment
src/routes/environment.py
Updated all route handlers to accept controller: EnvironmentControllerDep parameter and removed direct controller instantiation. Changed import from direct controller to dependency injection alias.
Route Handlers - Flight
src/routes/flight.py
Updated all route handlers (10 endpoints) to accept controller: FlightControllerDep parameter and removed direct controller instantiation. Changed import from direct controller to dependency injection alias.
Route Handlers - Motor
src/routes/motor.py
Updated all route handlers to accept controller: MotorControllerDep parameter and removed direct controller instantiation. Changed import from direct controller to dependency injection alias.
Route Handlers - Rocket
src/routes/rocket.py
Updated all route handlers (8 endpoints) to accept controller: RocketControllerDep parameter and removed direct controller instantiation. Changed import from direct controller to dependency injection alias.
Test Fixtures
tests/unit/test_routes/test_environments_route.py, test_flights_route.py, test_motors_route.py, test_rockets_route.py
Updated fixtures to patch controllers at dependencies layer instead of route layer. Replaced Mock with AsyncMock for all controller methods. Added explicit cache clearing via get_<controller>.cache_clear() before and after test execution.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20–25 minutes

  • Dependency injection module: Verify singleton factory correctness and LRU cache behavior expectations
  • Test fixture updates: Async mock setup and cache clearing mechanics require careful review to ensure test isolation and cleanup
  • Route handler changes: Consistent pattern across four files; verify import paths and parameter ordering are applied uniformly
  • Behavioral equivalence: Confirm that dependency-injected controllers behave identically to previously instantiated ones

Possibly related PRs

  • API V3 Refactoring #44: Introduced the controller and route structure that this PR now refactors to use dependency injection with singleton factories.

Suggested reviewers

  • aasitvora99
  • phmbressan
  • Gui-FernandesBR

Poem

🐰 With factories of singletons, I hop with glee,
Injected dependencies, wild and free,
Controllers cached, no duplication in sight,
Routes refactored, now everything's right! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: introducing FastAPI dependency injection for controllers across routes and tests to streamline the codebase.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

@MarcosMulari MarcosMulari changed the title ENH: streamline controller dependency injection in routes and tests [SUGGESTION] ENH: streamline controller dependency injection in routes and tests Dec 7, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (10)
README.md (1)

18-21: Specify language for fenced code block.

The code block at line 19 should specify a language identifier. This improves syntax highlighting and complies with markdown linting standards.

Apply this diff to add the text language identifier:

-```
+```text
 RuntimeError: uvloop does not support Windows at the moment
-```
+```
tests/unit/test_routes/test_motors_route.py (1)

28-45: Well-structured fixture for DI-based controller mocking.

The fixture correctly:

  • Patches MotorController at the dependencies module level
  • Uses AsyncMock for async controller methods
  • Clears the LRU cache before and after the test to ensure isolation

One minor observation: line 1 still imports Mock which appears unused in this file (only AsyncMock is used throughout).

-from unittest.mock import patch, AsyncMock, Mock
+from unittest.mock import patch, AsyncMock
tests/unit/test_routes/test_rockets_route.py (2)

22-25: Minor formatting issue: extra blank line in import block.

Line 23 contains only whitespace which creates inconsistent formatting.

 )
-
-        
+
 from src.dependencies import get_rocket_controller
-

77-96: LGTM! Fixture correctly implements the DI mocking pattern.

The fixture follows the same well-structured approach as the motors test, properly handling cache clearing for test isolation.

Similar to motors, Mock is imported on line 1 but only AsyncMock appears to be used.

-from unittest.mock import patch, Mock, AsyncMock
+from unittest.mock import patch, AsyncMock
tests/unit/test_routes/test_environments_route.py (1)

28-46: LGTM! Fixture correctly implements the DI mocking pattern.

The fixture properly handles cache clearing for test isolation.

Minor observations:

  • Lines 40-41 have two consecutive blank lines (formatting inconsistency)
  • Mock is imported on line 1 but only AsyncMock is used
         mock_class.return_value = mock_controller
-        
-        
+
         get_environment_controller.cache_clear()
tests/unit/test_routes/test_flights_route.py (1)

47-68: LGTM! Comprehensive fixture for flight controller mocking.

The fixture correctly mocks all flight controller methods including:

  • Standard CRUD operations (post_flight, get_flight_by_id, put_flight_by_id, delete_flight_by_id)
  • Simulation and binary endpoints (get_flight_simulation, get_rocketpy_flight_binary)
  • Reference-based operations (create_flight_from_references, update_flight_from_references)
  • Partial update operations (update_environment_by_flight_id, update_rocket_by_flight_id)

Same minor note: Mock is imported on line 1 but only AsyncMock is used.

-from unittest.mock import patch, Mock, AsyncMock
+from unittest.mock import patch, AsyncMock
src/dependencies.py (2)

11-22: Clarify thread-safety claim in docstring.

The docstring states "Using lru_cache ensures thread-safe singleton behavior," which is not entirely accurate. While lru_cache operations are thread-safe, there's a subtle race condition: if multiple threads call get_rocket_controller() simultaneously on the first invocation before the cache is populated, multiple RocketController() instances could be created (only one will be cached).

In practice, this is acceptable for FastAPI since controllers are typically stateless (as documented), and FastAPI's dependency system handles this gracefully. However, consider clarifying the docstring to avoid confusion.

     """
     Provides a singleton RocketController instance.
     
-    The controller is stateless and can be safely reused across requests.
-    Using lru_cache ensures thread-safe singleton behavior.
+    The controller is stateless and can be safely reused across requests,
+    so even in the unlikely event of duplicate instantiation during startup,
+    behavior remains correct.
     
     Returns:
         RocketController: Shared controller instance for rocket operations.
     """

25-55: Inconsistent docstrings across factory functions.

get_rocket_controller() includes explanation about statelessness and reuse, but the other three factories (get_motor_controller, get_environment_controller, get_flight_controller) have minimal docstrings. Consider harmonizing them for consistency.

src/routes/flight.py (2)

2-2: Clarify the primary benefit of dependency injection.

The docstring mentions "improved performance," but DI's main benefits are testability, maintainability, and lifecycle management rather than performance. Consider revising to reflect the actual benefits.

Apply this diff:

-Flight routes with dependency injection for improved performance.
+Flight routes

78-78: Remove trailing whitespace.

Several lines contain trailing whitespace which should be removed for consistency with project formatting standards.

Apply this diff:

     with tracer.start_as_current_span("read_flight"):
         return await controller.get_flight_by_id(flight_id)
-    
+
 @router.put("/{flight_id}", status_code=204)
         return await controller.update_flight_from_references(
             flight_id, payload
         )
-    
+
 @router.delete("/{flight_id}", status_code=204)
     response_class=Response,
 )
-
 async def get_rocketpy_flight_binary(
             rocket=rocket,
         )
-    
+

 
 @router.get("/{flight_id}/simulate")
     with tracer.start_as_current_span("get_flight_simulation"):
         return await controller.get_flight_simulation(flight_id)
-    
+

Also applies to: 119-119, 146-146, 212-212, 227-227

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9ed5aa4 and 24a0dfc.

📒 Files selected for processing (10)
  • README.md (1 hunks)
  • src/dependencies.py (1 hunks)
  • src/routes/environment.py (6 hunks)
  • src/routes/flight.py (10 hunks)
  • src/routes/motor.py (5 hunks)
  • src/routes/rocket.py (7 hunks)
  • tests/unit/test_routes/test_environments_route.py (2 hunks)
  • tests/unit/test_routes/test_flights_route.py (2 hunks)
  • tests/unit/test_routes/test_motors_route.py (2 hunks)
  • tests/unit/test_routes/test_rockets_route.py (2 hunks)
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: 2025-02-25T21:53:37.291Z
Learnt from: GabrielBarberini
Repo: RocketPy-Team/Infinity-API PR: 44
File: src/controllers/interface.py:49-56
Timestamp: 2025-02-25T21:53:37.291Z
Learning: In the Infinity-API architecture, controller methods are intentionally named with the model name included (e.g., `get_environment_by_id` rather than just `get_by_id`) to maintain a convention over configuration approach, enable future automatic route generation, prevent method name collisions, and provide self-documenting code.

Applied to files:

  • src/routes/environment.py
📚 Learning: 2024-11-15T15:12:21.314Z
Learnt from: GabrielBarberini
Repo: RocketPy-Team/Infinity-API PR: 38
File: lib/routes/motor.py:75-75
Timestamp: 2024-11-15T15:12:21.314Z
Learning: When modifying API route paths in `lib/routes/motor.py`, changing from `/rocketpy/{motor_id}` to `/{motor_id}/rocketpy` is acceptable when no external consumers are affected. It's acceptable to introduce this breaking change if the team has decided to adopt the new approach, provided that the `README` and related documentation are updated accordingly.

Applied to files:

  • src/routes/environment.py
  • tests/unit/test_routes/test_rockets_route.py
  • tests/unit/test_routes/test_motors_route.py
  • src/routes/motor.py
  • src/routes/flight.py
  • src/routes/rocket.py
📚 Learning: 2024-12-07T11:50:08.415Z
Learnt from: GabrielBarberini
Repo: RocketPy-Team/Infinity-API PR: 41
File: tests/test_routes/test_flights_route.py:122-125
Timestamp: 2024-12-07T11:50:08.415Z
Learning: In the project's pytest test files (e.g., `tests/test_routes/test_flights_route.py`), fixtures like `stub_rocket` and `stub_flight` are function-scoped and can be safely modified within tests without causing side effects.

Applied to files:

  • tests/unit/test_routes/test_environments_route.py
  • tests/unit/test_routes/test_rockets_route.py
  • tests/unit/test_routes/test_flights_route.py
  • tests/unit/test_routes/test_motors_route.py
  • src/routes/flight.py
📚 Learning: 2024-11-16T00:03:14.224Z
Learnt from: GabrielBarberini
Repo: RocketPy-Team/Infinity-API PR: 38
File: tests/test_routes/test_motors_route.py:42-100
Timestamp: 2024-11-16T00:03:14.224Z
Learning: In `tests/test_routes/test_motors_route.py`, focus on assessing whether the API has the capability of validating the input schema, rather than testing the extension of Pydantic validations (e.g., testing empty request payloads).

Applied to files:

  • tests/unit/test_routes/test_motors_route.py
  • src/routes/motor.py
🧬 Code graph analysis (9)
src/routes/environment.py (2)
src/services/environment.py (3)
  • environment (42-43)
  • environment (46-47)
  • EnvironmentService (11-71)
src/controllers/environment.py (3)
  • get_rocketpy_environment_binary (23-41)
  • EnvironmentController (10-61)
  • __init__ (19-20)
tests/unit/test_routes/test_environments_route.py (3)
src/dependencies.py (1)
  • get_environment_controller (37-44)
src/routes/environment.py (2)
  • get_environment_simulation (133-144)
  • get_rocketpy_environment_binary (106-129)
src/controllers/environment.py (3)
  • get_environment_simulation (44-61)
  • get_rocketpy_environment_binary (23-41)
  • EnvironmentController (10-61)
tests/unit/test_routes/test_rockets_route.py (1)
src/dependencies.py (1)
  • get_rocket_controller (12-22)
tests/unit/test_routes/test_flights_route.py (3)
src/dependencies.py (1)
  • get_flight_controller (48-55)
src/routes/flight.py (4)
  • get_flight_simulation (215-226)
  • get_rocketpy_flight_binary (147-168)
  • create_flight_from_references (47-62)
  • update_flight_from_references (99-118)
src/controllers/flight.py (5)
  • get_flight_simulation (146-164)
  • get_rocketpy_flight_binary (125-143)
  • create_flight_from_references (53-62)
  • update_flight_from_references (65-78)
  • FlightController (18-164)
src/dependencies.py (5)
src/controllers/rocket.py (1)
  • RocketController (17-97)
src/controllers/motor.py (1)
  • MotorController (10-59)
src/controllers/environment.py (1)
  • EnvironmentController (10-61)
src/controllers/flight.py (1)
  • FlightController (18-164)
src/services/rocket.py (1)
  • RocketService (26-260)
tests/unit/test_routes/test_motors_route.py (3)
src/dependencies.py (1)
  • get_motor_controller (26-33)
src/routes/motor.py (1)
  • get_motor_simulation (129-140)
src/controllers/motor.py (1)
  • get_motor_simulation (44-59)
src/routes/motor.py (1)
src/controllers/motor.py (3)
  • get_rocketpy_motor_binary (23-41)
  • get_motor_simulation (44-59)
  • MotorController (10-59)
src/routes/flight.py (1)
src/controllers/flight.py (5)
  • create_flight_from_references (53-62)
  • get_rocketpy_flight_binary (125-143)
  • get_flight_simulation (146-164)
  • FlightController (18-164)
  • update_flight_from_references (65-78)
src/routes/rocket.py (5)
src/repositories/rocket.py (1)
  • create_rocket (21-22)
src/services/rocket.py (2)
  • rocket (99-100)
  • rocket (103-104)
src/models/rocket.py (2)
  • RocketModel (25-111)
  • RocketWithMotorReferenceRequest (147-161)
src/views/rocket.py (2)
  • RocketCreated (67-69)
  • RocketRetrieved (72-74)
src/controllers/rocket.py (2)
  • create_rocket_from_motor_reference (41-46)
  • get_rocketpy_rocket_binary (61-76)
🪛 markdownlint-cli2 (0.18.1)
README.md

19-19: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (9)
tests/unit/test_routes/test_motors_route.py (1)

12-14: LGTM! Import changes align with the new DI pattern.

The import of get_motor_controller is necessary for cache management in the test fixture.

tests/unit/test_routes/test_environments_route.py (1)

13-15: LGTM! Import structure is correct.

tests/unit/test_routes/test_flights_route.py (1)

18-20: LGTM! Import structure is correct.

src/dependencies.py (2)

1-9: LGTM! Clean imports for the DI module.

Appropriate use of functools.lru_cache, Annotated, and Depends for FastAPI dependency injection.


57-62: LGTM! Well-defined type aliases for dependency injection.

The Annotated type aliases provide clean, reusable dependency declarations for route handlers, following FastAPI best practices.

src/routes/environment.py (1)

14-14: Dependency injection pattern correctly applied.

All environment endpoints consistently use EnvironmentControllerDep for controller injection. The pattern is clean and uniform across CRUD, binary, and simulation endpoints.

Also applies to: 32-32, 47-47, 63-63, 83-83, 108-108, 135-135

src/routes/motor.py (1)

14-14: Dependency injection pattern correctly applied.

All motor endpoints consistently use MotorControllerDep for controller injection, matching the pattern established in environment routes.

Also applies to: 30-33, 45-48, 60-64, 79-82, 104-107, 129-132

src/routes/rocket.py (1)

17-17: Dependency injection pattern correctly applied.

All rocket endpoints, including the motor-reference flows, consistently use RocketControllerDep for controller injection.

Also applies to: 33-36, 48-48, 64-67, 79-83, 101-101, 119-122, 144-147, 169-172

src/routes/flight.py (1)

16-16: Dependency injection pattern correctly applied.

All flight endpoints, including reference-based and partial-update flows, consistently use FlightControllerDep for controller injection.

Also applies to: 32-35, 49-49, 66-68, 80-84, 102-102, 121-124, 147-150, 173-176, 193-197, 215-218

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the application architecture to implement dependency injection for all controllers (Rocket, Motor, Environment, Flight), improving performance by using singleton instances instead of recreating controllers on every request. The implementation uses FastAPI's Depends mechanism with @lru_cache(maxsize=1) for thread-safe controller reuse.

  • Created centralized src/dependencies.py with dependency provider functions and type aliases
  • Updated all route handlers across 4 route modules to accept controllers via dependency injection
  • Refactored all route tests to properly mock controllers at the dependency layer and clear lru_cache for test isolation

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/dependencies.py New file defining singleton dependency providers for all controllers with lru_cache pattern
src/routes/environment.py Replaced manual EnvironmentController instantiation with EnvironmentControllerDep injection
src/routes/motor.py Replaced manual MotorController instantiation with MotorControllerDep injection
src/routes/rocket.py Replaced manual RocketController instantiation with RocketControllerDep injection
src/routes/flight.py Replaced manual FlightController instantiation with FlightControllerDep injection; updated docstring
tests/unit/test_routes/test_environments_route.py Updated mocks to patch src.dependencies, use AsyncMock, and clear lru_cache
tests/unit/test_routes/test_motors_route.py Updated mocks to patch src.dependencies, use AsyncMock, and clear lru_cache
tests/unit/test_routes/test_rockets_route.py Updated mocks to patch src.dependencies, use AsyncMock, and clear lru_cache
tests/unit/test_routes/test_flights_route.py Updated mocks to patch src.dependencies, use AsyncMock, and clear lru_cache
README.md Added Windows-specific guidance about uvloop compatibility issue with Docker recommendation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +212 to 213

Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

Inconsistent spacing: this line uses 4 spaces for indentation instead of the blank line pattern used elsewhere. For consistency with the rest of the file, consider using a blank line without trailing spaces here.

Suggested change

Copilot uses AI. Check for mistakes.
Comment on lines 226 to +227
return await controller.get_flight_simulation(flight_id)

Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

Inconsistent spacing: this line uses 4 spaces for indentation instead of the blank line pattern used elsewhere. For consistency with the rest of the file, consider using a blank line without trailing spaces here.

Suggested change
return await controller.get_flight_simulation(flight_id)
return await controller.get_flight_simulation(flight_id)

Copilot uses AI. Check for mistakes.
RocketView,
)


Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

Extra whitespace on this line. The line contains only spaces with no meaningful content.

Suggested change

Copilot uses AI. Check for mistakes.
Comment on lines +40 to +45


get_environment_controller.cache_clear()

yield mock_controller

Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

Extra blank line that should be removed for consistency with other test files. The pattern in other test files (motors, rockets, flights) shows no blank line between mock_class.return_value = mock_controller and get_*_controller.cache_clear().

Suggested change
get_environment_controller.cache_clear()
yield mock_controller
get_environment_controller.cache_clear()
yield mock_controller
yield mock_controller

Copilot uses AI. Check for mistakes.
return await controller.get_flight_by_id(flight_id)



Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

Inconsistent spacing: this line uses 4 spaces for indentation instead of the blank line pattern used elsewhere. For consistency with the rest of the file, consider using a blank line without trailing spaces here.

Suggested change

Copilot uses AI. Check for mistakes.
)



Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

Inconsistent spacing: this line uses 4 spaces for indentation instead of the blank line pattern used elsewhere. For consistency with the rest of the file, consider using a blank line without trailing spaces here.

Suggested change

Copilot uses AI. Check for mistakes.
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.

1 participant