Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Commit 6913fdc

Browse files
adjust the impacted files resolver to not call gh
1 parent fd87f23 commit 6913fdc

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

compare/commands/compare/interactors/fetch_impacted_files.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def _apply_filters(
4040
components_paths = []
4141
components_flags = []
4242

43-
head_commit_report = comparison.head_report
43+
head_commit_report = comparison.head_report_without_applied_diff
4444
if components_filter:
4545
all_components = components.commit_components(
4646
comparison.head_commit, comparison.user

compare/commands/compare/interactors/tests/test_fetch_impacted_files.py

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,10 @@ def test_impacted_files_filtered_by_unintended_changes_set_to_false(
564564
impacted_files = self.execute(None, self.comparison_report, comparison, filters)
565565
assert [file.head_name for file in impacted_files] == ["fileA", "fileB"]
566566

567-
@patch("services.comparison.Comparison.head_report", new_callable=PropertyMock)
567+
@patch(
568+
"services.comparison.Comparison.head_report_without_applied_diff",
569+
new_callable=PropertyMock,
570+
)
568571
@patch("shared.api_archive.archive.ArchiveService.read_file")
569572
def test_impacted_files_filtered_by_flags_and_commit_comparison_for_pull(
570573
self, read_file, build_report_from_commit_mock
@@ -605,7 +608,10 @@ def test_impacted_files_filtered_by_flags_and_commit_comparison_for_pull(
605608
assert len(impacted_files) == 1
606609
assert impacted_files[0].head_name == "fileA"
607610

608-
@patch("services.comparison.Comparison.head_report", new_callable=PropertyMock)
611+
@patch(
612+
"services.comparison.Comparison.head_report_without_applied_diff",
613+
new_callable=PropertyMock,
614+
)
609615
@patch("shared.api_archive.archive.ArchiveService.read_file")
610616
def test_impacted_files_filtered_by_flags_and_commit_comparison_for_parent_commit(
611617
self, read_file, build_report_from_commit_mock
@@ -639,7 +645,10 @@ def test_impacted_files_filtered_by_flags_and_commit_comparison_for_parent_commi
639645
assert impacted_files[0].head_name == "fileA"
640646

641647
@patch("services.components.commit_components")
642-
@patch("services.comparison.Comparison.head_report", new_callable=PropertyMock)
648+
@patch(
649+
"services.comparison.Comparison.head_report_without_applied_diff",
650+
new_callable=PropertyMock,
651+
)
643652
@patch("shared.api_archive.archive.ArchiveService.read_file")
644653
def test_impacted_files_filtered_by_components_and_commit_comparison_for_parent_commit(
645654
self, read_file, build_report_from_commit_mock, commit_components_mock
@@ -682,7 +691,10 @@ def test_impacted_files_filtered_by_components_and_commit_comparison_for_parent_
682691
assert impacted_files[0].head_name == "fileA.py"
683692

684693
@patch("services.components.commit_components")
685-
@patch("services.comparison.Comparison.head_report", new_callable=PropertyMock)
694+
@patch(
695+
"services.comparison.Comparison.head_report_without_applied_diff",
696+
new_callable=PropertyMock,
697+
)
686698
@patch("shared.api_archive.archive.ArchiveService.read_file")
687699
def test_impacted_files_filtered_by_components_using_flags(
688700
self, read_file, build_report_from_commit_mock, commit_components_mock
@@ -731,7 +743,10 @@ def test_impacted_files_filtered_by_components_using_flags(
731743
assert impacted_files[1].head_name == "fileB.js"
732744

733745
@patch("services.components.commit_components")
734-
@patch("services.comparison.Comparison.head_report", new_callable=PropertyMock)
746+
@patch(
747+
"services.comparison.Comparison.head_report_without_applied_diff",
748+
new_callable=PropertyMock,
749+
)
735750
@patch("shared.api_archive.archive.ArchiveService.read_file")
736751
def test_impacted_files_filtered_by_components_and_flags_commit_comparison_for_parent_commit(
737752
self, read_file, build_report_from_commit_mock, commit_components_mock

0 commit comments

Comments
 (0)