esc back·browse·group·r random·t theme·c code
acme/webpulls#3284

Persist 1y audit-log retention on Business plan

OpenSBSean Brydonwants to merge 3 commits intomainfromfeat/audit-log
Running 1 check
Almost there — see what's left below.
2/2 approvals7/8 checksNo conflictsBranch up to date
SB

Adds 1-year retention for audit log entries on the Business plan. Closes the compliance gap flagged in #3211 — the read-side already supports per-plan retention, this PR only persists it on writes.

  • New retentionFor(plan) helper
  • Migration adds retention_days with sensible defaults
  • Backfill script in scripts/backfill-retention.ts
8 files+14218
7 of 8 checks passed
1 running · 9m 14s elapsed
  • build/web
    2m 14s
  • build/api
    1m 48s
  • test/unit
    3m 02s
  • test/e2e
    9m 14s
  • lint/tsc
    21s
  • preview/vercel
    1m 06s
  • security/snyk
    32s
  • perf/lighthouse
    running
Activity
  • Maya Okaforpushed 3 commits ·12m ago
    • f3b9a21feat(audit): persist 1y retention on Business plan
    • 12cae71Merge branch 'feat/audit-log'
    • 8a204d3fix(table): respect filter in CSV export
  • CI 7/8 checks passed in 9m 14s · 10m ago
  • JLJames Lin8m ago
    apps/api/src/audit/retention.tsline 42
    export function retentionFor(plan: Plan): number {
    if (plan === 'business') return 365
    + return RETENTION_BY_PLAN[plan] ?? DEFAULT_RETENTION
    }

    Could we extract the retention map so the api route doesn't need to know about plan tiers? Otherwise this LGTM.

  • James Linapproved this6m ago

    Resolved with the inline suggestion. Thanks!

  • Preview deploy ready in 1m 06s · audit-log-feat.preview.acme.dev5m ago
  • Maya Okaforapproved this3m ago
  • Sean Brydon marked ready for review · 2m ago