Skip to content

feat: clear remediation activity without losing queued or held work - #66

Merged
ktechmidas merged 1 commit into
masterfrom
fix/remediation-activity-history
Nov 15, 2026
Merged

ktechmidas merged 1 commit into
masterfrom
fix/remediation-activity-history

Conversation

@ktechmidas

@ktechmidas ktechmidas commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add an administrator-only, CSRF-protected Clear activity control. Store a display revision boundary without changing incident status, revision counters, queues, receipts or locks. New events return normally; queued and active/held work cannot be hidden.
  • Retain queued and active cases beyond the broker history cap. Report authoritative receiver queue totals to administrators, without exposing private network counts publicly.
  • Limit the truncated-history warning to displayed cases whose worker details are actually missing.

Verification

  • Focused control/history/web tests pass on the integrated live-base candidate and this upstream branch.
  • Broker tests cover queued/held records beyond the 1,000-case boundary.
  • Desktop/mobile authenticated fixtures exercise history clearing, preserve held visibility and report no browser errors.
  • Immutable live-base web overlay preserves existing integrations and non-root/read-only runtime configuration; no monitoring-node or executor change.

This is presentation control, not incident resolution or permission to stop active repairs. Operational cleanup of an abandoned historical attempt is separately audited and is not automated by this change.

Summary by CodeRabbit

  • New Features
    • Administrators can clear remediation activity history from the remediation page. The page shows when activity was cleared and how many older entries are hidden.
  • Bug Fixes
    • Queued and active issues remain visible even when they fall outside the recent-case window. Clearing activity also keeps queued and active repairs visible, while new events continue to appear.
    • Full remediation views report queued-event totals even when the case list is truncated.

@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

The broker retains issues with queued or active work beyond the recent-case limit. The remediation server adds activity-history clearing and visibility rules, and the page adds an administrator control to clear activity.

Changes: Remediation visibility

Layer / File(s) Summary
Retain cases with current work
deploy/incident-broker/broker.py, deploy/incident-broker/test_broker.py
The remediation snapshot retains issues with running, uncertain, or queued work alongside the 1,000 most recent cases. The test checks that queued and uncertain issues remain visible beyond that limit.
Store activity history and apply visibility rules
server/remediation-activity.js, server/remediation.js, server/remediation-activity.test.js
The server validates and writes activity history with issue revisions. Remediation views hide eligible unchanged issues, report activity-history details, and use the receiver’s queued total for full views when available. Tests cover clearing, visibility, malformed history, and queued totals.
Expose activity clearing to administrators
server/web.js, server/web.test.js, src/pages/Remediation.jsx
An admin-only endpoint clears activity history and pushes a remediation update. The page adds a confirmation-based clear action and reports the clear time and hidden-entry count. Tests check authorization and preservation of incident and control state.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  actor Administrator
  participant RemediationPage
  participant web.js
  participant clearActivity
  participant ActivityRecord
  Administrator->>RemediationPage: Confirm activity clear
  RemediationPage->>web.js: POST /api/remediation/activity/clear
  web.js->>clearActivity: Clear history for current incident state
  clearActivity->>ActivityRecord: Atomically write history record
  web.js->>web.js: Push remediation update
  web.js-->>RemediationPage: Return activity history
Loading
Merge Risk: Low · up to e9586

Clearing activity history can hide a case that is still held by a maintenance window until its next incident revision. Operators lose visibility of that hold but no repair or queue state changes. The fix is small and the overall merge risk is low.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@ktechmidas
ktechmidas merged commit b1629d3 into master Nov 15, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant