-
Notifications
You must be signed in to change notification settings - Fork 29
[CI/mock_uss] Add optionnal 'modification of activated flight' behaviour #1290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| from monitoring.mock_uss.app import require_config_value | ||
| from monitoring.mock_uss.config import KEY_BEHAVIOUR_ACTIVATED_FLIGHTS_EDITABLES | ||
|
|
||
| require_config_value(KEY_BEHAVIOUR_ACTIVATED_FLIGHTS_EDITABLES) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,7 +19,10 @@ | |
|
|
||
| from monitoring.mock_uss.app import require_config_value, webapp | ||
| from monitoring.mock_uss.auth import requires_scope | ||
| from monitoring.mock_uss.config import KEY_BASE_URL | ||
| from monitoring.mock_uss.config import ( | ||
| KEY_BASE_URL, | ||
| KEY_BEHAVIOUR_ACTIVATED_FLIGHTS_EDITABLES, | ||
| ) | ||
| from monitoring.mock_uss.dynamic_configuration.configuration import get_locality | ||
| from monitoring.mock_uss.f3548v21 import utm_client | ||
| from monitoring.mock_uss.f3548v21.flight_planning import ( | ||
|
|
@@ -178,6 +181,14 @@ def unsuccessful( | |
| except PlanningError as e: | ||
| return unsuccessful(PlanningActivityResult.Rejected, str(e)) | ||
|
|
||
| if ( | ||
| not webapp.config[KEY_BEHAVIOUR_ACTIVATED_FLIGHTS_EDITABLES] | ||
| and old_status == FlightPlanStatus.OkToFly | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that rather we want to check whether the area (
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we? Because if that the case, I would rename the flag to
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, because a state change is still OK when the status is OkToFly (e.g. going contingent). From what I've seen, the USSs not supporting modifications don't support modification of the definition of the flight plan when it is in flight. But the status can still change.
Sounds reasonable |
||
| ): | ||
| return unsuccessful( | ||
| PlanningActivityResult.NotSupported, "Unable to modify an activated flight" | ||
| ) | ||
|
|
||
| step_name = "performing unknown operation" | ||
| notes: str | None = None | ||
| try: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BenjaminPelletier IIRC during the InterUSS weekly several weeks ago, when we talked about #1276, you mentioned something about having some structure to alter the behavior of the mock USS, and I believe you suggested an approach. If so, is that it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can think of a few ways to select different behavior for mock_uss:
Currently, I think we have some combination of 1 and 2. Some configuration parameters are set per instance; see all MOCK_USS_* values in docker-compose.yaml. Some configuration is set according to locality. Locality is essentially a collection of behaviors/configuration settings. It's called a locality because the largest normal source of USS behavior variations is typically between jurisdictions/localities (e.g., U-space in Switzerland versus UTM Implementation in US). We currently set locality via "dynamic configuration" (API call to change locality) which is why it's in bucket 2, but I think it would be far better to automatically select a locality based on the geographic area in which actions were occurring (bucket 3) since this is more stateless and more similar to how real USSs would behave.
I don't think bucket 1 is a very good idea because it's difficult to manage and keep track of more mock_uss instances. So, I'm not a huge fan of configuring via environment variable since that's effectively configuring via mock_uss instance.
"Locality" is perhaps not an optimal word for "bundle of configurable behaviors", but I think the idea of a single place where configurable behaviors are selected together is still a good one. And, since the strongest candidate for bucket 3 is selecting via geography (and that's the place configuration selection will most likely be done by real USSs), I think "locality" is probably still a decent name for a bundle of configurable behaviors.
In the long term, I think the ideal outcome would be that a mock_uss is brought up with a configuration that specifies multiple configuration bundles (renamed from "localities") and their geographic bounds. Then, tests are conducted in the appropriate geographic areas for the expected outcomes. There would be no need for changing locality at runtime and probably some (but not all) of the MOCK_USS_* parameters would be moved into configuration bundles (especially auth spec, DSS URL, and public key). In this case, we would have a variant locality that looks like another standard locality, but with the different editable-flight behavior.
I'm open to what should be done in the meantime, but I'm not a huge fan of going down the "configuration per instance" route as configuration via environment variable implies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using locality seems a good option, I do have a few questions:
I think we want to be able to also have different behaviors in a same 'geographical location', e.g. to validate that interactions with two different USS is producing expected results. Would that be doable with locality settings or this is something that need to be adapted?
I also think that having a 'bad uss', that don't produce expected result, allowing a (specific) test suite to verify that tests fails as expected to would be a good idea, would you also use a locality in that case?