Skip to content

Commit

Permalink
Ensure that products have a slug before publishing (#3483)
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Prescod committed Jan 10, 2023
1 parent 5b07db3 commit a45df7e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cumulusci/tasks/metadeploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ def _run_task(self):
raise CumulusCIException(
f"No product found in MetaDeploy with repo URL {repo_url}"
)
elif not product.get("slug"): # pragma: no cover
raise CumulusCIException(
f"No slug found in MetaDeploy for product {product} from {repo_url}"
)

if not self.dry_run:
version = self._find_or_create_version(product)
if self.labels_path and "slug" in product:
Expand Down Expand Up @@ -363,8 +368,9 @@ def _save_labels(self):
self.logger.info(f"Updating labels in {labels_path}")
labels_path.write_text(json.dumps(self.labels, indent=4))

def _publish_labels(self, slug):
def _publish_labels(self, slug: str):
"""Publish labels in all languages to MetaDeploy."""
assert isinstance(slug, str), f"Slug should be a string, not {slug}"
for path in Path(self.labels_path).glob("*.json"):
lang = path.stem.split("_")[-1].lower()
if lang in ("en", "en-us"):
Expand Down

0 comments on commit a45df7e

Please sign in to comment.