Skip to content

fix(parsers): use unsaved_tags instead of tags= in Finding constructor#14626

Open
valentijnscholten wants to merge 7 commits intoDefectDojo:bugfixfrom
valentijnscholten:fix/parser-tags-performance
Open

fix(parsers): use unsaved_tags instead of tags= in Finding constructor#14626
valentijnscholten wants to merge 7 commits intoDefectDojo:bugfixfrom
valentijnscholten:fix/parser-tags-performance

Conversation

@valentijnscholten
Copy link
Copy Markdown
Member

@valentijnscholten valentijnscholten commented Apr 1, 2026

Summary

While working performance improvements I noticed the JFrog xray parser looked quite slow compared to other parsers.
Turns out that setting the tags field while constructing Finding models (in-memory) made it very slow.

The 14k findings report took anywhere between 60 and 90 second just to parse. By switching to unsaved_tags it's now ~9seconds. Some other parsers needed the same fix and are part of this PR.

  • Passing tags= directly to the Finding() constructor triggers expensive tagulous tag processing for every finding object created during parsing
  • Changed 5 affected parsers to use finding.unsaved_tags = tags after construction instead, which lets the import pipeline handle tags efficiently
  • Affected parsers: jfrog_xray_unified, dependency_check, cargo_audit, anchore_grype, threat_composer

Benchmark on JFrog Xray Unified with 14,219 findings: 99s → 7.97s (12x faster)

…r for performance

Passing tags= directly to the Finding() constructor triggers expensive
tagulous processing for every finding. Using finding.unsaved_tags instead
bypasses this overhead and lets the import pipeline handle tags efficiently.

Affected parsers: jfrog_xray_unified, dependency_check, cargo_audit,
anchore_grype, threat_composer.

Benchmark on 14,219 findings: 99s -> 7.97s (12x faster).
@github-actions github-actions bot added the parser label Apr 1, 2026
@valentijnscholten valentijnscholten added this to the 2.57.0 milestone Apr 1, 2026
@Maffooch Maffooch modified the milestones: 2.57.0, 2.57.1 Apr 3, 2026
…ring

Update tests for dependency_check and jfrog_xray_unified parsers to match
the actual list format returned by unsaved_tags, and fix the expected order
of tags for the suppressed-without-notes case in dependency_check.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

This pull request has conflicts, please resolve those before we can evaluate the pull request.

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

Conflicts have been resolved. A maintainer will review the pull request shortly.

The previous commit mixed substantive changes (tags= → unsaved_tags)
with ruff auto-formatting. This restores the original code style while
preserving the performance fix.
@valentijnscholten
Copy link
Copy Markdown
Member Author

cleaned up the format only changes which are not relevant here.

Copy link
Copy Markdown
Contributor

@mtesauro mtesauro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@Maffooch Maffooch requested review from Jino-T and paulOsinski April 11, 2026 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants