From fd588330e5b536f6c3c6ad3231ccc88dbe2ef6ed Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Tue, 10 Sep 2024 23:31:17 +0200 Subject: [PATCH 01/20] Use task entity attributes instead of folder entity attributes --- .../collect_frame_data_from_folder_entity.py | 22 ++++++++++++------- .../plugins/publish/collect_review_frames.py | 14 +++++++----- .../publish/collect_sequence_frame_data.py | 8 +++++-- .../plugins/publish/validate_frame_ranges.py | 16 +++++++++----- 4 files changed, 39 insertions(+), 21 deletions(-) diff --git a/client/ayon_traypublisher/plugins/publish/collect_frame_data_from_folder_entity.py b/client/ayon_traypublisher/plugins/publish/collect_frame_data_from_folder_entity.py index 2e564a2..5c9f910 100644 --- a/client/ayon_traypublisher/plugins/publish/collect_frame_data_from_folder_entity.py +++ b/client/ayon_traypublisher/plugins/publish/collect_frame_data_from_folder_entity.py @@ -2,14 +2,14 @@ class CollectFrameDataFromAssetEntity(pyblish.api.InstancePlugin): - """Collect Frame Data From 'folderEntity' found in context. + """Collect Frame Data From `taskEntity` or `folderEntity` of instance. - Frame range data will only be collected if the keys - are not yet collected for the instance. + Frame range data will only be collected if the keys are not yet + collected for the instance. """ order = pyblish.api.CollectorOrder + 0.491 - label = "Collect Missing Frame Data From Folder" + label = "Collect Missing Frame Data From Folder/Task" families = [ "plate", "pointcache", @@ -38,14 +38,20 @@ def process(self, instance): return keys_set = [] - folder_attributes = instance.data["folderEntity"]["attrib"] + + folder_entity = instance.data["folderEntity"] + task_entity = instance.data.get("taskEntity") + context_attributes = ( + task_entity["attrib"] if task_entity else folder_entity["attrib"] + ) + for key in missing_keys: - if key in folder_attributes: - instance.data[key] = folder_attributes[key] + if key in context_attributes: + instance.data[key] = context_attributes[key] keys_set.append(key) if keys_set: self.log.debug( f"Frame range data {keys_set} " - "has been collected from folder entity." + "has been collected from folder (or task) entity." ) diff --git a/client/ayon_traypublisher/plugins/publish/collect_review_frames.py b/client/ayon_traypublisher/plugins/publish/collect_review_frames.py index 7eceda9..5755b7a 100644 --- a/client/ayon_traypublisher/plugins/publish/collect_review_frames.py +++ b/client/ayon_traypublisher/plugins/publish/collect_review_frames.py @@ -20,12 +20,16 @@ class CollectReviewInfo(pyblish.api.InstancePlugin): hosts = ["traypublisher"] def process(self, instance): - folder_entity = instance.data.get("folderEntity") - if instance.data.get("frameStart") is not None or not folder_entity: + + entity = ( + instance.data.get("taskEntity") + or instance.data.get("folderEntity") + ) + if instance.data.get("frameStart") is not None or not entity: self.log.debug("Missing required data on instance") return - folder_attributes = folder_entity["attrib"] + context_attributes = entity["attrib"] # Store collected data for logging collected_data = {} for key in ( @@ -35,9 +39,9 @@ def process(self, instance): "handleStart", "handleEnd", ): - if key in instance.data or key not in folder_attributes: + if key in instance.data or key not in context_attributes: continue - value = folder_attributes[key] + value = context_attributes[key] collected_data[key] = value instance.data[key] = value self.log.debug("Collected data: {}".format(str(collected_data))) diff --git a/client/ayon_traypublisher/plugins/publish/collect_sequence_frame_data.py b/client/ayon_traypublisher/plugins/publish/collect_sequence_frame_data.py index c2894e1..39a05b9 100644 --- a/client/ayon_traypublisher/plugins/publish/collect_sequence_frame_data.py +++ b/client/ayon_traypublisher/plugins/publish/collect_sequence_frame_data.py @@ -49,7 +49,11 @@ def process(self, instance): def get_frame_data_from_repre_sequence(self, instance): repres = instance.data.get("representations") - folder_attributes = instance.data["folderEntity"]["attrib"] + + entity: dict = ( + instance.data.get("taskEntity") or instance.data["folderEntity"] + ) + entity_attributes: dict = entity["attrib"] if repres: first_repre = repres[0] @@ -78,5 +82,5 @@ def get_frame_data_from_repre_sequence(self, instance): "frameEnd": repres_frames[-1], "handleStart": 0, "handleEnd": 0, - "fps": folder_attributes["fps"] + "fps": entity_attributes["fps"] } diff --git a/client/ayon_traypublisher/plugins/publish/validate_frame_ranges.py b/client/ayon_traypublisher/plugins/publish/validate_frame_ranges.py index 42127f4..a6e0c78 100644 --- a/client/ayon_traypublisher/plugins/publish/validate_frame_ranges.py +++ b/client/ayon_traypublisher/plugins/publish/validate_frame_ranges.py @@ -47,11 +47,15 @@ def process(self, instance): for pattern in self.skip_timelines_check)): self.log.info("Skipping for {} task".format(instance.data["task"])) - folder_attributes = instance.data["folderEntity"]["attrib"] - frame_start = folder_attributes["frameStart"] - frame_end = folder_attributes["frameEnd"] - handle_start = folder_attributes["handleStart"] - handle_end = folder_attributes["handleEnd"] + # Use attributes from task entity if set, otherwise from folder entity + entity = ( + instance.data.get("taskEntity") or instance.data["folderEntity"] + ) + attributes = entity["attrib"] + frame_start = attributes["frameStart"] + frame_end = attributes["frameEnd"] + handle_start = attributes["handleStart"] + handle_end = attributes["handleEnd"] duration = (frame_end - frame_start + 1) + handle_start + handle_end repres = instance.data.get("representations") @@ -73,7 +77,7 @@ def process(self, instance): msg = ( "Frame duration from DB:'{}' doesn't match number of files:'{}'" - " Please change frame range for Folder or limit no. of files" + " Please change frame range for folder/task or limit no. of files" ). format(int(duration), frames) formatting_data = {"duration": duration, From 651d54b3ebf8b75eaba35bb1902c9042d1185a93 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Thu, 26 Sep 2024 14:11:46 +0200 Subject: [PATCH 02/20] Refactor file name handling and sequence padding logic. - Extracted file name from basename for processing. - Improved handling of sequence padding using regex pattern matching. - Enhanced file filtering based on the extracted file name. --- .../plugins/create/create_csv_ingest.py | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/client/ayon_traypublisher/plugins/create/create_csv_ingest.py b/client/ayon_traypublisher/plugins/create/create_csv_ingest.py index fd4dedd..494ce95 100644 --- a/client/ayon_traypublisher/plugins/create/create_csv_ingest.py +++ b/client/ayon_traypublisher/plugins/create/create_csv_ingest.py @@ -644,9 +644,21 @@ def _add_representation( # convert ### string in file name to %03d # this is for correct frame range validation # example: file.###.exr -> file.%03d.exr + file_name = basename.split(".")[0] if "#" in basename: padding = len(basename.split("#")) - 1 - basename = basename.replace("#" * padding, f"%0{padding}d") + seq_padding = f"%0{padding}d" + basename = basename.replace("#" * padding, seq_padding) + file_name = basename.split(seq_padding)[0] + is_sequence = True + if "%" in basename: + pattern = re.compile(r"%\d+d|%d") + padding = pattern.findall(basename) + if not padding: + raise CreatorError( + f"File sequence padding not found in '{basename}'." + ) + file_name = basename.split("%")[0] is_sequence = True # make absolute path to file @@ -662,8 +674,13 @@ def _add_representation( frame_end: Union[int, None] = None files: Union[str, List[str]] = basename if is_sequence: + # get only filtered files form dirname + files_from_dir = [ + file for file in os.listdir(dirname) + if file_name in file + ] # collect all data from dirname - cols, _ = clique.assemble(list(os.listdir(dirname))) + cols, _ = clique.assemble(files_from_dir) if not cols: raise CreatorError( f"No collections found in directory '{dirname}'." From 52d59ed59297149cd9edfaffc12e20bffae37f3b Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Thu, 26 Sep 2024 14:26:16 +0200 Subject: [PATCH 03/20] Refactor file name handling for better clarity and consistency. - Refactored variable names for improved readability - Updated logic to handle file name patterns consistently --- .../plugins/create/create_csv_ingest.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/ayon_traypublisher/plugins/create/create_csv_ingest.py b/client/ayon_traypublisher/plugins/create/create_csv_ingest.py index 494ce95..0432b53 100644 --- a/client/ayon_traypublisher/plugins/create/create_csv_ingest.py +++ b/client/ayon_traypublisher/plugins/create/create_csv_ingest.py @@ -644,12 +644,12 @@ def _add_representation( # convert ### string in file name to %03d # this is for correct frame range validation # example: file.###.exr -> file.%03d.exr - file_name = basename.split(".")[0] + file_head = basename.split(".")[0] if "#" in basename: padding = len(basename.split("#")) - 1 seq_padding = f"%0{padding}d" basename = basename.replace("#" * padding, seq_padding) - file_name = basename.split(seq_padding)[0] + file_head = basename.split(seq_padding)[0] is_sequence = True if "%" in basename: pattern = re.compile(r"%\d+d|%d") @@ -658,7 +658,7 @@ def _add_representation( raise CreatorError( f"File sequence padding not found in '{basename}'." ) - file_name = basename.split("%")[0] + file_head = basename.split("%")[0] is_sequence = True # make absolute path to file @@ -677,7 +677,7 @@ def _add_representation( # get only filtered files form dirname files_from_dir = [ file for file in os.listdir(dirname) - if file_name in file + if file_head in file ] # collect all data from dirname cols, _ = clique.assemble(files_from_dir) From 8380ad0fd5ff5ca80ced4804e9552545a7e9e272 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 30 Sep 2024 13:36:35 +0200 Subject: [PATCH 04/20] added release trigger action --- .github/workflows/release_trigger.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/workflows/release_trigger.yml diff --git a/.github/workflows/release_trigger.yml b/.github/workflows/release_trigger.yml new file mode 100644 index 0000000..01a3b3a --- /dev/null +++ b/.github/workflows/release_trigger.yml @@ -0,0 +1,12 @@ +name: 🚀 Release Trigger + +on: + workflow_dispatch: + +jobs: + call-release-trigger: + uses: ynput/ops-repo-automation/.github/workflows/release_trigger.yml@main + secrets: + token: ${{ secrets.YNPUT_BOT_TOKEN }} + email: ${{ secrets.CI_EMAIL }} + user: ${{ secrets.CI_USER }} From 095945ba8cde27f3c61240c503643fb7bca14b11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Je=C5=BEek?= Date: Mon, 30 Sep 2024 15:54:45 +0200 Subject: [PATCH 05/20] Update client/ayon_traypublisher/plugins/create/create_csv_ingest.py Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- .../ayon_traypublisher/plugins/create/create_csv_ingest.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/ayon_traypublisher/plugins/create/create_csv_ingest.py b/client/ayon_traypublisher/plugins/create/create_csv_ingest.py index 0432b53..05ce0f8 100644 --- a/client/ayon_traypublisher/plugins/create/create_csv_ingest.py +++ b/client/ayon_traypublisher/plugins/create/create_csv_ingest.py @@ -676,8 +676,9 @@ def _add_representation( if is_sequence: # get only filtered files form dirname files_from_dir = [ - file for file in os.listdir(dirname) - if file_head in file + filename + for filename in os.listdir(dirname) + if filename.startswith(file_head) ] # collect all data from dirname cols, _ = clique.assemble(files_from_dir) From a79693601928390651cfb9cecb60b0e7f3ba638a Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Mon, 30 Sep 2024 15:58:21 +0200 Subject: [PATCH 06/20] The code now correctly uses 'elif' instead of 'if' to handle '%' in basenames. --- client/ayon_traypublisher/plugins/create/create_csv_ingest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_traypublisher/plugins/create/create_csv_ingest.py b/client/ayon_traypublisher/plugins/create/create_csv_ingest.py index 05ce0f8..d1685a4 100644 --- a/client/ayon_traypublisher/plugins/create/create_csv_ingest.py +++ b/client/ayon_traypublisher/plugins/create/create_csv_ingest.py @@ -651,7 +651,7 @@ def _add_representation( basename = basename.replace("#" * padding, seq_padding) file_head = basename.split(seq_padding)[0] is_sequence = True - if "%" in basename: + elif "%" in basename: pattern = re.compile(r"%\d+d|%d") padding = pattern.findall(basename) if not padding: From 51fdc7f9b137fd7cf82b3ff853b75883a07f149b Mon Sep 17 00:00:00 2001 From: jrsndlr Date: Tue, 1 Oct 2024 17:39:21 +0200 Subject: [PATCH 07/20] CSV ingest fix stills --- client/ayon_traypublisher/plugins/create/create_csv_ingest.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/ayon_traypublisher/plugins/create/create_csv_ingest.py b/client/ayon_traypublisher/plugins/create/create_csv_ingest.py index 82dadf6..2686df7 100644 --- a/client/ayon_traypublisher/plugins/create/create_csv_ingest.py +++ b/client/ayon_traypublisher/plugins/create/create_csv_ingest.py @@ -660,6 +660,8 @@ def _add_representation( ) file_head = basename.split("%")[0] is_sequence = True + else: + is_sequence = False # make absolute path to file dirname: str = os.path.dirname(repre_item.filepath) From 1bd5dd970ae9793536e7386e84f026927db4bb41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Je=C5=BEek?= Date: Wed, 2 Oct 2024 09:54:51 +0200 Subject: [PATCH 08/20] Update client/ayon_traypublisher/plugins/create/create_csv_ingest.py --- client/ayon_traypublisher/plugins/create/create_csv_ingest.py | 1 + 1 file changed, 1 insertion(+) diff --git a/client/ayon_traypublisher/plugins/create/create_csv_ingest.py b/client/ayon_traypublisher/plugins/create/create_csv_ingest.py index 2686df7..9f566dd 100644 --- a/client/ayon_traypublisher/plugins/create/create_csv_ingest.py +++ b/client/ayon_traypublisher/plugins/create/create_csv_ingest.py @@ -661,6 +661,7 @@ def _add_representation( file_head = basename.split("%")[0] is_sequence = True else: + # in case it is still image is_sequence = False # make absolute path to file From d208bcb6114b06b2c5aa29e7b62bf9418976a7eb Mon Sep 17 00:00:00 2001 From: Ynbot Date: Wed, 2 Oct 2024 08:40:25 +0000 Subject: [PATCH 09/20] [Automated] Add generated package files from main --- client/ayon_traypublisher/version.py | 2 +- package.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/ayon_traypublisher/version.py b/client/ayon_traypublisher/version.py index 405e47d..d77051d 100644 --- a/client/ayon_traypublisher/version.py +++ b/client/ayon_traypublisher/version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- """Package declaring AYON addon 'traypublisher' version.""" -__version__ = "0.2.6-dev.1" +__version__ = "0.2.6" diff --git a/package.py b/package.py index 4c64b7c..d005c93 100644 --- a/package.py +++ b/package.py @@ -1,6 +1,6 @@ name = "traypublisher" title = "TrayPublisher" -version = "0.2.6-dev.1" +version = "0.2.6" client_dir = "ayon_traypublisher" From c866b05600337e9b11cf889d75c57f611495fee7 Mon Sep 17 00:00:00 2001 From: Ynbot Date: Wed, 2 Oct 2024 08:41:04 +0000 Subject: [PATCH 10/20] [Automated] Update version in package.py for develop --- client/ayon_traypublisher/version.py | 2 +- package.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/ayon_traypublisher/version.py b/client/ayon_traypublisher/version.py index d77051d..5addfbb 100644 --- a/client/ayon_traypublisher/version.py +++ b/client/ayon_traypublisher/version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- """Package declaring AYON addon 'traypublisher' version.""" -__version__ = "0.2.6" +__version__ = "0.2.6+dev" diff --git a/package.py b/package.py index d005c93..0b6c931 100644 --- a/package.py +++ b/package.py @@ -1,6 +1,6 @@ name = "traypublisher" title = "TrayPublisher" -version = "0.2.6" +version = "0.2.6+dev" client_dir = "ayon_traypublisher" From c1b34b1aedce8b270253489370108a585e77992a Mon Sep 17 00:00:00 2001 From: "robin@ynput.io" Date: Tue, 8 Oct 2024 15:05:51 -0400 Subject: [PATCH 11/20] CSV ingest: make Version column optional. --- .../plugins/create/create_csv_ingest.py | 8 ++++++-- server/settings/creator_plugins.py | 8 ++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/client/ayon_traypublisher/plugins/create/create_csv_ingest.py b/client/ayon_traypublisher/plugins/create/create_csv_ingest.py index 9f566dd..55e77ca 100644 --- a/client/ayon_traypublisher/plugins/create/create_csv_ingest.py +++ b/client/ayon_traypublisher/plugins/create/create_csv_ingest.py @@ -55,7 +55,7 @@ def _get_row_value_with_validation( # get column default value column_default = column_data["default"] - if column_type in ["number", "decimal"] and column_default == 0: + if column_type in ["number", "decimal"] and column_default in (0, '0'): column_default = None # check if column value is not empty string @@ -779,7 +779,11 @@ def _create_instances_from_csv_data(self, csv_dir: str, filename: str): product_item.product_type, product_item.variant ) - label: str = f"{folder_path}_{product_name}_v{version:>03}" + + if version is not None: + label: str = f"{folder_path}_{product_name}_v{version:>03}" + else: + label: str = f"{folder_path}_{product_name}_v[next]" repre_items: List[RepreItem] = product_item.repre_items first_repre_item: RepreItem = repre_items[0] diff --git a/server/settings/creator_plugins.py b/server/settings/creator_plugins.py index 0e7963a..2dc7815 100644 --- a/server/settings/creator_plugins.py +++ b/server/settings/creator_plugins.py @@ -182,7 +182,7 @@ class TrayPublisherCreatePluginsModel(BaseSettingsModel): "type": "text", "default": "", "required_column": True, - "validation_pattern": "^([a-zA-Z\\:\\ 0-9#._\\\\/]*)$" + "validation_pattern": "^([a-zA-Z\\:\\ 0-9#-._\\\\/]*)$" }, { "name": "Folder Path", @@ -215,8 +215,8 @@ class TrayPublisherCreatePluginsModel(BaseSettingsModel): { "name": "Version", "type": "number", - "default": "1", - "required_column": True, + "default": "0", + "required_column": False, "validation_pattern": "^(\\d{1,3})$" }, { @@ -231,7 +231,7 @@ class TrayPublisherCreatePluginsModel(BaseSettingsModel): "type": "text", "default": "", "required_column": False, - "validation_pattern": "^([a-zA-Z\\:\\ 0-9#._\\\\/]*)$" + "validation_pattern": "^([a-zA-Z\\:\\ 0-9#-._\\\\/]*)$" }, { "name": "Frame Start", From ff5601b3b99c30e90eafc29b2cb0d717377e7af5 Mon Sep 17 00:00:00 2001 From: "robin@ynput.io" Date: Tue, 8 Oct 2024 15:58:38 -0400 Subject: [PATCH 12/20] Adjust regex from PR feedback. --- server/settings/creator_plugins.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/settings/creator_plugins.py b/server/settings/creator_plugins.py index 2dc7815..9fca980 100644 --- a/server/settings/creator_plugins.py +++ b/server/settings/creator_plugins.py @@ -182,7 +182,7 @@ class TrayPublisherCreatePluginsModel(BaseSettingsModel): "type": "text", "default": "", "required_column": True, - "validation_pattern": "^([a-zA-Z\\:\\ 0-9#-._\\\\/]*)$" + "validation_pattern": "^([a-zA-Z\\:\\ 0-9#\\-\\._\\\\/]*)$" }, { "name": "Folder Path", @@ -231,7 +231,7 @@ class TrayPublisherCreatePluginsModel(BaseSettingsModel): "type": "text", "default": "", "required_column": False, - "validation_pattern": "^([a-zA-Z\\:\\ 0-9#-._\\\\/]*)$" + "validation_pattern": "^([a-zA-Z\\:\\ 0-9#\\-\\._\\\\/]*)$" }, { "name": "Frame Start", From e479587da40bf88426306e22a03b4587c5b35990 Mon Sep 17 00:00:00 2001 From: Ynbot Date: Tue, 15 Oct 2024 14:10:01 +0000 Subject: [PATCH 13/20] [Automated] Add generated package files to main --- client/ayon_traypublisher/version.py | 2 +- package.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/ayon_traypublisher/version.py b/client/ayon_traypublisher/version.py index 5addfbb..a9bf7a1 100644 --- a/client/ayon_traypublisher/version.py +++ b/client/ayon_traypublisher/version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- """Package declaring AYON addon 'traypublisher' version.""" -__version__ = "0.2.6+dev" +__version__ = "0.2.7" diff --git a/package.py b/package.py index 0b6c931..b1dc11e 100644 --- a/package.py +++ b/package.py @@ -1,6 +1,6 @@ name = "traypublisher" title = "TrayPublisher" -version = "0.2.6+dev" +version = "0.2.7" client_dir = "ayon_traypublisher" From 9968cc3e14463604994fa10d9ad351abcab0b891 Mon Sep 17 00:00:00 2001 From: Ynbot Date: Tue, 15 Oct 2024 14:10:33 +0000 Subject: [PATCH 14/20] [Automated] Update version in package.py for develop --- client/ayon_traypublisher/version.py | 2 +- package.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/ayon_traypublisher/version.py b/client/ayon_traypublisher/version.py index a9bf7a1..328e252 100644 --- a/client/ayon_traypublisher/version.py +++ b/client/ayon_traypublisher/version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- """Package declaring AYON addon 'traypublisher' version.""" -__version__ = "0.2.7" +__version__ = "0.2.7+dev" diff --git a/package.py b/package.py index b1dc11e..24f53d6 100644 --- a/package.py +++ b/package.py @@ -1,6 +1,6 @@ name = "traypublisher" title = "TrayPublisher" -version = "0.2.7" +version = "0.2.7+dev" client_dir = "ayon_traypublisher" From 54bec51d8cbe2ac940367e7858d866ba6d4dc918 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Wed, 16 Oct 2024 10:56:29 +0200 Subject: [PATCH 15/20] define host name --- package.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.py b/package.py index 24f53d6..06ceec6 100644 --- a/package.py +++ b/package.py @@ -1,9 +1,10 @@ name = "traypublisher" title = "TrayPublisher" version = "0.2.7+dev" - +app_host_name = "traypublisher" client_dir = "ayon_traypublisher" +ayon_server_version = ">=1.1.2" ayon_required_addons = { "core": ">0.3.2", } From 06f15809ff177cecfea86913c7cf117252fad505 Mon Sep 17 00:00:00 2001 From: "robin@ynput.io" Date: Mon, 28 Oct 2024 14:18:15 -0400 Subject: [PATCH 16/20] Allow user override through AYON_USERNAME. --- client/ayon_traypublisher/addon.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/client/ayon_traypublisher/addon.py b/client/ayon_traypublisher/addon.py index dd78a70..7b8e796 100644 --- a/client/ayon_traypublisher/addon.py +++ b/client/ayon_traypublisher/addon.py @@ -1,6 +1,9 @@ import os from pathlib import Path + +import ayon_api + from ayon_core.lib import get_ayon_launcher_args from ayon_core.lib.execute import run_detached_process from ayon_core.addon import ( @@ -109,6 +112,13 @@ def ingestcsv( """ from .csv_publish import csvpublish + # Allow user override through AYON_USERNAME when + # current connection is made through a service user. + username = os.environ.get("AYON_USERNAME") + con = ayon_api.get_server_api_connection() + if username and con.is_service_user(): + con.set_default_service_username(username) + # use Path to check if csv_filepath exists if not Path(filepath).exists(): raise FileNotFoundError(f"File {filepath} does not exist.") From bd7840a179cfce268d74f5b577d5a729c4c272ef Mon Sep 17 00:00:00 2001 From: Robin De Lillo Date: Mon, 28 Oct 2024 17:49:51 -0400 Subject: [PATCH 17/20] Update client/ayon_traypublisher/addon.py Co-authored-by: Roy Nieterau --- client/ayon_traypublisher/addon.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/ayon_traypublisher/addon.py b/client/ayon_traypublisher/addon.py index 7b8e796..27db382 100644 --- a/client/ayon_traypublisher/addon.py +++ b/client/ayon_traypublisher/addon.py @@ -115,9 +115,10 @@ def ingestcsv( # Allow user override through AYON_USERNAME when # current connection is made through a service user. username = os.environ.get("AYON_USERNAME") - con = ayon_api.get_server_api_connection() - if username and con.is_service_user(): - con.set_default_service_username(username) + if username: + con = ayon_api.get_server_api_connection() + if con.is_service_user(): + con.set_default_service_username(username) # use Path to check if csv_filepath exists if not Path(filepath).exists(): From ac3b4fa82ef0e52d38d54d7ff438a6ec02dc1d3b Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 4 Nov 2024 15:04:43 +0100 Subject: [PATCH 18/20] added upload to ynput cloud action --- .github/workflows/upload_to_ynput_cloud.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/upload_to_ynput_cloud.yml diff --git a/.github/workflows/upload_to_ynput_cloud.yml b/.github/workflows/upload_to_ynput_cloud.yml new file mode 100644 index 0000000..7745a8e --- /dev/null +++ b/.github/workflows/upload_to_ynput_cloud.yml @@ -0,0 +1,16 @@ +name: 📤 Upload to Ynput Cloud + +on: + workflow_dispatch: + release: + types: [published] + +jobs: + call-upload-to-ynput-cloud: + uses: ynput/ops-repo-automation/.github/workflows/upload_to_ynput_cloud.yml@main + secrets: + CI_EMAIL: ${{ secrets.CI_EMAIL }} + CI_USER: ${{ secrets.CI_USER }} + YNPUT_BOT_TOKEN: ${{ secrets.YNPUT_BOT_TOKEN }} + YNPUT_CLOUD_URL: ${{ secrets.YNPUT_CLOUD_URL }} + YNPUT_CLOUD_TOKEN: ${{ secrets.YNPUT_CLOUD_TOKEN }} From c5d4623bcc5dcc4742798a0ff9ee360b65599fe7 Mon Sep 17 00:00:00 2001 From: Ynbot Date: Tue, 5 Nov 2024 15:06:57 +0000 Subject: [PATCH 19/20] [Automated] Add generated package files to main --- client/ayon_traypublisher/version.py | 2 +- package.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/ayon_traypublisher/version.py b/client/ayon_traypublisher/version.py index 328e252..5a2ab5e 100644 --- a/client/ayon_traypublisher/version.py +++ b/client/ayon_traypublisher/version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- """Package declaring AYON addon 'traypublisher' version.""" -__version__ = "0.2.7+dev" +__version__ = "0.2.8" diff --git a/package.py b/package.py index 06ceec6..1e45d77 100644 --- a/package.py +++ b/package.py @@ -1,6 +1,6 @@ name = "traypublisher" title = "TrayPublisher" -version = "0.2.7+dev" +version = "0.2.8" app_host_name = "traypublisher" client_dir = "ayon_traypublisher" From a941fcf03712012dd31b24ed3b86ad56b421cfbb Mon Sep 17 00:00:00 2001 From: Ynbot Date: Tue, 5 Nov 2024 15:07:34 +0000 Subject: [PATCH 20/20] [Automated] Update version in package.py for develop --- client/ayon_traypublisher/version.py | 2 +- package.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/ayon_traypublisher/version.py b/client/ayon_traypublisher/version.py index 5a2ab5e..7ffcf53 100644 --- a/client/ayon_traypublisher/version.py +++ b/client/ayon_traypublisher/version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- """Package declaring AYON addon 'traypublisher' version.""" -__version__ = "0.2.8" +__version__ = "0.2.8+dev" diff --git a/package.py b/package.py index 1e45d77..8fed3a3 100644 --- a/package.py +++ b/package.py @@ -1,6 +1,6 @@ name = "traypublisher" title = "TrayPublisher" -version = "0.2.8" +version = "0.2.8+dev" app_host_name = "traypublisher" client_dir = "ayon_traypublisher"