From 48d43f7fea8817af9bfbf906be451cff2d562b5a Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Tue, 10 Jan 2023 18:16:31 +0100 Subject: [PATCH 1/4] OP-4679 - check comment on context Check for context must be preserved until old Pyblish is completely eradicated as comment could be filled after collection phase, therefore not caught by collector. --- .../modules/ftrack/plugins/publish/integrate_ftrack_note.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openpype/modules/ftrack/plugins/publish/integrate_ftrack_note.py b/openpype/modules/ftrack/plugins/publish/integrate_ftrack_note.py index 6776509dda..2aecd97591 100644 --- a/openpype/modules/ftrack/plugins/publish/integrate_ftrack_note.py +++ b/openpype/modules/ftrack/plugins/publish/integrate_ftrack_note.py @@ -45,7 +45,8 @@ class IntegrateFtrackNote(pyblish.api.InstancePlugin): host_name = context.data["hostName"] app_name = context.data["appName"] app_label = context.data["appLabel"] - comment = instance.data["comment"] + # context comment is fallback until old Pyblish is removed + comment = instance.data["comment"] or context.data.get("comment") if not comment: self.log.info("Comment is not set.") else: From 59e2bd2bdf0c738aca7fcfdd76473753c16c97b0 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Tue, 10 Jan 2023 18:17:15 +0100 Subject: [PATCH 2/4] OP-4679 - updated logging Printing what is actually missing is more helpful than only full data. --- .../modules/ftrack/plugins/publish/integrate_ftrack_note.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/modules/ftrack/plugins/publish/integrate_ftrack_note.py b/openpype/modules/ftrack/plugins/publish/integrate_ftrack_note.py index 2aecd97591..994df304ad 100644 --- a/openpype/modules/ftrack/plugins/publish/integrate_ftrack_note.py +++ b/openpype/modules/ftrack/plugins/publish/integrate_ftrack_note.py @@ -130,8 +130,8 @@ class IntegrateFtrackNote(pyblish.api.InstancePlugin): if not note_text.solved: self.log.warning(( "Note template require more keys then can be provided." - "\nTemplate: {}\nData: {}" - ).format(template, format_data)) + "\nTemplate: {}\nMissing values for keys:{}\nData: {}" + ).format(template, note_text.missing_keys, format_data)) continue if not note_text: From 12e29805249bdb31a77c8c9249e2f96c0df56080 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Wed, 11 Jan 2023 15:03:55 +0100 Subject: [PATCH 3/4] OP-4679 - push adding comment to instance to Extractor phase Pyblish allows modifying comment after collect phase, eg. collector wouldn't collect it. Should be pushed back to Collect phase after Pyblish is eradicated. --- openpype/plugins/publish/collect_comment.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openpype/plugins/publish/collect_comment.py b/openpype/plugins/publish/collect_comment.py index 12579cd957..5be04731ac 100644 --- a/openpype/plugins/publish/collect_comment.py +++ b/openpype/plugins/publish/collect_comment.py @@ -73,7 +73,9 @@ class CollectComment( """ label = "Collect Instance Comment" - order = pyblish.api.CollectorOrder + 0.49 + # TODO change to CollectorOrder after Pyblish is purged + # Pyblish allows modifying comment after collect phase + order = pyblish.api.ExtractorOrder - 0.49 def process(self, context): context_comment = self.cleanup_comment(context.data.get("comment")) From f854de46295da4d96c007335421647f78b2e6b36 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Wed, 11 Jan 2023 15:06:03 +0100 Subject: [PATCH 4/4] OP-4679 - revert back fallback Availability of comment on instance has been resolved by bumping up order of CollectComment. --- .../modules/ftrack/plugins/publish/integrate_ftrack_note.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openpype/modules/ftrack/plugins/publish/integrate_ftrack_note.py b/openpype/modules/ftrack/plugins/publish/integrate_ftrack_note.py index 994df304ad..6e82897d89 100644 --- a/openpype/modules/ftrack/plugins/publish/integrate_ftrack_note.py +++ b/openpype/modules/ftrack/plugins/publish/integrate_ftrack_note.py @@ -45,8 +45,7 @@ class IntegrateFtrackNote(pyblish.api.InstancePlugin): host_name = context.data["hostName"] app_name = context.data["appName"] app_label = context.data["appLabel"] - # context comment is fallback until old Pyblish is removed - comment = instance.data["comment"] or context.data.get("comment") + comment = instance.data["comment"] if not comment: self.log.info("Comment is not set.") else: