Skip to content

Commit b20b012

Browse files
authored
Merge pull request #51 from foundrytom/work/48-versionTraits
Add versioning traits/specifications
2 parents acb4c09 + 0a867de commit b20b012

File tree

2 files changed

+198
-16
lines changed

2 files changed

+198
-16
lines changed

RELEASE_NOTES.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,26 @@ Release Notes
33

44
v1.0.0-alpha.x
55
--------------
6-
### New Features
6+
7+
### New features
78

89
- Added ability to generate python package whilst installing via cmake
910
build system.
1011
Added cmake variables `OPENASSETIO_MEDIACREATION_GENERATE_PYTHON` and
1112
`OPENASSETIO_MEDIACREATION_PYTHON_SITEDIR` to support this.
1213

14+
- Added traits and specifications to define and query entity versioning
15+
information.
16+
[#48](https://github.com/OpenAssetIO/OpenAssetIO-MediaCreation/issues/48)
17+
1318
v1.0.0-alpha.6
1419
--------------
1520

1621
### Breaking changes
1722

1823
- Removed speculative timeline traits pending real-world use cases.
1924

20-
### New Features
25+
### New features
2126

2227
- Added `openassetio_mediacreation.traits.auth.BearerTokenTrait`.
2328

@@ -102,6 +107,6 @@ v1.0.0-alpha.2
102107
v1.0.0-alpha.1
103108
--------------
104109

105-
### New Features
110+
### New features
106111

107112
- Initial release.

traits.yml

Lines changed: 190 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
11
# yaml-language-server: $schema=https://raw.githubusercontent.com/OpenAssetIO/OpenAssetIO-TraitGen/main/python/openassetio_traitgen/schema.json
22
# yamllint disable-line rule:document-start
33
package: openassetio-mediacreation
4-
54
description: Well-known Traits and Specifications for use in OpenAssetIO
65
hosts and managers.
7-
86
traits:
7+
usage:
8+
description: >
9+
Base traits that scope a trait set for use within a specific
10+
context, such as resolution or relationship queries. Exactly
11+
one of these should be included in any given Specification.
12+
members:
13+
Entity:
14+
description: The trait set defines qualities of an entity.
15+
usage:
16+
- entity
17+
Relationship:
18+
description: >
19+
The trait set defines a relationship between one or more
20+
entities.
21+
usage:
22+
- relationship
923
content:
1024
description: Traits related to abstract content.
1125
members:
@@ -26,13 +40,13 @@ traits:
2640
location:
2741
type: string
2842
description: >
29-
The location of the entities external content.
43+
The location of the entity's external content.
3044
3145
32-
This must be a valid URL so special characters need to
33-
be encoded.
46+
This must be a valid URL, so special characters need to
47+
be encoded accordingly.
3448
identity:
35-
description: Traits that aid identification of an entity
49+
description: Traits that aid the identification of an entity.
3650
members:
3751
DisplayName:
3852
description: >
@@ -45,30 +59,123 @@ traits:
4559
properties:
4660
name:
4761
type: string
48-
description: |
62+
description: >
4963
The humanized name of entity itself, not including any
5064
hierarchy or classification.
5165
66+
5267
For example:
5368
- `"Cuttlefish v1"` - for a version of an asset
5469
- `"seq003"` - for a sequence in a hierarchy
5570
5671
qualifiedName:
5772
type: string
58-
description: |
59-
An unambiguous, humanised name for the entity.
73+
description: >
74+
An unambiguous, humanized name for the entity.
75+
6076
6177
The display name may want to consider the host, and any other
6278
relevant Context information to form a display name for an
6379
entity that can uniquely identify the entity in that context.
6480
81+
6582
For example:
6683
- `"dive / build / cuttlefish / model / v1"` for a version
6784
of an asset in an 'open recent' menu.
6885
- `"Sequence 003 [ Dive / Episode 1 ]"` for a sequence in
69-
an hierarchy as a window title.
86+
a hierarchy as a window title.
87+
lifecycle:
88+
description: >
89+
Traits that are concerned with describing aspects of the lifecycle
90+
of an entity, such as versioning.
91+
members:
92+
Version:
93+
description: >
94+
Describes a specific version of an entity.
95+
96+
97+
A version is defined as a revision or iteration of what is
98+
otherwise the same logical entity. If supported by a manager,
99+
versions are created when new data is published to an existing
100+
entity. Not all managers may version all types of entity.
101+
102+
103+
There is no requirement for version to be a singular atomic
104+
series, managers may wish to support "meta versions", such as
105+
'vLatest' or similar, or provide multiple parallel versioning
106+
streams.
107+
108+
109+
This trait can be used in several places:
110+
- When resolved, the manager should provide information about
111+
the version of the referenced entity. This trait should only
112+
be imbued if the target entity is considered versioned by the
113+
manager, and it can populate the stableTag property.
114+
- When responding to managementPolicy for an entity trait set,
115+
the manager should imbue this trait if that type of entity
116+
is version managed by the manager (not all managers version
117+
all types of entity).
118+
- When used within a relationship query, this trait indicates
119+
that the returned entities should be constrained to other
120+
versions of the logical entity targeted by the reference.
121+
usage:
122+
- entity
123+
- relationship
124+
- managementPolicy
125+
properties:
126+
specifiedTag:
127+
type: string
128+
description: >
129+
An unambiguous identifier (tag) for the specific version of
130+
an entity targeted by a specific reference.
131+
132+
133+
Examples of version tags include "1", "v2", "latest".
134+
70135
136+
If the reference itself does not contain a version
137+
specifier and relies on dynamic behaviour, then this should
138+
be left empty.
139+
stableTag:
140+
type: string
141+
description: >
142+
The tag (see 'specifiedTag') targeted by the reference once
143+
meta-versions or other dynamic behaviour is applied.
144+
145+
146+
If, for example, references without an explicit version
147+
yield the most recent, then this should be set to
148+
the tag of that version. When referencing some other
149+
semantic state (eg. approval), this should be set to the
150+
tag of the concrete version that matches the specific
151+
state.
71152
153+
154+
Examples of stable version tags include "1", "v2".
155+
156+
157+
This property should always be set when the Version trait
158+
is imbued as part of a resolve response. If the entity is
159+
not versioned, then the trait itself should not be imbued.
160+
Stable:
161+
description: >
162+
Defines that the entity references returned from a
163+
relationship query with this trait should be devoid of any
164+
dynamic behaviour. This includes concepts such as
165+
meta-versioning or context-specific variation that results
166+
logically different data being supplied.
167+
168+
169+
This is generally used to snapshot/bookmark specific
170+
configurations to avoid temporal instability and/or ensure
171+
processes are repeatable.
172+
173+
174+
Note: This does not include variations such as regional
175+
adaptation of the LocatableContent trait, where the underlying
176+
data remains the same.
177+
usage:
178+
- relationship
72179
managementPolicy:
73180
description: Traits used in a Manager's managementPolicy response.
74181
members:
@@ -89,7 +196,7 @@ traits:
89196
like the opportunity to manage the data, but the user should
90197
still be presented with standard Host UI for the type as an
91198
option.
92-
* If the "exclusive" property is set to true, then the Manager
199+
* If the "exclusive" property is set to true, then the Manager
93200
takes exclusive control over data with the queried trait set,
94201
and any standard host interfaces etc should be suppressed.
95202
usage:
@@ -109,7 +216,6 @@ traits:
109216
110217
If False, then standard host controls can be presented in
111218
addition to any custom manager UI.
112-
113219
ResolvesFutureEntities:
114220
description: >
115221
A trait indicating a manager can potentially resolve the
@@ -131,7 +237,23 @@ traits:
131237
determine a suitable output location.
132238
usage:
133239
- managementPolicy
134-
240+
relationship:
241+
description: Traits specific to qualities of a relationship.
242+
members:
243+
Singular:
244+
description: >
245+
The relationship should return at most one reference for each
246+
input. Unless otherwise qualified, relationships are
247+
considered one-to-many.
248+
usage:
249+
- relationship
250+
Unbounded:
251+
description: >
252+
The relationship may return large numbers of results for each
253+
input, and so must be used with the paged API methods, such as
254+
Manager.getWithRelationshipPaged.
255+
usage:
256+
- relationship
135257
auth:
136258
description: Traits related to authentication and authorization.
137259
members:
@@ -146,3 +268,58 @@ traits:
146268
type: string
147269
description: >
148270
Contents of the token.
271+
specifications:
272+
lifecycle:
273+
description:
274+
Specifications that are concerned with describing aspects of the
275+
lifecycle of an entity, such as versioning.
276+
members:
277+
EntityVersionsRelationship:
278+
description: >
279+
A relationship between alternate versions of the same logical
280+
entity. This may include unstable versions such as "latest".
281+
traitSet:
282+
- namespace: usage
283+
name: Relationship
284+
- namespace: relationship
285+
name: Unbounded
286+
- namespace: lifecycle
287+
name: Version
288+
usage:
289+
- relationship
290+
StableEntityVersionsRelationship:
291+
description: >
292+
Retrieves references to alternate stable versions of the same
293+
logical entity. This will not include unstable versions such
294+
as "latest".
295+
traitSet:
296+
- namespace: usage
297+
name: Relationship
298+
- namespace: relationship
299+
name: Unbounded
300+
- namespace: lifecycle
301+
name: Version
302+
- namespace: lifecycle
303+
name: Stable
304+
usage:
305+
- relationship
306+
StableReferenceRelationship:
307+
description: >
308+
Retrieves a stable reference to the supplied entity that is
309+
guaranteed to always point to that specific entity and version.
310+
311+
312+
This will apply and remove any dynamic behaviour such as
313+
"latest version" or other context-sensitive behaviour. The
314+
result may be used as a persistent bookmark (such as in an
315+
"open recent" menu), or to snapshot the specific entities used
316+
by a process for archival.
317+
traitSet:
318+
- namespace: usage
319+
name: Relationship
320+
- namespace: relationship
321+
name: Singular
322+
- namespace: lifecycle
323+
name: Stable
324+
usage:
325+
- relationship

0 commit comments

Comments
 (0)