Refactor Azure DevOps provider to use PR iterations for change detection, improving accuracy of diff file identification

This commit is contained in:
mrT23
2024-05-15 09:05:01 +03:00
parent e4565f7106
commit e56320540b
3 changed files with 10 additions and 10 deletions

View File

@ -237,12 +237,12 @@ class AzureDevopsProvider(GitProvider):
pull_request_id=self.pr_num,
project=self.workspace_slug
)
changes = []
changes = None
if iterations:
iteration_id = iterations[-1].id # Get the last iteration (most recent changes)
# Get changes for the iteration
changes: GitPullRequestIterationChanges = self.azure_devops_client.get_pull_request_iteration_changes(
changes = self.azure_devops_client.get_pull_request_iteration_changes(
repository_id=self.repo_slug,
pull_request_id=self.pr_num,
iteration_id=iteration_id,
@ -336,8 +336,8 @@ class AzureDevopsProvider(GitProvider):
original_file_content_str = ""
patch = load_large_diff(
file, new_file_content_str, original_file_content_str
)
file, new_file_content_str, original_file_content_str, show_warning=False
).rstrip()
diff_files.append(
FilePatchInfo(