Openverse is a search engine for openly-licensed media. This monorepo includes all application code.
Add stack to label sync, allow emoji to be defined for whole group (#885)
Madison Swain-Bowdened4471fcb8af
diff --git a/automations/data/labels.yml b/automations/data/labels.ymlindex 6fdc69ab8..b0a3b9ba6 100644--- a/automations/data/labels.yml+++ b/automations/data/labels.yml@@ -82,6 +82,24 @@ groups:description: Bug fixemoji: "🛠"+ - name: stack+ color: "006b75"+ emoji: "🧱"+ is_required: true+ labels:+ - name: frontend+ description: Related to the Nuxt frontend+ - name: mgmt+ description: Related to repo management and automations+ - name: api+ description: Related to the Django API+ - name: catalog+ description: Related to the catalog and Airflow DAGs+ - name: analytics+ description: Related to the analytics setup+ - name: ingestion server+ description: Related to the ingestion/data refresh server+- name: toolinglabels:- name: sentrydiff --git a/automations/python/models/label.py b/automations/python/models/label.pyindex a973d4daa..0340cd97e 100644--- a/automations/python/models/label.py+++ b/automations/python/models/label.py@@ -23,15 +23,18 @@ class Label:has_emoji_name: bool = True,**kwargs,):+ self.group = groupself.name = kwargs["name"]self.description = kwargs["description"]- self.emoji = kwargs["emoji"]+ self.emoji = kwargs.get("emoji")self.own_color = colorself.has_emoji_name = has_emoji_name- self.group = group- if group and self not in group.labels:- group.labels.append(self)+ if group:+ if self not in group.labels:+ group.labels.append(self)+ if self.emoji is None:+ self.emoji = group.emoji@propertydef color(self) -> str:diff --git a/automations/python/models/label_group.py b/automations/python/models/label_group.pyindex b59796383..fb0f94a87 100644--- a/automations/python/models/label_group.py+++ b/automations/python/models/label_group.py@@ -5,6 +5,7 @@ class LabelGroup:A group has some fixed parameters:- name, which may be prefixed to all child label names- color, which acts as a fallback for child labels that do not specify one+ - emoji, which acts as a fallback for child labels that do not specify one- is_prefixed, which determines if group name is prefixed on child labels- is_required, which determines if >=1 sub-label must be applied on issues"""@@ -12,12 +13,14 @@ class LabelGroup:def __init__(self,color=None,+ emoji=None,is_prefixed=True,is_required=False,**kwargs,):self.name = kwargs["name"]self.color = color+ self.emoji = emojiself.is_prefixed = is_prefixedself.is_required = is_required