Skip to content
This repository has been archived by the owner on Jun 2, 2023. It is now read-only.

Commit

Permalink
feat: set label descriptions in repo_checks
Browse files Browse the repository at this point in the history
repo_checks currently normalizes label names and colors. With this
commit, it will also normalize the label description.

We add some hopefully-uncontroversial descriptions to the existing list of
labels.

Part of:
https://openedx.atlassian.net/wiki/spaces/COMM/pages/3695214629/openedx+org-wide+labels#2.-Proposal%3A-List-of-starter-labels
  • Loading branch information
kdmccormick committed Apr 27, 2023
1 parent 131f733 commit b51ca13
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
10 changes: 10 additions & 0 deletions migrate/labels.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
# Repository labels to be synced across the entire org.
# For picking hex colors, you can use: https://www.htmlcolor-picker.com/

- name: ":hammer and wrench: maintenance"
color: "169509" # grassy green
description: "Work that must be done for platform health"

- name: "waiting on author"
color: "bfd6f6" # baby blue
description: "PR reviewers are waiting on the author to answer questions, fix tests, etc."

- name: "closed-inactivity"
color: "dbcd00" # gold
description: "PR was closed because the author abandoned it"

- name: "needs test run"
color: "f5424b" # crimson red
description: "Author's first PR to a repository, awaiting test authorization from Axim"

- name: "good first issue :tada:"
color: "42dd35" # lime green
description: "A good task for a newcomer to start with"
12 changes: 10 additions & 2 deletions migrate/repo_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ class EnsureLabels(Check):
# Each item should be a dict with the fields:
# name: str
# color: str (rrggbb hex string)
# description: str
labels: list

with open(LABELS_YAML_PATH) as labels_yaml:
Expand All @@ -420,7 +421,11 @@ def check(self):
)

existing_labels = {
self._simplify_label(label.name): {"color": label.color, "name": label.name}
self._simplify_label(label.name): {
"color": label.color,
"name": label.name,
"description": label.description,
}
for label in labels
}
self.missing_labels = []
Expand All @@ -429,7 +434,8 @@ def check(self):
# {
# "current_label": "<current label name>",
# "new_label": "<new_label_name>",
# "color": "<new_label_color>",
# "new_color": "<new_label_color>",
# "new_description": "<new_label_description>",
# }
# ]

Expand All @@ -443,6 +449,7 @@ def check(self):
"current_label": existing_labels[simple_name]["name"],
"new_label": new_label["name"],
"new_color": new_label["color"],
"new_description": new_label["description"],
}
)
else:
Expand Down Expand Up @@ -486,6 +493,7 @@ def fix(self, dry_run=False):
self.repo_name,
name=label["current_label"],
color=label["new_color"],
description=label["new_description"],
new_name=label["new_label"],
)
except HTTP4xxClientError as e:
Expand Down

0 comments on commit b51ca13

Please sign in to comment.