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

Support kRequired / kManagerDriven access modes #99

Merged

Conversation

feltech
Copy link
Member

@feltech feltech commented Jan 31, 2024

Closes #98.

OpenAssetIO/OpenAssetIO#1209 added the kRequired and kManagerDriven access mode options for managementPolicy queries, i.e. the subset of required traits for publishing to succeed, and the subset of traits that the manager wants to dictate during publishing, respectively.

For consistency, the kWrite access mode of resolve was renamed to kManagerDriven.

So add support for these access modes in an extensible way, by making use of the kAccessNames string mapping to allow the JSON database to specialise on any access mode to managementPolicy in a consistent way.

Also add support for resolve to take any access mode, with a new JSON field supported_access_modes, which is an iterable of supported modes (i.e. kRead and/or kManagerDriven), and which defaults to only kRead.

This means we can have a JSON database entry for a "write only" entity, i.e. a "working reference" returned from a preflight API call, which should only be resolved with kManagerDriven access mode. This then supports writing the example workflow in OpenAssetIO/OpenAssetIO-MediaCreation#75.

Currently, preflight simply returns the input reference as the "working reference". Ultimately, we will want the ability to customise that.

Interestingly, register can return a different reference, in that it has the version identifier suffix appended (e.g. ?v=2). This means for the purposes of exemplification in OpenAssetIO/OpenAssetIO-MediaCreation#75, we have everything we need.

Closes OpenAssetIO#98.

OpenAssetIO/OpenAssetIO#1209 added the `kRequired` and
`kManagerDriven` access mode options for `managementPolicy` queries,
i.e. the subset of required traits for publishing to succeed, and the
subset of traits that the manager wants to dictate during publishing,
respectively.

For consistency, the `kWrite` access mode of `resolve` was renamed to
`kManagerDriven`.

So add support for these access modes in an extensible way, by making
use of the `kAccessNames` string mapping to allow the JSON database to
specialise on any access mode to `managementPolicy` in a consistent way.

Also add support for `resolve` to take any access mode, with a new JSON
field `supported_access_modes`, which is an iterable of supported modes
(i.e. `kRead` and/or `kManagerDriven`), and which defaults to only
`kRead`.

This means we can have a JSON database entry for a "write only" entity,
i.e. a "working reference" returned from a `preflight` API call,
which should only be `resolve`d with `kManagerDriven` access mode. This
then supports writing the example workflow in
OpenAssetIO/OpenAssetIO-MediaCreation#75.

Currently, `preflight` simply returns the input reference as the
"working reference". Ultimately, we will want the ability to customise
that.

Interestingly, `register` _can_ return a different reference, in that it
has the version identifier suffix appended (e.g. `?v=2`). This means for
the purposes of exemplification in
OpenAssetIO/OpenAssetIO-MediaCreation#75, we have everything we need.

Signed-off-by: David Feltell <[email protected]>
@feltech feltech self-assigned this Jan 31, 2024
@feltech feltech requested a review from a team as a code owner January 31, 2024 13:15
feltech added a commit to feltech/OpenAssetIO that referenced this pull request Jan 31, 2024
Part of OpenAssetIO#1209. Disable BAL integration tests until
OpenAssetIO/OpenAssetIO-Manager-BAL#99 is merged, which supports
breaking changes (in particular, the rename of `ResolveAccess.kWrite`
to `kManagerDriven`)

Signed-off-by: David Feltell <[email protected]>
feltech added a commit to feltech/OpenAssetIO that referenced this pull request Jan 31, 2024
Part of OpenAssetIO#1255. Re-enable BAL integration tests now that
OpenAssetIO/OpenAssetIO-Manager-BAL#99 has been merged with support
for the latest API changes.
@feltech feltech requested a review from elliotcmorris January 31, 2024 14:21
Copy link
Contributor

@elliotcmorris elliotcmorris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM

feltech added a commit to feltech/OpenAssetIO that referenced this pull request Feb 7, 2024
Part of OpenAssetIO#1209. Disable BAL integration tests until
OpenAssetIO/OpenAssetIO-Manager-BAL#99 is merged, which supports
breaking changes (in particular, the rename of `ResolveAccess.kWrite`
to `kManagerDriven`)

Signed-off-by: David Feltell <[email protected]>
@feltech feltech force-pushed the work/OpenAssetIO-1209-policyAccessModes branch from 02da248 to fbfe512 Compare February 9, 2024 15:34
@feltech feltech merged commit 17205ca into OpenAssetIO:main Feb 9, 2024
6 checks passed
@feltech feltech deleted the work/OpenAssetIO-1209-policyAccessModes branch February 9, 2024 15:37
feltech added a commit to feltech/OpenAssetIO that referenced this pull request Feb 9, 2024
Part of OpenAssetIO#1255. Re-enable BAL integration tests now that
OpenAssetIO/OpenAssetIO-Manager-BAL#99 has been merged with support
for the latest API changes.
feltech added a commit to feltech/OpenAssetIO that referenced this pull request Feb 9, 2024
Part of OpenAssetIO#1255. Re-enable BAL integration tests now that
OpenAssetIO/OpenAssetIO-Manager-BAL#99 has been merged with support
for the latest API changes.

Signed-off-by: David Feltell <[email protected]>
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.

Support kRequired and kManagerDriven access modes
2 participants