Skip to content

chore(dashboard): add retention period helper to audit logs - #564

Merged
SantiagoDePolonia merged 1 commit into
mainfrom
chore/add-a-helper-for-retention
Jul 20, 2026
Merged

chore(dashboard): add retention period helper to audit logs#564
SantiagoDePolonia merged 1 commit into
mainfrom
chore/add-a-helper-for-retention

Conversation

@SantiagoDePolonia

@SantiagoDePolonia SantiagoDePolonia commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add an inline help toggle (?) next to the audit log retention note explaining how to change the retention period (LOGGING_RETENTION_DAYS env var or logging.retention_days in config.yaml, restart required).
  • Highlight the retention duration (e.g. 30 days) within the note for quicker scanning.

Test plan

  • node --test *.test.cjs in internal/admin/dashboard/static/js/modules — 484 passed

Summary by CodeRabbit

  • New Features

    • Improved the Audit Logs retention message with clearer formatting and highlighted retention durations.
    • Added inline help controls and expandable guidance for audit log retention settings.
    • Retention messaging now clearly indicates when logs are kept indefinitely.
  • Bug Fixes

    • Standardized retention-value validation for more consistent display across the Audit Logs page.

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3a239c7c-7464-49b3-bb1f-d4ba014ec64b

📥 Commits

Reviewing files that changed from the base of the PR and between 9de5927 and abb69cc.

📒 Files selected for processing (5)
  • internal/admin/dashboard/static/css/dashboard.css
  • internal/admin/dashboard/static/js/modules/audit-list.js
  • internal/admin/dashboard/static/js/modules/audit-list.test.cjs
  • internal/admin/dashboard/static/js/modules/dashboard-layout.test.cjs
  • internal/admin/dashboard/templates/page-audit-logs.html

📝 Walkthrough

Walkthrough

The audit log retention display now centralizes retention-day validation, separates prefix and highlighted text, and renders configurable inline help with updated styling and coverage.

Changes

Audit retention help

Layer / File(s) Summary
Centralize retention parsing and text helpers
internal/admin/dashboard/static/js/modules/audit-list.js, internal/admin/dashboard/static/js/modules/audit-list.test.cjs
Retention values are validated through _auditRetentionDays(), while prefix and highlighted retention text handle finite, indefinite, and invalid values.
Render the inline retention help UI
internal/admin/dashboard/templates/page-audit-logs.html, internal/admin/dashboard/static/css/dashboard.css, internal/admin/dashboard/static/js/modules/dashboard-layout.test.cjs
The audit header renders Alpine-based inline help with highlighted retention text and corresponding CSS and layout assertions.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • ENTERPILOT/GoModel#561: Adds the audit-log retention behavior that this change refactors and expands in the UI.

Poem

A rabbit hops through logs of old,
With retention tales in text retold.
Bold days shine and help unfolds,
“Indefinitely!” the bunny scolds.
One neat helper keeps the count,
While inline hints make clarity mount.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main change: adding retention-period helper UI and logic for audit logs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/add-a-helper-for-retention

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

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Jul 20, 2026

Copy link
Copy Markdown

Confidence Score: 5/5

Safe to merge with minimal risk.

The change is limited to dashboard display helpers, template markup, CSS, and matching tests. No functional, security, or accessibility issues were identified in the changed paths.

No files require special attention.

T-Rex T-Rex Logs

What T-Rex did

  • The dashboard JS Node test suite was executed and a detailed proof log was saved, capturing the exact command, Node version, and the full node --test output.
  • The run completed with exit code 0, confirming the tests finished successfully.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (1): Last reviewed commit: "chore: added a helper for retention peri..." | Re-trigger Greptile

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@SantiagoDePolonia
SantiagoDePolonia merged commit 56b14d1 into main Jul 20, 2026
20 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.

2 participants