Support sync kwarg in process_findings for inline post-processing#14309
Open
valentijnscholten wants to merge 3 commits intoDefectDojo:bugfixfrom
Open
Support sync kwarg in process_findings for inline post-processing#14309valentijnscholten wants to merge 3 commits intoDefectDojo:bugfixfrom
valentijnscholten wants to merge 3 commits intoDefectDojo:bugfixfrom
Conversation
Thread the sync kwarg from process_findings through to dojo_dispatch_task in both DefaultImporter and DefaultReImporter so callers can force post_process_findings_batch to run inline instead of spawning additional Celery tasks. Pop sync from kwargs in sync_process_findings to avoid duplicate keyword argument errors.
87b77c1 to
6835a3b
Compare
The reimporter's process_results() checks kwargs.get("sync") to decide
whether to return real Finding objects or serialized JSON strings. Using
kwargs.pop() removed sync before process_results could see it, causing
findings_to_mitigate to contain JSON strings instead of Finding objects
and crashing close_old_findings with:
AttributeError: 'str' object has no attribute 'refresh_from_db'
Switch from pop() to get() so sync remains in kwargs for process_results.
…akage The sync=True injected by sync_process_findings was leaking through to dojo_dispatch_task(post_process_findings_batch), forcing it to run synchronously instead of async. This caused +7 to +61 extra queries in performance tests. - Remove sync=True from sync_process_findings (dead since ASYNC_FINDING_IMPORT removal) - Remove sync kwarg threading in process_findings for both importers - Remove dead serialization branches in process_results and process_findings - Remove unused django.core.serializers imports
Maffooch
approved these changes
Feb 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
synckwarg fromprocess_findings()through todojo_dispatch_task()in bothDefaultImporterandDefaultReImporter, so callers can forcepost_process_findings_batchto run inline.syncfrom kwargs insync_process_findings()to avoid duplicate keyword argument errors.