mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-04 04:40:38 +08:00
to changes suggested by /improve with my small touch
This commit is contained in:
@ -173,11 +173,15 @@ class GitLabProvider(GitProvider):
|
||||
'position': pos_obj})
|
||||
|
||||
def get_relevant_diff(self, relevant_file, relevant_line_in_file):
|
||||
for d in self.mr.diffs.list(get_all=True):
|
||||
changes = self.mr.changes() # Retrieve the changes for the merge request
|
||||
changes = self.mr.changes() # Retrieve the changes for the merge request once
|
||||
all_diffs = self.mr.diffs.list(get_all=True)
|
||||
|
||||
for d in all_diffs:
|
||||
for change in changes['changes']:
|
||||
if change['new_path'] == relevant_file and relevant_line_in_file in change['diff']:
|
||||
return d
|
||||
logging.debug(
|
||||
f'No relevant diff found for {relevant_file} {relevant_line_in_file}. Falling back to last diff.')
|
||||
return self.last_diff # fallback to last_diff if no relevant diff is found
|
||||
|
||||
def publish_code_suggestions(self, code_suggestions: list):
|
||||
|
@ -1,7 +1,7 @@
|
||||
[config]
|
||||
model="gpt-4"
|
||||
model="gpt-3.5-turbo-16k"
|
||||
fallback_models=["gpt-3.5-turbo-16k"]
|
||||
git_provider="github"
|
||||
git_provider="gitlab"
|
||||
publish_output=true
|
||||
publish_output_progress=true
|
||||
verbosity_level=0 # 0,1,2
|
||||
|
Reference in New Issue
Block a user