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

--Add Configuration State Flags - Part 2 (Hidden file path fields) #2398

Merged
merged 14 commits into from
May 23, 2024

Conversation

jturner65
Copy link
Contributor

Motivation and Context

This PR is the 2nd of 2 PRs started with this PR that add state-based support to ConfigValues. This PR is primarily concerned with implementing hidden/internal configuration fields intended to be used for data that is only locally relevant, such as fully-qualified file paths.

We do not want file names saved to json that embed absolute path data, so we need to keep a version of the path data that remains relative to the location of the JSON config file while we also want to have an easily consumed absolute path to the assets in question. Using the hidden field feature, paths can be saved in the configs as they are loaded, or otherwise relative to the dataset config directory, while they can be accessed internally fully qualified.

How Has This Been Tested

Local c++ and python tests pass

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have completed my CLA (see CONTRIBUTING)
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label May 20, 2024
@jturner65 jturner65 changed the title --add Configuration State Flags - Part 2 (Hidden file path fields) --Add Configuration State Flags - Part 2 (Hidden file path fields) May 20, 2024
@jturner65 jturner65 requested a review from aclegg3 May 20, 2024 23:49
These fields will hold the fully qualified file paths that we wish to consume internally but do not wish to write to disk.
Remove the path and have only relative filepath in primary handle attribute; put fully qualified version in hidden handle attribute.

Still fails in some edge cases
This will obviate the need for registering a template before it can be used. Mainly going to be consumed by tests, which often bypass internal control-flow branches that would otherwise automatically register these modified templates.
When a path is set by the user via the path/handle attributes properties, the filter function will copy the fully qualified path to the appropriate read-only property and attempt to transform the path to be relative to the location of the owning dataset's path structure.
If no collision asset was given the given render asset handles should be used.
Copy link
Contributor

@aclegg3 aclegg3 left a comment

Choose a reason for hiding this comment

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

Looks good to me. Minor typos and a question.

src/esp/metadata/attributes/SemanticAttributes.h Outdated Show resolved Hide resolved
src/esp/metadata/managers/AttributesManagerBase.h Outdated Show resolved Hide resolved
src/esp/metadata/managers/AttributesManagerBase.h Outdated Show resolved Hide resolved
@jturner65 jturner65 merged commit 33abe81 into main May 23, 2024
10 checks passed
@jturner65 jturner65 deleted the ConfigVals_Part2 branch May 23, 2024 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants