Document precisely what we're not doing with labels

This commit is contained in:
benjamin melançon 2023-10-04 22:44:06 -04:00
parent d7233f55f4
commit ebcfba0efd

View file

@ -37,7 +37,14 @@ def move_issue(source_owner, source_repo, issue_number, destination_owner, desti
labels = json_response.pop('labels', {}) labels = json_response.pop('labels', {})
if labels: if labels:
print("Labels are unique per project and rather than messing with creating ones with the same name we have removed the following labels:", ', '.join(l['name'] for l in labels)) print("Labels are unique per project and rather than messing with creating ones with the same name we have removed the following labels:", ', '.join(l['name'] for l in labels))
# Labels already removed with pop so we're good. # Specifically we aren't going to be getting all the labels for a repo
# with GET /repos/{owner}/{repo}/labels and seeing if our label names
# exist and creating new labels in our new repo with the same name etc
# if they don't with POST /repos/{owner}/{repo}/labels and finally
# assigning all of those new or existing labels to our new issue with
# POST /repos/{owner}/{repo}/issues/{index}/labels
# Note: Labels already removed with pop so we're good on not blowing up.
assignees = json_response.pop('assignees', {}) assignees = json_response.pop('assignees', {})
if assignees: if assignees: