in services/lambda-pr-status-labeler/pr_status_bot/PRStatusBot.py [0:0]
def _drop_other_pr_labels(self, pr, desired_label):
labels = pr.get_labels()
if not labels:
logging.info('No labels found')
return
for label in labels:
logging.info(f'Label:{label}')
if label.name.startswith('pr-') and label.name != desired_label:
try:
logging.info(f'Removing {label}')
pr.remove_from_labels(label)
except Exception:
logging.error(f'Error while removing the label {label}')