refactor(finding): Reorganize finding into self-contained dojo/finding/ package [5/10]#14974
Draft
valentijnscholten wants to merge 5 commits into
Draft
refactor(finding): Reorganize finding into self-contained dojo/finding/ package [5/10]#14974valentijnscholten wants to merge 5 commits into
valentijnscholten wants to merge 5 commits into
Conversation
d85da61 to
bb94914
Compare
71e5db3 to
13da2d6
Compare
bb94914 to
9b496b8
Compare
13da2d6 to
1ece5fa
Compare
This was referenced Jun 7, 2026
9b496b8 to
8211ac8
Compare
1ece5fa to
b2d53bb
Compare
8211ac8 to
6e960b9
Compare
b2d53bb to
f1c0396
Compare
6e960b9 to
fab1ca1
Compare
f1c0396 to
0b96d78
Compare
0b96d78 to
15631a6
Compare
6b36b59 to
e5724b1
Compare
0657d87 to
4fae92a
Compare
Contributor
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
1 similar comment
Contributor
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Contributor
|
Conflicts have been resolved. A maintainer will review the pull request shortly. |
…ding_Template into dojo/finding/
Phase 1 of module reorg per AGENTS.md. Move Finding (+ custom FindingAdmin),
Vulnerability_Id, Finding_Group, Finding_Template + admin registrations into
dojo/finding/{models,admin}.py. Cross-module FKs use string refs; date/util field
defaults imported from dojo.models to preserve migration serialization path; restore
load-bearing parse_cvss_data re-export for dojo.location side-effect registration.
No migration change.
e5724b1 to
2d773ad
Compare
4fae92a to
9989d68
Compare
…g/ [finding Phase 1,6,8,9]
This was referenced Jun 8, 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.
Stacked PRs
This is one of a stacked series that reorganizes
dojo/into self-containeddojo/{module}/packages (matching thedojo/url/reference). They are stacked — each PR is based on the previous one — so review and merge bottom-up in this order:Merge #14970 first; each following branch is rebased onto the updated base and merged in turn. PRs 6–10 (draft, head branches on the DefectDojo upstream repo) continue the stack on top of #14974 — full implementation brief is the Phase 10 section in
AGENTS.md.Summary
Reorganizes the Finding domain (the largest module) into a self-contained
dojo/finding/package withui/andapi/sub-packages, matching thedojo/url/reference layout. Pure code-movement: no behaviour or migration changes; backward-compat re-exports keep external consumers working.Models
Finding(+ customFindingAdmin),Vulnerability_Id,Finding_Group,Finding_Templateintodojo/finding/{models,admin}.py.get_current_date, etc.) are imported fromdojo.modelsto preserve their module path for migration serialization (no spurious migration).parse_cvss_datare-export whose import side-effect registersdojo.locationmodels forapps.py:ready().Services
services.py— the finding workflow logic already lives indojo/finding/helper.py,deduplication.py, andqueries.py(close/verify, group create/merge, dedup, copy-from-template, vulnerability-id save). Nothing to extract without duplicating well-placed code.UI layer (
dojo/finding/ui/)ui/forms.py; finding's own views import them directly, with re-exports left indojo/forms.pyonly for the forms consumed by other modules.ui/filters.pyand repoint every consumer (search, test, finding_group, metrics, product, reports, api views + tests). Nodojo/filters.pyre-exports (they would cycle). Shared filter bases (DojoFilter, theFinding*ChoiceFilterwidgets, andFindingTagFilter/FindingTagStringFilter, the latter still subclassed by a remaining metrics filter) stay indojo/filters.py.views.pyandurls.pyintoui/, repointing thedojo/urls.pyinclude and external view importers.API layer (
dojo/finding/api/)api/serializer.py. To break the cycle withdojo/api_v2/serializers.py, the module carries zero top-levelapi_v2.serializersimport — references toNoteSerializer/FileSerializer/TagListSerializerField/JIRAIssueSerializer/RiskAcceptanceSerializer/BurpRawRequestResponseSerializer/etc. are resolved lazily insideget_fields()/build_relational_field(), and@extend_schema_fieldoverrides are applied lazily at module load.dojo/api_v2/serializers.py:FindingSerializer/FindingToNotesSerializerare nested by the remainingReportGenerateSerializer, and the full moved set is re-exported to preserve the exactdojo.api_v2.serializersmodule membership that the prefetcher'sinspect.getmembersdiscovery relies on.ApiFindingFilter/ApiTemplateFindingFilterintoapi/filters.pyandFindingViewSet/FindingTemplatesViewSetintoapi/views.py(preserving the@extend_schema_viewdecorators), repointingunittests/test_rest_framework.pyand pruning the now-unused finding imports left inapi_v2/views.py. No viewset re-export (would cycle).dojo/finding/api/urls.pywithadd_finding_urls(router)and wire it intodojo/urls.py, preserving the exactfindings/findingandfinding_templates/finding_templateroutes and basenames.