Bulk Finding Fix on Staff Views #584

Merged
tobru merged 4 commits from staff-bulk-fix-findings into main 2026-07-01 14:21:52 +00:00
Owner
No description provided.
The staff Odoo check (/staff/organizations/check-odoo/) and Kubernetes
check (/staff/instances/check-k8s/) result pages now show a "Bulk fixes"
panel that groups failing findings by check type and offers a
"Fix all (N)" button per check.

Because these apply writes to production Odoo/Kubernetes in bulk, each
button routes through a confirmation page listing the affected
organizations/instances before applying. After applying, the check is
re-run so the results reflect the post-fix state, and per-item success
and error messages are surfaced.

Bulk-safe actions mirror the org detail card's one-click set for Odoo
(recreate_*, add_portal_tag, sync_trial_window, sync_decommission_date,
sync_payment_term) and resync_instance_annotations for instances.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The instance sanity check's compute_plan_size finding now carries a
resync_compute_plan_size fix action. The handler re-applies the assigned
compute plan's CPU/memory limits and requests to the live Kubernetes
resource spec via the new ServiceInstance.resync_compute_plan_size()
method.

The action is added to the bulk-safe instance fix set, so the staff
Kubernetes check page offers a "Fix all" button for compute plan drift.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Address code review: re-verify bulk fixes before applying
All checks were successful
Tests / test (push) Successful in 1m14s
24ab467920
- Re-run the sanity check at apply time and only apply to targets that
  currently report the posted check_id + fix_action. This binds check_id
  to fix_action server-side and closes the stale-page race where a
  recreate_* action could create duplicate Odoo records on an org that
  had already been fixed.
- Reject empty target lists with HTTP 400 instead of rendering a 0-target
  confirm page / silent no-op.
- Surface a count of skipped (no-longer-failing) targets, and log apply
  failures for operators.
- Drop the dead sla_tier argument from resync_compute_plan_size; only the
  size sub-block is synced (documented inline).
- Tests: partial-failure with multiple targets, skip of non-failing
  targets, empty-pks 400, K8s apply/skip/error paths, and the
  resync_compute_plan_size missing-assignment guard.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
tobru changed title from WIP: Bulk Finding Fix on Staff Views to Bulk Finding Fix on Staff Views 2026-07-01 14:21:37 +00:00
tobru merged commit f1a3c2999b into main 2026-07-01 14:21:52 +00:00
tobru deleted branch staff-bulk-fix-findings 2026-07-01 14:21:52 +00:00
tobru referenced this pull request from a commit 2026-07-01 14:21:52 +00:00
Sign in to join this conversation.
No description provided.