Skip to content

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.

Fix issues with label automations, update issue templates (#2085)

Madison Swain-Bowden8410251625df
diff --git a/.github/ISSUE_TEMPLATE/airflow_alert.md b/.github/ISSUE_TEMPLATE/airflow_alert.md
index a91e1fd6e..800934e3c 100644
--- a/.github/ISSUE_TEMPLATE/airflow_alert.md
+++ b/.github/ISSUE_TEMPLATE/airflow_alert.md
@@ -1,7 +1,7 @@
---
name: Airflow Alert
about: Report an alert raised by Airflow
-labels: "πŸ›  goal: fix, 🚦 status: awaiting triage, 🌬️ tooling: airflow"
+labels: "πŸ›  goal: fix, 🚦 status: awaiting triage, 🌬️ tooling: airflow, 🧱 stack: catalog"
title: "<Replace this with actual title>"
---
diff --git a/.github/ISSUE_TEMPLATE/image_provider_api_integration_request.yml b/.github/ISSUE_TEMPLATE/image_provider_api_integration_request.yml
index 7fb77f904..145cc67e0 100644
--- a/.github/ISSUE_TEMPLATE/image_provider_api_integration_request.yml
+++ b/.github/ISSUE_TEMPLATE/image_provider_api_integration_request.yml
@@ -3,9 +3,12 @@ description: Tell us about an API providing CC-licensed images
title: "<Provider name here>"
labels:
- "🚦 status: awaiting triage"
- - "✨ goal: improvement"
- "🧹 status: ticket work required"
- "☁️ provider: images"
+ - "πŸ’» aspect: code"
+ - "🌟 goal: addition"
+ - "🧱 stack: catalog"
+ - "🟩 priority: low"
body:
- type: input
id: provider
diff --git a/.github/ISSUE_TEMPLATE/new_source_suggestion.yml b/.github/ISSUE_TEMPLATE/new_source_suggestion.yml
index 9800fc3a5..568ff5a27 100644
--- a/.github/ISSUE_TEMPLATE/new_source_suggestion.yml
+++ b/.github/ISSUE_TEMPLATE/new_source_suggestion.yml
@@ -5,6 +5,10 @@ labels:
- "🚦 status: awaiting triage"
- "🧹 status: ticket work required"
- "☁️ provider: any"
+ - "πŸ’» aspect: code"
+ - "🌟 goal: addition"
+ - "🧱 stack: catalog"
+ - "🟩 priority: low"
body:
- type: input
id: source
diff --git a/.github/ISSUE_TEMPLATE/project_thread.md b/.github/ISSUE_TEMPLATE/project_thread.md
index da602224a..7e38f583c 100644
--- a/.github/ISSUE_TEMPLATE/project_thread.md
+++ b/.github/ISSUE_TEMPLATE/project_thread.md
@@ -1,7 +1,7 @@
---
name: Project Thread
about: An issue to track and outline a new project
-labels: "project"
+labels: "🧭 project: thread"
title: "<Replace this with actual title>"
---
diff --git a/automations/python/print_labels.py b/automations/python/print_labels.py
new file mode 100644
index 000000000..2f77b2a0b
--- /dev/null
+++ b/automations/python/print_labels.py
@@ -0,0 +1,8 @@
+"""Simple utility for printing all the labels from labels.yml."""
+from shared.labels import get_labels
+
+
+if __name__ == "__main__":
+ labels = get_labels()
+ for label in labels:
+ print(label)
diff --git a/automations/python/shared/labels.py b/automations/python/shared/labels.py
index 3f89b94a4..07dd41236 100644
--- a/automations/python/shared/labels.py
+++ b/automations/python/shared/labels.py
@@ -1,5 +1,4 @@
from copy import deepcopy
-from itertools import chain
from models.label import Label
from models.label_group import LabelGroup
@@ -29,7 +28,9 @@ def get_labels() -> list[Label]:
"""
labels_file = deepcopy(get_data("labels.yml"))
grouped_labels = get_labels_by_group(labels_file)
- standard_labels = list(chain(group.labels for group in grouped_labels.values()))
+ standard_labels = [
+ label for group in grouped_labels.values() for label in group.labels
+ ]
# Also grab standard labels
for label_info in labels_file["standalone"]:
label = Label(**label_info)
diff --git a/automations/python/sync_labels.py b/automations/python/sync_labels.py
index 93c20ef30..395a47fc6 100644
--- a/automations/python/sync_labels.py
+++ b/automations/python/sync_labels.py
@@ -23,7 +23,7 @@ def set_labels(repo: Repository, labels: list[Label]):
"""
log.info(f"Fetching existing labels from {repo.full_name}")
- existing_labels = {label.name.casefold(): label for label in get_labels()}
+ existing_labels = {label.name.casefold(): label for label in repo.get_labels()}
log.info(f"Found {len(existing_labels)} existing labels")
for label in labels:
@@ -58,7 +58,7 @@ def main():
log.info(f"β€’ {label.qualified_name}")
repos = [org.get_repo(repo_name) for repo_name in repo_names]
for repo in repos:
- set_labels(repo, get_labels())
+ set_labels(repo, labels)
if __name__ == "__main__":