Skip to content

Commit b5fa7aa

Browse files
fix: don't close old findings when reimport auto-creates a new test
When auto_create_context=True and the test doesn't exist yet, the reimport falls back to DefaultImporter. With close_old_findings=True, this would incorrectly close findings from other tests in the same engagement/product scope because the newly created test has no prior findings to compare against. Suppress close_old_findings for this initial-import path. Fixes #14363.
1 parent cf1f286 commit b5fa7aa

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

dojo/api_v2/serializers.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2711,8 +2711,11 @@ def process_scan(
27112711
# Attempt to create an engagement
27122712
logger.debug("reimport for non-existing test, using import to create new test")
27132713
context["engagement"] = auto_create_manager.get_or_create_engagement(**context)
2714+
# Do not close old findings when creating a brand new test: there are no
2715+
# existing findings to compare against, and close_old_findings would
2716+
# incorrectly close findings from other tests in the same scope.
27142717
context["test"], _, _, _, _, _, _ = self.get_importer(
2715-
**context,
2718+
**{**context, "close_old_findings": False},
27162719
).process_scan(
27172720
context.pop("scan", None),
27182721
)

0 commit comments

Comments
 (0)