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.

In interest of minimizing the effect of running the EnsureLabels check:
For labels that generally have already-established descriptions, we use
those. For labels that don't, we just use !!null for now, with the plan
of adding descriptions in the near future.

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 19, 2023
1 parent bcb910d commit 7e3caa8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,20 @@

- name: ":hammer_and_wrench: maintenance"
color: "169509" # grassy green
description: !!null

- name: "waiting on author"
color: "bfd6f6" # baby blue
description: "The PR or issue is waiting on a response from the author"

- name: "closed-inactivity"
color: "dbcd00" # gold
description: "Indicates a PR has been closed because the author has been inactive for a long period of time."

- name: "needs test run"
color: "f5424b" # crimson red
description: !!null

- name: "good first issue :tada:"
color: "43dd35" # lime green
description: !!null
3 changes: 3 additions & 0 deletions migrate/repo_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,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 @@ -441,6 +442,7 @@ def check(self):
self._simplify_label(label.name): {
"color": label.color,
"name": label.name,
"description": label.description,
}
for label in existing_labels_from_api
}
Expand Down Expand Up @@ -498,6 +500,7 @@ def fix(self, dry_run=False):
self.repo_name,
name=current_label["name"],
color=new_label["color"],
description=new_label["description"],
new_name=new_label["name"],
)
except HTTP4xxClientError as e:
Expand Down

0 comments on commit 7e3caa8

Please sign in to comment.