refactor(engagement): Extract Test models into dojo/test/ module [3/10]#14972
Draft
valentijnscholten wants to merge 5 commits into
Draft
refactor(engagement): Extract Test models into dojo/test/ module [3/10]#14972valentijnscholten wants to merge 5 commits into
valentijnscholten wants to merge 5 commits into
Conversation
d5ce0b8 to
d855e36
Compare
619aa3c to
7814217
Compare
This was referenced Jun 7, 2026
d855e36 to
a86c508
Compare
7814217 to
6f8ddfa
Compare
a86c508 to
43d0ea2
Compare
af767e0 to
517f275
Compare
43d0ea2 to
af61d58
Compare
517f275 to
aaefda7
Compare
…to dojo/engagement/
Phase 1 of module reorg per AGENTS.md. Move Engagement, Engagement_Presets +
admin registrations into dojo/engagement/{models,admin}.py. Cross-module FKs use
string refs to avoid circular imports; ENGAGEMENT_STATUS_CHOICES single-sourced
with re-export. No migration change.
…py [Phase 2 pilot] Phase 2 of module reorg per AGENTS.md. Move the engagement copy workflow (copy + product grade recalc + notification) out of the copy_engagement view into an HTTP-free copy_engagement(engagement, user) service, so both UI and (future) API can reuse it. The inline notification carried a TODO asking for exactly this. View is thinned to call the service. Add a unit test for the service (the workflow was previously untested). Notification URL uses relative reverse() to match the codebase convention.
…/ [engagement Phase 3,4]
…gagement Phase 6,7,8,9]
af61d58 to
a68bd0b
Compare
aaefda7 to
bc82e74
Compare
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 Engagement domain into a self-contained
dojo/engagement/package withui/andapi/subpackages, matching thedojo/url/reference and the just-completeddojo/test/module.Engagement,Engagement_Presets+ admin intodojo/engagement/{models,admin}.py. Cross-module FKs use string references;ENGAGEMENT_STATUS_CHOICESsingle-sourced + re-exported.Engagement_Surveyleft in place.copy_engagementview into an HTTP-freecopy_engagement(engagement, user)service so UI and API can share it; view thinned to call it. Adds a unit test (the workflow was previously untested).EngForm,DeleteEngagementForm,EngagementPresetsForm,DeleteEngagementPresetsForm,AddEngagementForm,ExistingEngagementFormintodojo/engagement/ui/forms.py.EngagementDirect*,Engagement*,ProductEngagement(s)*andEngagementTest*filter classes intodojo/engagement/ui/filters.py(base classes likeDojoFilterstay indojo/filters.py).dojo/engagement/ui/{views,urls}.py; update thedojo/urls.pyinclude and thedojo/asset/urls.pyconsumer.dojo/engagement/api/serializer.py(lazy imports forNote/File/TagListserializers to avoid a cycle),ApiEngagementFilterintodojo/engagement/api/filters.py,EngagementViewSet+EngagementPresetsViewsetintodojo/engagement/api/views.py, and the DRF route registration intodojo/engagement/api/urls.pyviaadd_engagement_urls(router). Routes and basenames (engagements/engagement,engagement_presets/engagement_presets) are preserved exactly.EngagementSerializer, the externally-used forms); re-exports that would create an import cycle (filters ↔dojo.filters, viewsets/serializers ↔dojo.api_v2) are dropped and the consumers point at the new path. No migration change.