Skip to content
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

Configurable hasCapability responses #115

Merged
merged 1 commit into from
Jul 22, 2024

Conversation

feltech
Copy link
Member

@feltech feltech commented Jul 10, 2024

Closes #84. Host applications must be able to tolerate manager plugins that do not support the full suite of (optional) capabilities that a manager may implement. However, there was no way for hosts to use BAL to test their logic for dealing with different combinations of capabilities.

In addition, configurable capabilities are required to enable e2e testing of the capability-based routing used by the upcoming hybrid plugin system (see OpenAssetIO/OpenAssetIO#1202).

So add a simple way to override the default set of capabilities reported by BAL, by adding an optional "capabilities" list element to the library, where each element is a stringified capability, as defined in kCapabilityNames. Presence of a capability in this list indicates that it is supported. If the list is not found, then the default (i.e. true) set of capabilities is used.

Short-circuit methods where the capability is unsupported. Instead, call the base class (which will raise an error).

This logic is similar to that used in the SimpleCppManager (see OpenAssetIO/OpenAssetIO#1324).

Also see OpenAssetIO/OpenAssetIO-MediaCreation#99 for context.

@feltech feltech self-assigned this Jul 10, 2024
@feltech feltech requested a review from a team as a code owner July 10, 2024 16:53
@feltech feltech force-pushed the work/84-configurableCapabilities branch from 9f94199 to 768fa0b Compare July 10, 2024 16:54
@feltech feltech requested a review from hutchinson July 16, 2024 09:18
@feltech feltech force-pushed the work/84-configurableCapabilities branch from 768fa0b to 37a3595 Compare July 16, 2024 12:55
@feltech feltech force-pushed the work/84-configurableCapabilities branch from 37a3595 to 0eb8c47 Compare July 22, 2024 17:02
Closes OpenAssetIO#84. Host applications must be able to tolerate manager plugins
that do not support the full suite of (optional) capabilities that a
manager may implement. However, there was no way for hosts to use BAL
to test their logic for dealing with different combinations of
capabilities.

In addition, configurable capabilities are required to enable e2e
testing of the capability-based routing used by the upcoming hybrid
plugin system (see OpenAssetIO/OpenAssetIO#1202).

So add a simple way to override the default set of capabilities reported
by BAL, by adding an optional "capabilities" list element to the
library, where each element is a stringified capability, as defined in
`kCapabilityNames`. Presence of a capability in this list indicates that
it is supported. If the list is not found, then the default (i.e. true)
set of capabilities is used.

Short-circuit methods where the capability is unsupported. Instead, call
the base class (which will raise an error).

This logic is similar to that used in the SimpleCppManager (see
OpenAssetIO/OpenAssetIO#1324).

Signed-off-by: David Feltell <[email protected]>
@feltech feltech force-pushed the work/84-configurableCapabilities branch from 0eb8c47 to 1f65d3d Compare July 22, 2024 17:20
@feltech feltech merged commit cc3b921 into OpenAssetIO:main Jul 22, 2024
18 checks passed
@feltech feltech deleted the work/84-configurableCapabilities branch July 22, 2024 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make hasCapability configurable
2 participants