@@ -45,6 +45,16 @@ def __init__(self,
45
45
def __contains__ (self , item : Any ) -> bool :
46
46
return item in self .body or item in self .title
47
47
48
+ def is_issue_mentioned (self , issue_url : str ) -> bool :
49
+ if issue_url in self :
50
+ return True
51
+ if "/pull/" in issue_url :
52
+ return False
53
+ issue_hash = f"#{ issue_url .split ('issues/' )[1 ]} "
54
+ if "fixes" in self .title .lower () and issue_hash in self .title :
55
+ return True
56
+ return any ("fixes" in line .lower () and issue_hash in line for line in self .body .split ("\n " ))
57
+
48
58
49
59
def get_revert_revision (commit : GitCommit ) -> Optional [str ]:
50
60
import re
@@ -371,18 +381,18 @@ def get_commits_dict(x, y):
371
381
print (f"len(release_commits)={ len (release_commits )} " )
372
382
print ("URL;Title;Status" )
373
383
for issue in gh_get_milestone_issues ('pytorch' , 'pytorch' , milestone_idx , IssueState .ALL ):
374
- html_url , state = issue ["html_url" ], issue ["state" ]
384
+ issue_url , state = issue ["html_url" ], issue ["state" ]
375
385
# Skip closed states if they were landed before merge date
376
386
if state == "closed" :
377
- mentioned_after_cut = any (html_url in commit_message for commit_message in main_commits .values ())
387
+ mentioned_after_cut = any (commit . is_issue_mentioned ( issue_url ) for commit in main_commits .values ())
378
388
# If issue is not mentioned after cut, that it must be present in release branch
379
389
if not mentioned_after_cut :
380
390
continue
381
- mentioned_in_release = any (html_url in commit_message for commit_message in release_commits .values ())
391
+ mentioned_in_release = any (commit . is_issue_mentioned ( issue_url ) for commit in release_commits .values ())
382
392
# if Issue is mentioned is release branch, than it was picked already
383
393
if mentioned_in_release :
384
394
continue
385
- print (f'{ html_url } ;{ issue ["title" ]} ;{ state } ' )
395
+ print (f'{ issue_url } ;{ issue ["title" ]} ;{ state } ' )
386
396
387
397
def commits_missing_in_release (repo : GitRepo , branch : str , orig_branch : str , minor_release : str , milestone_idx : int , cut_off_date : datetime , issue_num : int ) -> None :
388
398
def get_commits_dict (x , y ):
0 commit comments