Skip to content

Commit 7859029

Browse files
push_to_jira: add logging
1 parent 88bed96 commit 7859029

4 files changed

Lines changed: 14 additions & 1 deletion

File tree

dojo/api_v2/serializers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2281,6 +2281,7 @@ def process_scan(
22812281
Raises exceptions in the event of an error
22822282
"""
22832283
try:
2284+
logger.debug(f"process_scan called with context: {context}")
22842285
start_time = time.perf_counter()
22852286
importer = self.get_importer(**context)
22862287
context["test"], _, _, _, _, _, _ = importer.process_scan(
@@ -2558,6 +2559,7 @@ def process_scan(
25582559
"""
25592560
statistics_before, statistics_delta = None, None
25602561
try:
2562+
logger.debug(f"process_scan called with context: {context}")
25612563
start_time = time.perf_counter()
25622564
if test := context.get("test"):
25632565
statistics_before = test.statistics

dojo/api_v2/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2515,7 +2515,7 @@ def perform_create(self, serializer):
25152515
jira_driver = engagement or (product or None)
25162516
if jira_project := (jira_helper.get_jira_project(jira_driver) if jira_driver else None):
25172517
push_to_jira = push_to_jira or jira_project.push_all_issues
2518-
# logger.debug(f"push_to_jira: {push_to_jira}")
2518+
25192519
serializer.save(push_to_jira=push_to_jira)
25202520

25212521
def get_queryset(self):

dojo/finding/helper.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,12 +479,19 @@ def post_process_findings_batch_signature(finding_ids, *args, dedupe_option=True
479479
def post_process_findings_batch(finding_ids, *args, dedupe_option=True, rules_option=True, product_grading_option=True,
480480
issue_updater_option=True, push_to_jira=False, user=None, **kwargs):
481481

482+
logger.debug(
483+
f"post_process_findings_batch called: finding_ids_count={len(finding_ids) if finding_ids else 0}, "
484+
f"args={args}, dedupe_option={dedupe_option}, rules_option={rules_option}, "
485+
f"product_grading_option={product_grading_option}, issue_updater_option={issue_updater_option}, "
486+
f"push_to_jira={push_to_jira}, user={user.id if user else None}, kwargs={kwargs}",
487+
)
482488
if not finding_ids:
483489
return
484490

485491
system_settings = System_Settings.objects.get()
486492

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

490497
if not findings:
@@ -517,6 +524,8 @@ def post_process_findings_batch(finding_ids, *args, dedupe_option=True, rules_op
517524
jira_helper.push_to_jira(finding)
518525
else:
519526
jira_helper.push_to_jira(finding.finding_group)
527+
else:
528+
logger.debug("push_to_jira is False, not ushing to JIRA")
520529

521530

522531
@receiver(pre_delete, sender=Finding)

dojo/importers/default_importer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,8 @@ def process_findings(
279279
jira_helper.push_to_jira(findings[0].finding_group)
280280
else:
281281
jira_helper.push_to_jira(findings[0])
282+
else:
283+
logger.debug("push_to_jira is False, not pushing to JIRA")
282284

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

0 commit comments

Comments
 (0)