[monitorlib] Add generic flight_planning client #234
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR primarily introduces a new API-agnostic client to command USSs to perform flight planning activities. The business object data structures are patterned off the new flight_planning API, but the business objects are intended to be independent of API development and the first implementation of this flight planning client in this PR uses the legacy scd API. That new client is then used in the existing FlightPlanner object to minimize changes in a single PR -- a later PR will remove or substantially change the FlightPlanner object to more closely align with the new flight_planning API and this client. Another later PR will also switch flight intent data from the existing format to the FlightInfoTemplate format established in this PR, at which point injection using the new client will be simpler and we can avoid the current double conversion between legacy SCD API and new flight planning paradigm.
A bug with moderate functional impact is fixed: previously, mock_uss would reject attempts to make a flight Nonconforming when it conflicted with another operational intent even though off-nominal operational intents should be allowed to conflict with other operational intents. Note that a lot of lines are marked as changes in routes_injection, but most of lines 300+ are just indenting previously-existing code. A few other smaller potential bugs are fixed as well: the off-nominal volumes are counted as well when computing operational intent bounds.
A bug/TODO in conflict_equal_priority_not_permitted hiding the bug above is also fixed now that NotSupported is available.
The flight_intent_validation scenario is updated to remove the test case where a nominal flight with off-nominal volumes is injected since this is merely an invalid injection request (which can no longer be represented with the new client) and not really testing the standard requirements. Instead, OPIN0015 is still tested by checking nominal operational intents for off_nominal_volumes at each opportunity.
Since ConflictWithFlight is deprecated, Rejected is added as another acceptable result whenever ConflictWithFlight is expected.
A small bug in test_steps is fixed for responses that do not specify certain optional fields.