-
Notifications
You must be signed in to change notification settings - Fork 88
Set version tags on publish #1850
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
Merged
iLLiCiTiT
merged 35 commits into
develop
from
enhancement/1673-yn-0458-set-version-tags-on-publish
Jul 9, 2026
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
f089bea
Add Tags enum to integrator, and add tags to version entity on integr…
MustafaJafar de1995b
Make Ruff Happy
MustafaJafar 3d85c26
Move tags enum into a separate plugin and make it optional.
MustafaJafar 2d29773
remove debug line
MustafaJafar c3e7e8e
Merge branch 'develop' into enhancement/1673-yn-0458-set-version-tags…
MustafaJafar b6f8bc0
use instance.data instead of version data
MustafaJafar 045c223
Merge branch 'enhancement/1673-yn-0458-set-version-tags-on-publish' o…
MustafaJafar 1734ede
make ruff happy
MustafaJafar f2fb865
Merge branch 'develop' into enhancement/1673-yn-0458-set-version-tags…
MustafaJafar 74550fb
CollectVersionTags: deal with tags as a set
MustafaJafar ba4d836
Tweak `tags` type, raise error if not iteratable or a list of strings…
MustafaJafar da27016
CollectVersionTags: skip doing anything if no version tags have been …
MustafaJafar 8fa69de
CollectVersionTags: optimize get_attr_defs_for_instance
MustafaJafar 979d328
Make ruff happy
MustafaJafar 81953e5
CollectVersionTags: refactor `tags` key -> `versionTags`
MustafaJafar 7a8c2bc
CollectVersionTags: optimize items in get_attr_defs_for_instance
MustafaJafar 6012cc3
Merge branch 'develop' into enhancement/1673-yn-0458-set-version-tags…
MustafaJafar f114911
IntegrateAsset: fix typo in variable name
MustafaJafar 26bbd1d
Merge branch 'enhancement/1673-yn-0458-set-version-tags-on-publish' o…
MustafaJafar e6a343c
Merge branch 'develop' into enhancement/1673-yn-0458-set-version-tags…
MustafaJafar a6f13fc
Optimizations from code review
MustafaJafar 115cf21
Merge branch 'develop' into enhancement/1673-yn-0458-set-version-tags…
moonyuet 63a1342
IntegrateAsset: better log message
MustafaJafar 1002db7
Use `KnownPublishError` instead of `PublishError`
MustafaJafar 7f68230
Remove the type hint
MustafaJafar d0dad9e
get the right instance data item `versionTags`
MustafaJafar cd38c86
Update client/ayon_core/plugins/publish/integrate.py
BigRoy 2b75ed1
Fix a typo
MustafaJafar a57741c
Revert 1002db7baf22076a5927926a2a92329bc8c9ade9: use `Publish Error`
MustafaJafar 3871191
Merge branch 'develop' into enhancement/1673-yn-0458-set-version-tags…
MustafaJafar 0a56346
Apply suggestion from @BigRoy
BigRoy dd0cf2e
remove the fallback when getting the `versionTags`
MustafaJafar 59cf2bf
Merge branch 'develop' into enhancement/1673-yn-0458-set-version-tags…
MustafaJafar 3fdda57
Merge branch 'develop' into enhancement/1673-yn-0458-set-version-tags…
MustafaJafar f328751
Merge branch 'develop' into enhancement/1673-yn-0458-set-version-tags…
iLLiCiTiT File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| import pyblish.api | ||
|
|
||
| from ayon_core.lib import EnumDef | ||
| from ayon_core.pipeline.publish import AYONPyblishPluginMixin | ||
|
|
||
|
|
||
| class CollectVersionTags( | ||
| pyblish.api.InstancePlugin, | ||
| AYONPyblishPluginMixin | ||
| ): | ||
| """Collect Version Tags | ||
|
|
||
| Provides a selectable list of tags for the user. Selected tags are stored | ||
| in the instance metadata and applied to the Version Entity during | ||
| integration. | ||
| """ | ||
|
|
||
| order = pyblish.api.CollectorOrder + 0.499 | ||
| label = "Collect Version Tags" | ||
| settings_category = "core" | ||
|
|
||
| enabled = False | ||
|
|
||
| def process(self, instance): | ||
|
|
||
| attr_values = self.get_attr_values_from_data(instance.data) | ||
| version_tags = attr_values.get("version_tags", []) | ||
|
|
||
| if not version_tags: | ||
| return | ||
|
|
||
| self.log.debug(f"Adding tags: {version_tags}") | ||
| tags = instance.data.get("versionTags") | ||
| if tags is None: | ||
| tags = set() | ||
| elif not isinstance(tags, set): | ||
| tags = set(tags) | ||
|
|
||
| tags.update(version_tags) | ||
| instance.data["versionTags"] = tags | ||
| self.log.debug(f"Collected version tags: {tags}") | ||
|
|
||
| @classmethod | ||
| def get_attr_defs_for_instance(cls, create_context, instance): | ||
|
BigRoy marked this conversation as resolved.
|
||
| project_entity = create_context.get_current_project_entity() | ||
| items = [tag["name"] for tag in project_entity["tags"]] | ||
| if not items: | ||
| plugin_attributes = instance.publish_attributes.get(cls.__name__) | ||
| if plugin_attributes is not None: | ||
| plugin_attributes.pop("version_tags", None) | ||
| return [] | ||
|
MustafaJafar marked this conversation as resolved.
|
||
|
|
||
| return [ | ||
| EnumDef( | ||
| "version_tags", | ||
| label="Version Tags", | ||
| multiselection=True, | ||
| items=items, | ||
| tooltip="Set these tags to versions", | ||
| ) | ||
| ] | ||
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.