Skip to content

refactor(reorg): extract survey + benchmark modules [8/10]#14983

Draft
valentijnscholten wants to merge 1 commit into
reorg/peripheral-tools-endpointfrom
reorg/peripheral-survey-benchmark
Draft

refactor(reorg): extract survey + benchmark modules [8/10]#14983
valentijnscholten wants to merge 1 commit into
reorg/peripheral-tools-endpointfrom
reorg/peripheral-survey-benchmark

Conversation

@valentijnscholten

@valentijnscholten valentijnscholten commented Jun 8, 2026

Copy link
Copy Markdown
Member

Stacked PRs

This is one of a stacked series that reorganizes dojo/ into self-contained dojo/{module}/ packages (matching the dojo/url/ reference). They are stacked — each PR is based on the previous one — so review and merge bottom-up in this order:

  1. refactor(product_type): Extra ProductType models into dojo/product_type/ module [1/10] #14970 — product_type
  2. refactor(test): Extract Test models into dojo/test/ module [2/10] #14971 — test
  3. refactor(engagement): Extract Test models into dojo/test/ module [3/10] #14972 — engagement
  4. refactor(product): Extract Product module into dojo/product/ [4/10] #14973 — product
  5. refactor(finding): Reorganize finding into self-contained dojo/finding/ package [5/10] #14974 — finding (+ CWE & BurpRawRequestResponse fold-in)
  6. refactor(reorg): extract user + system_settings modules [6/10] #14981 — peripheral: user + system_settings
  7. refactor(reorg): extract endpoint + tool_type/tool_config/tool_product modules [7/10] #14982 — peripheral: endpoint + tool_type/tool_config/tool_product
  8. refactor(reorg): extract survey + benchmark modules [8/10] #14983 — peripheral: survey + benchmark ◀ this PR
  9. refactor(reorg): extract notes/note_type/file_uploads/reports/risk_acceptance [9/10] #14986 — peripheral: notes/note_type + file_uploads + reports + risk_acceptance
  10. refactor(reorg): extract regulations/banner/announcement/development_environment/object [10/10] #14987 — peripheral: regulations + banner + announcement + development_environment + object

Merge #14970 first; each following branch is rebased onto the updated base and merged in turn. This PR continues the stack on top of #14982 — full implementation brief is the Phase 10 section in AGENTS.md.

Summary

Reorganizes the survey and benchmark domains into self-contained dojo/survey/ and dojo/benchmark/ packages with a ui/ sub-package, matching the dojo/url/ reference layout. Neither domain has any api_v2 serializers/viewsets, so there is no api/ layer (Phases 6–9 skipped). Pure code-movement: no behaviour or migration changes; backward-compat re-exports keep external consumers working.

benchmark (dojo/benchmark/)

  • Move Benchmark_Type, Benchmark_Category, Benchmark_Requirement, Benchmark_Product, Benchmark_Product_Summary into dojo/benchmark/{models,admin}.py. All FKs use string refs; Benchmark_Requirement.cwe_mapping references "dojo.CWE" (CWE lives in dojo/finding/, re-exported from dojo.models).
  • Move the benchmark forms into ui/forms.py (re-exported from dojo/forms.py for external consumers). Move views.py/urls.py into ui/; signals.py stays.

survey (dojo/survey/)

  • Move the polymorphic question/answer/survey models (Question, TextQuestion, Choice, ChoiceQuestion, Engagement_Survey, Answered_Survey, General_Survey, Answer, TextAnswer, ChoiceAnswer) into dojo/survey/{models,admin}.py. The Question and Answer base classes keep their with warnings.catch_warnings(action="ignore", category=ManagerInheritanceWarning): wrapping. All FKs use string refs; get_form() lazy-imports the question forms from dojo.survey.ui.forms.
  • Move the questionnaire/question/answer forms into ui/forms.py (including the survey-specific MultiWidgetBasic/MultiExampleField and the now-single-sourced MultipleSelectWithPop widget, removed as dead code from dojo/forms.py), and QuestionnaireFilter/QuestionTypeFilter into ui/filters.py. Move views.py/urls.py into ui/.

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.

1 participant