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 May 11, 2023
1 parent 8f45273 commit cbc2b37
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 @@ -412,6 +412,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 @@ -436,7 +437,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 @@ -445,7 +450,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 @@ -459,6 +465,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 @@ -502,6 +509,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 cbc2b37

Please sign in to comment.