Repository navigation
feat(devex): move deletion request editing into the admin console - #130755
trunk-io[bot] merged 3 commits into
Conversation
🤖 CI report
|
|
@codex review |
|
Risk: No findings The only change since the last review is a test-only import fix (PropertyDefinition now imported from products.event_definitions) in a pytest fixture; no production code or security-relevant surface was altered. Sentinel reviewed |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
PostHog Review · Standard · reviewed 0df74e6: 2 Should fix.
See this review and its findings in PostHog Review. Comment @posthog review --deep for a Deep review. A Deep review takes longer and looks deeper than a Standard review.
Creating, editing and duplicating data deletion requests still ran through a Django admin change form with a template override, a custom ModelForm and save_model rules. That kept two findings of the no-new-custom-admin-views freeze and split one request's lifecycle between two UIs. The Django admin page is now read-only browsing; every write goes through PostHog Admin with the same audit LogEntry. - New "New deletion request" tool (Data group). Support links prefill it from the query string as before, naive datetimes read as UTC, unparseable ones dropped. The old admin add URL redirects there with its query string. - New Criteria panel on the deletion request page with "Edit criteria" (draft and pending only) and "Duplicate as a new draft". - The criteria-change rules moved from save_model to DataDeletionRequest.apply_staff_edit, and the copy rules to duplicate_as_draft, so they sit next to the model instead of in an admin class. - Property removal stays limited to the ClickHouse Team. The create form hides it from others, and both handlers refuse it, because record forms are built without the request. - An edit locks the row and re-checks the status, so a concurrent approval cannot land on criteria that just moved back to draft. - List fields compare parsed values, so a notes-only edit no longer counts as a criteria change and resets a pending request. - The inline list preview script is gone with the template; the console has no per-form scripts. Freeze findings drop from 148 to 146.
A list of (label, value) tuples is read positionally, which the devex tuple-return rule blocks for new code.
…ir checks Review found two gaps in the console editing layer: - an edit locked only the status, then saved the whole request it had read earlier, so a concurrent edit or stats fetch could be undone silently; the form now carries the request's updated_at, and the save refuses with 409 when it changed - duplicating a request copied its type with no check, so staff outside the ClickHouse Team could mint property, person or HogQL removals the create form does not offer them; duplicate now needs the group for those types
210a936 to
174ca40
Compare
|
😎 Stack merged successfully - details. |
Problem
save_modeland change form override are workflow too: an edit resets a pending request to draft and clears stats.Changes
How did you test this code?
Test rationale: the save rules are now no-database model tests. Console tests cover create, member-only types, the add URL redirect, pending reset, notes-only edits, no edit after approval, and duplicate.
Release status
Docs update
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Agent: Claude Code, claude-opus-5-5
Skills:
/extending-the-admin-console,/writing-tests,/writing-pr-descriptions,/shipping-pr-programsMore context for AI agents
type[forms.Form].DataDeletionRequest.apply_staff_edit,edit_criteriaindeletion_request_panels.py(lock and status re-check).