Work/88 trait versioning#4
Closed
feltech wants to merge 22 commits into
Closed
Conversation
Part of OpenAssetIO#80. The .editorconfig setting were only applied to `.yml` and not `.yaml`, yet our tests use `.yaml`. Signed-off-by: David Feltell <david.feltell@foundry.com>
Part of OpenAssetIO#80. The main OpenAssetIO project updated to Clang-Tidy 19 in OpenAssetIO/OpenAssetIO#1390. The TraitGen C++ tests run the generated code through `clang-tidy`, which failed for v19, specifically the `modernize-use-auto` check. So tweak the C++ code template to satisfy the failing check, allowing us to use a common Clang-Tidy version across projects. Signed-off-by: David Feltell <david.feltell@foundry.com>
6e426c8 to
12fc9c2
Compare
Part of OpenAssetIO#80. The `unique_name_parts` field is not, in general, a tuple of a single element. In order to allow for arbitrary length tuples, we must suffix an ellipsis. Signed-off-by: David Feltell <david.feltell@foundry.com>
Closes OpenAssetIO#80. Update the schema to support a dictionary of "versions" for traits and specifications, where each version contains the full trait/specification definition. Use string keys for the version, rather than integer keys, to provide maximum scope for future extension (e.g. tagged, semver). This decision was not called out in the original design. Signed-off-by: David Feltell <david.feltell@foundry.com>
Add version specifiers to `TraitDeclaration`, `TraitReference` and `SpecificationDeclaration` for use in constructing IDs and class names. Signed-off-by: David Feltell <david.feltell@foundry.com>
Add a `.v1` suffix to trait IDs and an `_v1` suffix to trait and specification class names (where `1` is the version string). Update log output from command-line script to add version numbers. Signed-off-by: David Feltell <david.feltell@foundry.com>
Signed-off-by: David Feltell <david.feltell@foundry.com>
Do not add a version suffix to the ID for the first version of a trait, to maintain backward compatibility. Signed-off-by: David Feltell <david.feltell@foundry.com>
Add trait classes that match the previous scheme, i.e. with no `_v1` suffix, which alias the first version of a trait, to maintain backward compatibility. Use inheritance to ensure maximum compatibility, rather than duplicating the class. Signed-off-by: David Feltell <david.feltell@foundry.com>
Signed-off-by: David Feltell <david.feltell@foundry.com>
More thoroughly test docstring generation, hence fix discovered issue with C++ docstring. Signed-off-by: David Feltell <david.feltell@foundry.com>
Mark non-versioned trait view classes as deprecated in the docstring. They are only for backward compatibility - going forward, hosts/managers should be explicit and use the version-suffixed classes. Signed-off-by: David Feltell <david.feltell@foundry.com>
Since we're now using the `to_python_*_name` filters multiple times for the same input (in particular, class names), we're duplicating the same "Conforming" warning logs several times. So de-duplicate by keeping a cache of warnings that have already been logged. Signed-off-by: David Feltell <david.feltell@foundry.com>
Signed-off-by: David Feltell <david.feltell@foundry.com>
Add a `DeprecationWarning` using the `warnings` module when an unversioned trait view class is first constructed. Use the class name in the warning text, so a separate warning will be generated for each non-migrated class. Signed-off-by: David Feltell <david.feltell@foundry.com>
12fc9c2 to
69b8b40
Compare
Add `[[deprecated]]` annotation to non-versioned trait view classes. Signed-off-by: David Feltell <david.feltell@foundry.com>
Similarly to traits, add unversioned Specification view classes for backward compatibility, with deprecation warnings. Signed-off-by: David Feltell <david.feltell@foundry.com>
Signed-off-by: David Feltell <david.feltell@foundry.com>
Add a "deprecated" tag to the schema, allowing traits and specifications to be flagged as due for complete removal (i.e. all versions). Signed-off-by: David Feltell <david.feltell@foundry.com>
Add deprecation docstrings and warnings for traits and specifications flagged with `deprecated: true`. Flag warnings at runtime in Python using the `warnings` module and C++ at compile time using the `[[deprecated]]` annotation. Signed-off-by: David Feltell <david.feltell@foundry.com>
69b8b40 to
7280d76
Compare
Add a CTest target for testing C++ deprecation warnings. Hence remove suppressions from the source and suppress at the compiler warning level, other than for the explicit deprecation warning test. Unfortunately, testing multiple raw string matches in build output via CTest is rather involved, but can be made to work. Signed-off-by: David Feltell <david.feltell@foundry.com>
Signed-off-by: David Feltell <david.feltell@foundry.com>
7280d76 to
7d76d22
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.