Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dojo/api_v2/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2281,6 +2281,7 @@ def process_scan(
Raises exceptions in the event of an error
"""
try:
logger.debug(f"process_scan called with context: {context}")
start_time = time.perf_counter()
importer = self.get_importer(**context)
context["test"], _, _, _, _, _, _ = importer.process_scan(
Expand Down Expand Up @@ -2558,6 +2559,7 @@ def process_scan(
"""
statistics_before, statistics_delta = None, None
try:
logger.debug(f"process_scan called with context: {context}")
start_time = time.perf_counter()
if test := context.get("test"):
statistics_before = test.statistics
Expand Down
2 changes: 1 addition & 1 deletion dojo/api_v2/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2515,7 +2515,7 @@ def perform_create(self, serializer):
jira_driver = engagement or (product or None)
if jira_project := (jira_helper.get_jira_project(jira_driver) if jira_driver else None):
push_to_jira = push_to_jira or jira_project.push_all_issues
# logger.debug(f"push_to_jira: {push_to_jira}")

serializer.save(push_to_jira=push_to_jira)

def get_queryset(self):
Expand Down
2 changes: 2 additions & 0 deletions dojo/finding/deduplication.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def get_finding_models_for_deduplication(finding_ids):

"""
if not finding_ids:
logger.debug("get_finding_models_for_deduplication called with no finding_ids")
return []

return list(
Expand Down Expand Up @@ -543,6 +544,7 @@ def dedupe_batch_of_findings(findings, *args, **kwargs):
return batch_dedupe_method(findings, *args, **kwargs)

if not findings:
logger.debug("dedupe_batch_of_findings called with no findings")
return None

enabled = System_Settings.objects.get().enable_deduplication
Expand Down
10 changes: 10 additions & 0 deletions dojo/finding/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,13 +479,21 @@ def post_process_findings_batch_signature(finding_ids, *args, dedupe_option=True
def post_process_findings_batch(finding_ids, *args, dedupe_option=True, rules_option=True, product_grading_option=True,
issue_updater_option=True, push_to_jira=False, user=None, **kwargs):

logger.debug(
f"post_process_findings_batch called: finding_ids_count={len(finding_ids) if finding_ids else 0}, "
f"args={args}, dedupe_option={dedupe_option}, rules_option={rules_option}, "
f"product_grading_option={product_grading_option}, issue_updater_option={issue_updater_option}, "
f"push_to_jira={push_to_jira}, user={user.id if user else None}, kwargs={kwargs}",
)
if not finding_ids:
return

system_settings = System_Settings.objects.get()

# use list() to force a complete query execution and related objects to be loaded once
logger.debug(f"getting finding models for batch deduplication with: {len(finding_ids)} findings")
findings = get_finding_models_for_deduplication(finding_ids)
logger.debug(f"found {len(findings)} findings for batch deduplication")

if not findings:
logger.debug(f"no findings found for batch deduplication with IDs: {finding_ids}")
Expand Down Expand Up @@ -517,6 +525,8 @@ def post_process_findings_batch(finding_ids, *args, dedupe_option=True, rules_op
jira_helper.push_to_jira(finding)
else:
jira_helper.push_to_jira(finding.finding_group)
else:
logger.debug("push_to_jira is False, not ushing to JIRA")


@receiver(pre_delete, sender=Finding)
Expand Down
2 changes: 2 additions & 0 deletions dojo/importers/default_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@ def process_findings(
jira_helper.push_to_jira(findings[0].finding_group)
else:
jira_helper.push_to_jira(findings[0])
else:
logger.debug("push_to_jira is False, not pushing to JIRA")

# Note: All chord batching is now handled within the loop above

Expand Down