Skip to content

Commit 92232f0

Browse files
#43276 Upgrades to use tags instead of tag_list (shotgunsoftware#473)
Updates to use tags rather than tag_list when communicating with the app store. This is a preparation for the upcoming deprecation of tag_list.
1 parent 4e69ae8 commit 92232f0

File tree

5 files changed

+795
-472
lines changed

5 files changed

+795
-472
lines changed

python/tank/descriptor/io_descriptor/appstore.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class IODescriptorAppStore(IODescriptorBase):
101101
"code",
102102
"sg_status_list",
103103
"description",
104-
"tag_list",
104+
"tags",
105105
"sg_detailed_release_notes",
106106
"sg_documentation",
107107
constants.TANK_CODE_PAYLOAD_FIELD
@@ -541,10 +541,13 @@ def get_latest_cached_version(self, constraint_pattern=None):
541541
for (version_str, path) in all_versions.iteritems():
542542
metadata = self.__load_cached_app_store_metadata(path)
543543
try:
544-
if self.__match_label(metadata["sg_version_data"]["tag_list"]):
544+
tags = [x["name"] for x in metadata["sg_version_data"]["tags"]]
545+
if self.__match_label(tags):
545546
version_numbers.append(version_str)
546-
except Exception:
547-
log.debug("Could not determine label metadata for %s. Ignoring." % path)
547+
except Exception, e:
548+
log.debug(
549+
"Could not determine label metadata for %s. Ignoring. Details: %s" % (path, e)
550+
)
548551

549552
else:
550553
# no label based filtering. all versions are valid.
@@ -650,7 +653,8 @@ def get_latest_version(self, constraint_pattern=None):
650653
# now filter out all labels that aren't matching
651654
matching_records = []
652655
for sg_version_entry in sg_versions:
653-
if self.__match_label(sg_version_entry["tag_list"]):
656+
tags = [x["name"] for x in sg_version_entry["tags"]]
657+
if self.__match_label(tags):
654658
matching_records.append(sg_version_entry)
655659

656660
log.debug("After applying label filters, %d records remain." % len(matching_records))

0 commit comments

Comments
 (0)