mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-12-11 18:35:18 +00:00
Merge pull request #1938 from furikake6000/fix/fix-ignore-files-config-on-bitbucketserver
fix: add support for filtering ignored files in Bitbucket Server provider
This commit is contained in:
commit
ae6576c06b
2 changed files with 5 additions and 1 deletions
|
|
@ -56,6 +56,8 @@ def filter_ignored(files, platform = 'github'):
|
||||||
files_o.append(f)
|
files_o.append(f)
|
||||||
continue
|
continue
|
||||||
files = files_o
|
files = files_o
|
||||||
|
elif platform == 'bitbucket_server':
|
||||||
|
files = [f for f in files if f.get('path', {}).get('toString') and not r.match(f['path']['toString'])]
|
||||||
elif platform == 'gitlab':
|
elif platform == 'gitlab':
|
||||||
# files = [f for f in files if (f['new_path'] and not r.match(f['new_path']))]
|
# files = [f for f in files if (f['new_path'] and not r.match(f['new_path']))]
|
||||||
files_o = []
|
files_o = []
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ from requests.exceptions import HTTPError
|
||||||
import shlex
|
import shlex
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
from ..algo.file_filter import filter_ignored
|
||||||
from ..algo.git_patch_processing import decode_if_bytes
|
from ..algo.git_patch_processing import decode_if_bytes
|
||||||
from ..algo.language_handler import is_valid_file
|
from ..algo.language_handler import is_valid_file
|
||||||
from ..algo.types import EDIT_TYPE, FilePatchInfo
|
from ..algo.types import EDIT_TYPE, FilePatchInfo
|
||||||
|
|
@ -244,7 +245,8 @@ class BitbucketServerProvider(GitProvider):
|
||||||
original_file_content_str = ""
|
original_file_content_str = ""
|
||||||
new_file_content_str = ""
|
new_file_content_str = ""
|
||||||
|
|
||||||
changes = self.bitbucket_client.get_pull_requests_changes(self.workspace_slug, self.repo_slug, self.pr_num)
|
changes_original = list(self.bitbucket_client.get_pull_requests_changes(self.workspace_slug, self.repo_slug, self.pr_num))
|
||||||
|
changes = filter_ignored(changes_original, 'bitbucket_server')
|
||||||
for change in changes:
|
for change in changes:
|
||||||
file_path = change['path']['toString']
|
file_path = change['path']['toString']
|
||||||
if not is_valid_file(file_path.split("/")[-1]):
|
if not is_valid_file(file_path.split("/")[-1]):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue