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

Attributes: enums with additional metadata #314

Merged
merged 10 commits into from
Sep 30, 2024

Conversation

martastain
Copy link
Member

@martastain martastain commented Aug 6, 2024

This pull request introduces several changes to enhance attribute handling, improve error logging, and update project setup processes. The most important changes include adding a new property to fetch project defaults, updating logging methods, and modifying attribute handling in various modules.

Attribute Handling Enhancements:

  • Added a new project_defaults property in ayon_server/entities/core/attrib.py to fetch default attribute values for projects.
  • Updated parse_attrib_data and rebuild_inherited_attributes to utilize the new project_defaults property. (ayon_server/graphql/utils.py: [1] ayon_server/helpers/inherited_attributes.py: [2]
  • Added icon and color fields to the AttributeEnumItem class in ayon_server/types.py to support additional attribute metadata.

Logging Improvements:

  • Replaced logging.error with log_traceback for better error traceability in generate_model function in ayon_server/entities/models/generator.py. [1] [2]

Project Setup Updates:

  • Included a call to rebuild_inherited_attributes for each project in the setup process to ensure attributes are correctly initialized in setup/__main__.py.
  • Added a new attribute priority with enum values and associated metadata in setup/attributes.py.

These changes collectively aim to improve the robustness and maintainability of the attribute handling system and enhance the setup process for new projects.Adds icon and color to AttributeEnumItem model.

@martastain martastain linked an issue Aug 6, 2024 that may be closed by this pull request
@martastain martastain added the type: enhancement Improvement of existing functionality or minor addition label Aug 6, 2024
@martastain martastain self-assigned this Aug 6, 2024
@martastain martastain requested a review from Innders September 18, 2024 07:27
@martastain martastain marked this pull request as ready for review September 18, 2024 07:27
@martastain
Copy link
Member Author

@Innders Are we adding that priority built-in attribute?

setup/attributes.py Outdated Show resolved Hide resolved
@martastain
Copy link
Member Author

martastain commented Sep 26, 2024

@Innders i've changed the way defaults propagate to the children entities, so it should now display correctly the default priority set in anatomy or set as default on the attribute. In order to rebuild the hierarchy on the project created before this attribute was introduced, it is necessary to run the setup process (make setup). that will be triggered during server update, so it shouldn't cause issues.

@martastain martastain requested a review from Innders September 26, 2024 12:15
@Innders Innders requested review from flynput and removed request for Innders September 27, 2024 12:38
@martastain martastain linked an issue Sep 27, 2024 that may be closed by this pull request
@martastain martastain requested a review from Innders September 27, 2024 14:47
@martastain martastain merged commit d29dc98 into develop Sep 30, 2024
@martastain martastain deleted the 313-enums-with-additional-metadata branch October 21, 2024 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Improvement of existing functionality or minor addition
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Attribute defaults: not used in entity creation Attributes: priority
2 participants