OpenAssetIO / OpenAssetIO-TraitGen

A code generation tool that produces OpenAssetIO Traits and Specifications from a simple YAML description.
Apache License 2.0
5 stars 3 forks source link

Add version-agnostic trait detection #84

Open feltech opened 3 weeks ago

feltech commented 3 weeks ago

What

Support queries to detect whether a trait ID matches a trait, ignoring version.

Why

The work in https://github.com/OpenAssetIO/OpenAssetIO-MediaCreation/issues/64 developed a strategy for versioning of traits. This works by changing the unique ID of a trait to include a version number. This means that detecting if a trait set contains a trait, where the version is not important, means testing every version of the trait until one matches.

Hosts/managers are likely to want to branch at a high level based on traits, and not initially care what version they are.

There is a danger hosts/managers will work around this by abusing the format of the trait ID, i.e. to strip off the version tag. However, the trait ID should be viewed as opaque by consumers.

So at minimum we need a way to test if a single string ID is a given trait, ignoring version.

Notes

As an extension, version-agnostic trait set/data container queries could be added for convenience. Changes to TraitsData might be needed to do this efficiently.

A useful knock-on effect of this could allow specification trait sets to be version agnostic (though constructing a trait via a Specification view class would of course still need to choose a version).

feltech commented 3 weeks ago

This request came up during the TSC.

feltech commented 2 weeks ago

Blocked on #80