-
Notifications
You must be signed in to change notification settings - Fork 28
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
Refine Context.access
modes to better convey intent
#1016
Comments
ProposalRe work the
Removing
|
If we wanted to extend BAL to test the register behaviour, we'd want a publish workflow where : When registering against an existing entity ref
By giving BAL this behaviour, we can test kCreateRelated by passing kCreateRelated when the traitsets match, as asserting a new entity has been created, rather than a new version as would normally be done (with kWrite) |
Documenting discussions with @feltech This ticket has a problem in testing, specifically because of the open nature of the workflow, we're struggling to bring any specific api-compliance checks to bear. There is a decent one we could do if we link the idea of supporting So, to move forward, we're planning to test this as a BAL business logic suite, with the idea that we may be able to bring some tests over to api compliance if they make sense, sort of on a when-we see them basis. But even if not it serves as legitimate test coverage for this workflow. First, we want to give BAL the ability to write in both ways in OpenAssetIO/OpenAssetIO-Manager-BAL#62, doing the traitset-match check as we've described in the workflow outlines here. This can be done independently of this ticket. Then, we'll need to do the retarget-workflow to give BAL the ability to understand |
(Sorry catching up, so sorry if I've misinterpreted anything)
Can we focus on getting the changes in OpenAssetIO done and merged, and move on to tackle the other preflight changes. before you get onto BAL For this topic. As you noted, the fact that this test in in the business logic suite, highlights that this isn't something we need an integration test for to merge the OpenAssetIO changes, as they are not testing the implementation in the core library, but the fact that "you can conceptually implement this in some manager". |
Closes OpenAssetIO#57. OpenAssetIO/OpenAssetIO#1016 refined the Context access patterns to formalize the creation of "children" and other related entities via publish to an existing reference. BAL does not yet support this kind of creation, and so should error in the case. So respond appropriately to Access mode in various API functions, by calling the provided error callback, except in the case of `managementPolicy` which responds with empty `TraitsData` objects (signifying "unmanaged"). Note that for consistency, this changes the error message output when attempting to `resolve` with `kWrite` access. Signed-off-by: David Feltell <david.feltell@foundry.com>
Closes OpenAssetIO#57. OpenAssetIO/OpenAssetIO#1016 refined the Context access patterns to formalize the creation of "children" and other related entities via publish to an existing reference. BAL does not yet support this kind of creation, and so should error in the case. So respond appropriately to Access mode in various API functions, by calling the provided error callback, except in the case of `managementPolicy` which responds with empty `TraitsData` objects (signifying "unmanaged"). Note that for consistency, this changes the error message output when attempting to `resolve` with `kWrite` access. Signed-off-by: David Feltell <david.feltell@foundry.com>
Closes OpenAssetIO#57. OpenAssetIO/OpenAssetIO#1016 refined the Context access patterns to formalize the creation of "children" and other related entities via publish to an existing reference. BAL does not yet support this kind of creation, and so should error in the case. So respond appropriately to Access mode in various API functions, by calling the provided error callback, except in the case of `managementPolicy` which responds with empty `TraitsData` objects (signifying "unmanaged"). Note that for consistency, this changes the error message output when attempting to `resolve` with `kWrite` access. Signed-off-by: David Feltell <david.feltell@foundry.com>
Closes OpenAssetIO#57. OpenAssetIO/OpenAssetIO#1016 refined the Context access patterns to formalize the creation of "children" and other related entities via publish to an existing reference. BAL does not yet support this kind of creation, and so should error in the case. So respond appropriately to Access mode in various API functions, by calling the provided error callback, except in the case of `managementPolicy` which responds with empty `TraitsData` objects (signifying "unmanaged"). Note that for consistency, this changes the error message output when attempting to `resolve` with `kWrite` access. Signed-off-by: David Feltell <david.feltell@foundry.com>
Closes OpenAssetIO#57. OpenAssetIO/OpenAssetIO#1016 refined the Context access patterns to formalize the creation of "children" and other related entities via publish to an existing reference. BAL does not yet support this kind of creation, and so should error in the case. So respond appropriately to Access mode in various API functions, by calling the provided error callback, except in the case of `managementPolicy` which responds with empty `TraitsData` objects (signifying "unmanaged"). Note that for consistency, this changes the error message output when attempting to `resolve` with `kWrite` access. Signed-off-by: David Feltell <david.feltell@foundry.com>
What
Refine the
Context.Access
enum to better convey the intent of the host.Why
The current options leave ambiguity in the handling of publishing operations (see notes).
Acceptance Criteria
Context.Access
modes:isForWrite
method update to include the newkCreateRelated
IsMultiple
removedpreflight
, as you then have a specific working ref, you a host should usekWrite
for the ensuingregister
. If you're not calling preflight, thenkCreateRelated
should be used still.managementPolicyDocs
apiComplianceSuite
coverage (spike to determine exact checks - eg, if you dont provide the fixtures, is there a default check for error cases, checks that preflight and register don't return the input ref when its not from preflight)Notes
The behavior when publishing is currently defined solely in terms of how the published entities trait set relates to that of the target reference:
a. When the trait set of the existing entity matches that of the new entity, a new version should be created if allowed, or error.
b. When the trait set of the existing entity does not match, the new entity as a child or other meaningful relation to the existing entity if permitted, or error.
The fact that most references are provided by the manager (or the manager's user) means that in many situations, this works well, and the intended result is easily discerned.
There are however edge cases that can arise with certain trait sets, or when more programatic operations are undertaken.
Making a "folder in a folder".
The common file system operation of making a folder inside a folder highlights the case for us in terms that are perhaps more accessible than OpenAssetIO abstract terminology.
As a host, if I wanted to make a folder, inside a folder for which I know the entity reference, using the publishing rules of thumb, I "publish the new folder to its parent", which follows 2b above. There is an issue however, the trait set of the new folder is the same as the parent (as it's a 'folder in a folder'). This means that the manager will assume we are intending 2a. It has now way of knowing that this is meant to be a new folder, rather than an update to the one targeted by the entity reference.
We need a way to tell the manager that the entities being published are always intended to be new.
The
access
property of the context exists to inform the manager of the intent of the host, so perhaps we already have a solution. If we look at the existing context access modes, one potential solution iskWriteMultiple
as that implicitly suggests that "more are to come", so a manager could infer that this must be a creation operation. However, if a host is only making a single new entity, then it is quite illogical to set theaccess
to something with "multiple" on the end.If we further scrutinize that page, it becomes apparent, that half of the existing modes are only used in a UI context. Perhaps we need to re-think our options there.
The text was updated successfully, but these errors were encountered: