mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-03 04:10:49 +08:00
implementing PR bot feedback
This commit is contained in:
@ -139,8 +139,7 @@ class BitbucketServerProvider(GitProvider):
|
|||||||
#gets the best common ancestor: https://git-scm.com/docs/git-merge-base
|
#gets the best common ancestor: https://git-scm.com/docs/git-merge-base
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_best_common_ancestor(source_commits_list, destination_commits_list, guaranteed_common_ancestor) -> str:
|
def get_best_common_ancestor(source_commits_list, destination_commits_list, guaranteed_common_ancestor) -> str:
|
||||||
destination_commit_hashes = {commit['id'] for commit in destination_commits_list}
|
destination_commit_hashes = {commit['id'] for commit in destination_commits_list} | {guaranteed_common_ancestor}
|
||||||
destination_commit_hashes.add(guaranteed_common_ancestor)
|
|
||||||
|
|
||||||
for commit in source_commits_list:
|
for commit in source_commits_list:
|
||||||
for parent_commit in commit['parents']:
|
for parent_commit in commit['parents']:
|
||||||
|
@ -23,21 +23,17 @@ class TestBitbucketServerProvider:
|
|||||||
assert pr_number == 1
|
assert pr_number == 1
|
||||||
|
|
||||||
def mock_get_content_of_file(self, project_key, repository_slug, filename, at=None, markup=None):
|
def mock_get_content_of_file(self, project_key, repository_slug, filename, at=None, markup=None):
|
||||||
if at == '9c1cffdd9f276074bfb6fb3b70fbee62d298b058':
|
content_map = {
|
||||||
return 'file\nwith\nsome\nlines\nto\nemulate\na\nreal\nfile\n'
|
'9c1cffdd9f276074bfb6fb3b70fbee62d298b058': 'file\nwith\nsome\nlines\nto\nemulate\na\nreal\nfile\n',
|
||||||
elif at == '2a1165446bdf991caf114d01f7c88d84ae7399cf':
|
'2a1165446bdf991caf114d01f7c88d84ae7399cf': 'file\nwith\nmultiple \nlines\nto\nemulate\na\nfake\nfile\n',
|
||||||
return 'file\nwith\nmultiple \nlines\nto\nemulate\na\nfake\nfile\n'
|
'f617708826cdd0b40abb5245eda71630192a17e3': 'file\nwith\nmultiple \nlines\nto\nemulate\na\nreal\nfile\n',
|
||||||
elif at == 'f617708826cdd0b40abb5245eda71630192a17e3':
|
'cb68a3027d6dda065a7692ebf2c90bed1bcdec28': 'file\nwith\nsome\nchanges\nto\nemulate\na\nreal\nfile\n',
|
||||||
return 'file\nwith\nmultiple \nlines\nto\nemulate\na\nreal\nfile\n'
|
'1905dcf16c0aac6ac24f7ab617ad09c73dc1d23b': 'file\nwith\nsome\nlines\nto\nemulate\na\nfake\ntest\n',
|
||||||
elif at == 'cb68a3027d6dda065a7692ebf2c90bed1bcdec28':
|
'ae4eca7f222c96d396927d48ab7538e2ee13ca63': 'readme\nwithout\nsome\nlines\nto\nsimulate\na\nreal\nfile',
|
||||||
return 'file\nwith\nsome\nchanges\nto\nemulate\na\nreal\nfile\n'
|
'548f8ba15abc30875a082156314426806c3f4d97': 'file\nwith\nsome\nlines\nto\nemulate\na\nreal\nfile'
|
||||||
elif at == '1905dcf16c0aac6ac24f7ab617ad09c73dc1d23b':
|
}
|
||||||
return 'file\nwith\nsome\nlines\nto\nemulate\na\nfake\ntest\n'
|
|
||||||
elif at == 'ae4eca7f222c96d396927d48ab7538e2ee13ca63':
|
return content_map.get(at, '')
|
||||||
return 'readme\nwithout\nsome\nlines\nto\nsimulate\na\nreal\nfile'
|
|
||||||
elif at == '548f8ba15abc30875a082156314426806c3f4d97':
|
|
||||||
return 'file\nwith\nsome\nlines\nto\nemulate\na\nreal\nfile'
|
|
||||||
return ''
|
|
||||||
|
|
||||||
'''
|
'''
|
||||||
tests the 2-way diff functionality where the diff should be between the HEAD of branch b and node c
|
tests the 2-way diff functionality where the diff should be between the HEAD of branch b and node c
|
||||||
|
Reference in New Issue
Block a user