F12.12 — Django RequestUtils name collision
| State | Closed |
| Parent | E12 |
| Iteration | Release 3 |
| Start Date | 2026-10-04 |
| Closed Date | 2026-10-04 |
| Predecessors | — |
| Source | Owner decision, 2026-10-04 |
Stories: 1 Closed
| Story | State | Depends on |
|---|---|---|
S12.12.1 — Move debug_request and drop the aliases |
Closed (2026-10-04) | — |
rn-forge-django defines two unrelated public classes called RequestUtils.
rn_forge.django.utils.RequestUtils has one static method,
debug_request(request), which returns a redacted snapshot of a Django
HttpRequest. rn_forge.django.drf.RequestUtils (in drf/utils.py) has typed
accessors for a DRF Request, used by the view mixins, the exception handler
and every auth module. The two share no logic. Code that needs both must alias
one of them, and the API reference lists two classes with the same name. This
feature removes the Django class and keeps the DRF one. It also removes the DRF
module's compatibility aliases, because the same rn-forge-django version is
already breaking.
Context
Outcome: the owner carried this break in the same rn-forge-django version
as F12.14's, and on 2026-10-04 chose the shape below
and approved removing the aliases, because pykit had no live consumers.
Design
Outcome: debug_request is a public function in rn_forge.django.views, so
an application can still log a request snapshot; the DRF RequestUtils keeps
its name, because renaming it would touch every auth module for no gain; and
DRFUtils and the three get_request_* static aliases are gone, while
RequestAccessViewMixin's instance methods of the same names stay. The
rn-forge-django changelog lists each move, and the
URLs and views reference
documents debug_request.
S12.12.1 — Move debug_request and drop the aliases
State: Closed (2026-10-04)
Acceptance:
rn_forge.django.viewsdefinesdebug_request(request: HttpRequest) -> dict[str, Any]and lists it in__all__. Its output matches today'sRequestUtils.debug_request, including the redaction ofHTTP_AUTHORIZATION,HTTP_COOKIE,HTTP_SET_COOKIE,HTTP_X_API_KEYandHTTP_X_AUTH_TOKEN.index_viewanddebug_request_viewcall it, anddebug_request_view's docstring names the function.rn_forge.django.utilsno longer definesRequestUtils. Its__all__isrequire_environmentandrequire_settings, and its module docstring no longer mentions request diagnostics.rn_forge.django.drf.utilsno longer definesDRFUtils,get_request_param,get_request_dataorget_request_value.rn_forge.django.drfno longer re-exportsDRFUtils.- The
debug_requesttests move fromtests/test_utils.pytotests/test_views.py, which mirrors the module the function now lives in.tests/test_utils.pykeeps the startup-guard andModelUtilstests. - The package README describes
utilsas startup guards only, andviewsas includingdebug_request. The API reference shows oneRequestUtils. rn-forge-django'sCHANGELOG.mdhas aRemovedentry, marked breaking, that lists each row of the table in Design.- The acceptance block below passes.
set -euo pipefail
absent() { local rc=0; rg -q --hidden --glob '!.git' "$@" </dev/null || rc=$?; [ "$rc" -eq 1 ]; }
cd packages/rn-forge-django
grep -q '^def debug_request(' src/rn_forge/django/views.py
absent 'class RequestUtils' src/rn_forge/django/utils.py
absent '\bDRFUtils\b' src docs README.md
absent 'def get_request_(param|data|value)' src/rn_forge/django/drf/utils.py
test "$(rg -c 'class RequestUtils' src | wc -l | tr -d ' ')" = 1
grep -q 'debug_request' tests/test_views.py
absent 'debug_request' tests/test_utils.py
grep -qi 'breaking' CHANGELOG.md
uv run pytest -q tests/test_views.py tests/test_utils.py tests/drf tests/auth
(cd ../.. && uv run pyright packages/rn-forge-django && uv run lint-imports)
uv run --group docs mkdocs build --strict -q --site-dir "$(mktemp -d)"
Considered and rejected
- Renaming the DRF class to
DRFUtilsso it can hold more helpers. The name would encode the module's grouping, which public class names must not do, and a generalUtilsclass collects unrelated helpers instead of placing each one by what it does. A new helper goes in a module named for its job. - Keeping the Django
RequestUtilsand renaming the DRF one. This touches every auth module, the view mixins and the exception handler. A class with one static method does not need to exist. - A private
_debug_requestinviews.py. A redacted request snapshot is useful in an application's own logging, so the function stays public.