Closed tjeerddie closed 1 month ago
Attention: Patch coverage is 96.15385%
with 5 lines
in your changes missing coverage. Please review.
Project coverage is 83.77%. Comparing base (
34e4e5f
) to head (a6d858a
). Report is 1 commits behind head on main.
Files with missing lines | Patch % | Lines |
---|---|---|
orchestrator/services/subscription_relations.py | 94.94% | 3 Missing and 2 partials :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This update introduces the ability to fetch subscription relations multiple layers deep by adding depth recursion to the subscription/s relations query.
Other changes:
orchestrator/services/subscription_relations.py
._get_in_use_by_instance_relations
and_get_depends_on_instance_relations
functions where thefilter_statuses
argument was incorrectly applied to the subscriptions from thesubscription_ids
argument, rather than to their relations. This issue had no impact sincefilter_statuses
was not in use yet.statuses
filter in theSubscriptionRelationFilter
, I noticed that the loader couldn't handle lists properly in combination with its caching. This is fixed by changing the list to a tuple.More indepth description of the recursion feature:
inUseByFilter
and dependsOnFilter with.recurse_product_types
filter to recurse through specified product types. By default, recursion will go through the first 10 layers of the specifiedrecurse_product_types
.recurse_product_types
is not allowed, as recursing through all relations could significantly impact performance.For
inUseBySubscriptions
anddependsOnSubscriptions
, the following filters were added:example query that would recurse through
Test
product type, more examples can be found intests/unit_tests/graphql/test_subscription_relations.py
:The
inUseByFilter
/dependsOnFilter
works in combination withfilterBy
andsortBy
to filter and sort the recursively discovered subscriptions. For example:filterBy: [{ field: "tag", value: "MyTag" }]
sortBy: [{ field: "tag", value: ASC }]
.