@@ -49,6 +49,8 @@ def setup_llvmbot_git(git_dir = '.'):
49
49
50
50
class ReleaseWorkflow :
51
51
52
+ CHERRY_PICK_FAILED_LABEL = 'release:cherry-pick-failed'
53
+
52
54
"""
53
55
This class implements the sub-commands for the release-workflow command.
54
56
The current sub-commands are:
@@ -146,14 +148,17 @@ def issue_notify_cherry_pick_failure(self, commit:str) -> github.IssueComment.Is
146
148
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>`"
147
149
issue = self .issue
148
150
comment = issue .create_comment (message )
149
- issue .add_to_labels ('release:cherry-pick-failed' )
151
+ issue .add_to_labels (self . CHERRY_PICK_FAILED_LABEL )
150
152
return comment
151
153
152
154
def issue_notify_pull_request_failure (self , branch :str ) -> github .IssueComment .IssueComment :
153
155
message = "Failed to create pull request for {} " .format (branch )
154
156
message += self .action_url
155
157
return self .issue .create_comment (message )
156
158
159
+ def issue_remove_cherry_pick_failed_label (self ):
160
+ if self .CHERRY_PICK_FAILED_LABEL in [l .name for l in self .issue .labels ]:
161
+ self .issue .remove_from_labels (self .CHERRY_PICK_FAILED_LABEL )
157
162
158
163
def create_branch (self , commits :List [str ]) -> bool :
159
164
"""
@@ -183,6 +188,7 @@ def create_branch(self, commits:List[str]) -> bool:
183
188
local_repo .git .push (push_url , 'HEAD:{}' .format (branch_name ))
184
189
185
190
self .issue_notify_branch ()
191
+ self .issue_remove_cherry_pick_failed_label ()
186
192
return True
187
193
188
194
@@ -216,6 +222,7 @@ def create_pull_request(self, owner:str, branch:str) -> bool:
216
222
return False
217
223
218
224
self .issue_notify_pull_request (pull )
225
+ self .issue_remove_cherry_pick_failed_label ()
219
226
220
227
# TODO(tstellar): Do you really want to always return True?
221
228
return True
0 commit comments