ayon-core icon indicating copy to clipboard operation
ayon-core copied to clipboard

General: Unify profile filter criteria in code

Open BigRoy opened this issue 2 years ago • 8 comments

Description

Profile filtering is done in a myriad of locations in the code and in some areas I think can be unified to avoid logic differences and errors.

As an example:

I'm aware the filter_profiles is also used in other ways with other filter criteria. However it seems like a bunch of areas use the same filter criteria but seemingly with little consistency? At this point in time I'm mostly targeting those filtering criteria using

Even better if we could also unify this in Admin Settings with its own Profile Filter Schema for the settings - so that if we change the schema and the function all areas support the extra filtering features, like how it appears "Task Type" was added at a later state but not correctly implemented in some areas?

Describe the solution you'd like

Preferably expose a get_profile_filter_criteria method that clearly describes what it expects as input values. Or find another way to ease profile filtering in the many different locations in the code base.

In the Integrator Refactor I tried to use the simplest data source that is accessible that had the 'right' formatting compared to what the old integrator was doing and turn that into get_profile_filter_criteria and made it use only the parsed anatomyData. Not saying that's the good way and I'd definitely love to include that in this Issue/discussion.

Additionally I think we can get by by having a single collect_profile_filter_criteria Collector so that other plug-ins could even use the cached instance.data["profile_filter_criteria"] or alike. Not sure if better but at least it'd mean consistent across the publishing workflow.

Nonetheless I feel the urge to just have an easily accessible and consistent way to create the filter criteria would be beneficial.

[cuID:OP-2989]

BigRoy avatar Mar 30 '22 08:03 BigRoy