refactor(reorg): extract notes/note_type/file_uploads/reports/risk_acceptance [9/10]#14986
Draft
valentijnscholten wants to merge 2 commits into
Draft
refactor(reorg): extract notes/note_type/file_uploads/reports/risk_acceptance [9/10]#14986valentijnscholten wants to merge 2 commits into
valentijnscholten wants to merge 2 commits into
Conversation
…s into dojo/<module>/ [Phase 1,3,5,6,8,9]
…eptance/ [risk_acceptance Phase 1,3,6,7,8,9]
This was referenced Jun 9, 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. This PR continues the stack on top of #14983 — full implementation brief is the Phase 10 section in
AGENTS.md.Summary
Reorganizes the
note_type,notes,file_uploads,reports, andrisk_acceptancedomains into self-containeddojo/{module}/packages 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.note_type / notes / file_uploads / reports
Note_Type,NoteHistory,Notes,FileUpload,FileAccessToken,Report_Typeinto their modules'{models,admin}.pywith string-ref FKs.UniqueUploadNameProviderdeliberately STAYS indojo/models.py(migrations hardcodedojo.models.UniqueUploadNameProviderasupload_to; moving it would change the serialized path) and is imported bydojo/file_uploads/models.py.api/serializer.py.NoteSerializer/NoteHistorySerializer/FileSerializer/NoteTypeSerializerare re-exported fromapi_v2/serializers.py— they are lazy-imported by finding/test/engagement and discovered by the prefetcher. Withinnotes/api/serializer.py,UserStubSerializerandNoteTypeSerializerare imported directly from their modules (not viaapi_v2) to avoid a cycle.NoteTypeViewSet/NotesViewSetintoapi/views.pywithadd_*_urls; move forms into each module'sui/forms.py; moveviews.py/urls.pyintoui/. The report-generation forms (ReportOptionsForm/CustomReportOptionsForm) move intoreports/ui/forms.py.risk_acceptance (
dojo/risk_acceptance/)Risk_Acceptanceintodojo/risk_acceptance/{models,admin}.py(string-ref FKs).dojo/risk_acceptance/api.pyinto a properapi/package:api/serializer.py(RiskAcceptanceSerializer/RiskAcceptanceProofSerializer/RiskAcceptanceToNotesSerializer, withNoteSerializerimported fromnotesandEngagementSerializerlazy-imported),api/views.py(RiskAcceptanceViewSet),api/filters.py(ApiRiskAcceptanceFilter),api/urls.py(add_risk_acceptance_urls), andapi/mixins.py(theAcceptedRisksMixin/AcceptedFindingsMixin/AcceptedRiskSerializer).api/__init__.pyre-exports the mixins so finding/test/engagement keep consuming them asra_api.*unchanged.api_v2/serializers.pyfor finding's schema-override lazy import and prefetcher discovery. Move the risk-acceptance forms intoui/forms.py(re-exported fromdojo/forms.pyfor engagement's UI views).