class ReleaseWorkflow:
+ CHERRY_PICK_FAILED_LABEL = 'release:cherry-pick-failed'
+
"""
This class implements the sub-commands for the release-workflow command.
The current sub-commands are:
message += "Please manually backport the fix and push it to your github fork. Once this is done, please add a comment like this:\n\n`/branch <user>/<repo>/<branch>`"
issue = self.issue
comment = issue.create_comment(message)
- issue.add_to_labels('release:cherry-pick-failed')
+ issue.add_to_labels(self.CHERRY_PICK_FAILED_LABEL)
return comment
def issue_notify_pull_request_failure(self, branch:str) -> github.IssueComment.IssueComment:
message += self.action_url
return self.issue.create_comment(message)
+ def issue_remove_cherry_pick_failed_label(self):
+ if self.CHERRY_PICK_FAILED_LABEL in [l.name for l in self.issue.labels]:
+ self.issue.remove_from_labels(self.CHERRY_PICK_FAILED_LABEL)
def create_branch(self, commits:List[str]) -> bool:
"""
local_repo.git.push(push_url, 'HEAD:{}'.format(branch_name))
self.issue_notify_branch()
+ self.issue_remove_cherry_pick_failed_label()
return True
return False
self.issue_notify_pull_request(pull)
+ self.issue_remove_cherry_pick_failed_label()
# TODO(tstellar): Do you really want to always return True?
return True