Skip to content

Add Purge Now action to Manage Servers (closes #900)#901

Merged
erikdarlingdata merged 1 commit intodevfrom
feature/900-purge-now-and-manage-servers-context-menu
Apr 28, 2026
Merged

Add Purge Now action to Manage Servers (closes #900)#901
erikdarlingdata merged 1 commit intodevfrom
feature/900-purge-now-and-manage-servers-context-menu

Conversation

@erikdarlingdata
Copy link
Copy Markdown
Owner

Summary

  • Adds a Purge Now button to the Manage Servers window with a confirm dialog and mode picker (Use configured / 1 / 3 / 7 / Custom / All).
  • Right-click menu on the Manage Servers grid now mirrors every per-row action (Edit, Toggle Favorite, Check Server Version, Purge Now, Remove) above the existing Copy/Export items.
  • Reworks config.data_retention semantics so @retention_days does what users expect from the UI:
    • NULL (default) — respect per-collector retention from config.collection_schedule, 30-day fallback for unscheduled tables.
    • 0 — TRUNCATE every collect.* table.
    • N > 0 — override every table's cutoff to N days, ignoring per-collector schedule.
  • The old @truncate_all parameter was removed; @retention_days = 0 covers that case with cleaner semantics.
  • Truncate path snapshots SUM(partition.rows) before wiping so the result message can show "Rows wiped: 914,983" instead of "Rows wiped: 0".

Test plan

  • EXEC config.data_retention (NULL) on sql2019 → uses schedule, deletes 0 rows when nothing is older than 30 days.
  • EXEC config.data_retention @retention_days = 5 on sql2019 → deleted 184,481 rows (override skipped the schedule pass).
  • EXEC config.data_retention @retention_days = 0 on sql2019 → 914,983 rows wiped, 52 tables truncated, 31ms; log row records both counts.
  • FK / schema-bound / indexed-view check on sql2016 — none reference collect.*, TRUNCATE is safe.
  • Updated proc applied and smoke-tested on sql2016, sql2017, sql2019, sql2022, sql2025.
  • Dashboard build clean; UI tested manually for all dialog modes including the second confirm on All.
  • Manual test on a fresh installer run to verify no proc-deployment regression.

Closes #900.

- New "Purge Now" button on Manage Servers window with override modes
  (configured / 1 / 3 / 7 / custom / all). All option uses TRUNCATE.
- Right-click menu now mirrors all per-row actions (Edit, Toggle Favorite,
  Check Server Version, Purge Now, Remove) above existing copy/export.
- config.data_retention reworked: @retention_days = NULL respects per-collector
  schedule, 0 TRUNCATEs every collect.* table, N > 0 overrides every cutoff
  to N days. Old @truncate_all parameter removed; @retention_days = 0 covers
  that case. Truncate path snapshots row count before wiping for reporting.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@erikdarlingdata erikdarlingdata merged commit 8d3ca32 into dev Apr 28, 2026
7 checks passed
@erikdarlingdata erikdarlingdata deleted the feature/900-purge-now-and-manage-servers-context-menu branch April 28, 2026 00:12
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