feat/wave-12-bulk-users #4
Reference in New Issue
Block a user
No description provided.
Delete Branch "feat/wave-12-bulk-users"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Wave 12 — CR-020: Bulk editing of users
Decision record:
docs/waves/decisions-2026-09-17.md(CR-020; open details confirmed 2026-10-06).Task breakdown and verification record:
docs/waves/wave-12.md.Built on
main. Carries only the wave 12 plan fromfeat/waves-11-13: no wave 11 code, no T13.1.Changes
POST /api/auth/bulk-users/{active,role,projects,delete}. Each row runs the same guards and audit as the single-user route; the rules now live once (guard_target,apply_user_*), and the single-user routes call them too. A refused row is reported with its reason; the rest still run. OneAuditLogrow per changed account.DELETEis typed.browser_check.pyre-pointed (see below).Decisions applied (confirmed by Matt, 2026-10-06)
DELETE, whatever the count.unchangedand writes no audit row.Verification
tests/bulk_users_check.py(new, no browser): 61/61. Againstmain: every bulk check fails, the 7 single-route checks pass.tests/bulk_users_ui_check.py(new, browser): 19/19.console_dialogs_check.py16/16 (new section 4: bulk delete prompt).mobile_check.py24/24.a11y_check.py22/22.browser_check.pyall pass.server/smoketest.py27/27;server/seed_demo.pyruns.docs/reference/baseline/wave-12/at 1440px and 390px.Review notes
browser_check.pywas re-pointed, not loosened: it asserted column positions (9 columns;cells[3]and[4]). The new selection column comes first, so it now expects 10 columns and finds cells by header name.tests/cdp.pyhas the same change as wave 16 (identical content, merges cleanly).POST /api/auth/bulk-users/{active,role,projects,delete} take a list of user ids (max 500) and run each row through the same guards and audit as the single-user route: the rules now live once, in guard_target and apply_user_{active,role,delete,projects}, which the single-user routes call too. - A refused row is reported with its reason; the rest still run; the response counts ok / unchanged / failed. Never a blanket success. - The caller's own account is refused only on its own row. - One AuditLog row per changed account, same action and shape as the single route. A row already in the requested state is 'unchanged' and writes no audit row. - Project assignment is add/remove to ONE project with a per-project role (confirmed 2026-10-06); roles on the user's other projects are carried over as stored. - Routes sit under /api/auth/bulk-users/ because /api/auth/users/bulk/ would match {user_id}='bulk'. New tests/bulk_users_check.py (no browser): 47/47. Against main: the 7 single-route checks pass, every bulk check fails. Single-user routes compared before/after on 16 calls (200/400/403/404): identical responses, audit rows and memberships. Smoke test 27/27.POST /api/auth/bulk-users/resolve reads a list of usernames (first column; comma, semicolon or tab; header skipped) and answers line by line, the CR-005 validate-and-report pattern. A line is rejected, with its number and reason, when it names nobody the caller can see ('User not found', as everywhere else), an account they may not change (the single route's own reason), their own account, or a username already listed (duplicate of line N). An email address resolves only when exactly one account has it. Nothing is changed by this route. The console's 'Select from CSV' turns the accepted accounts into the ordinary selection (filter reset so every selected row is visible) and lists every rejected line. The action, confirm and per-row report are the checkbox ones, through the same T12.1 routes, which re-check each row: a CSV cannot reach an account a checkbox could not. Usernames only, action in the toolbar (decided 2026-10-06). Files over 1 MB are refused before upload; FileReader fallback for browsers without Blob.text(). bulk_users_check.py: 61/61. DOM harness: 40/40.