Skip to content

docs(retention): document --days flag and add scoping tests - #1802

Merged
GauravKarakoti merged 2 commits into
GauravKarakoti:mainfrom
akira-616:docs/retention-days-flag-tests
Nov 16, 2026
Merged

GauravKarakoti merged 2 commits into
GauravKarakoti:mainfrom
akira-616:docs/retention-days-flag-tests

Conversation

@akira-616

Copy link
Copy Markdown
Contributor

Description

Follow-up to #1726 (which unified the retention/cleanup scripts into
scripts/retention.ts). That work already meets #1680's acceptance criteria;
this PR fills two small gaps I found while auditing it.

Type of Change

  • Documentation update

What Changed

  • docs/data-retention.md: document the --days=<n> flag (it was
    implemented and tested but missing from the docs), including precedence over
    the per-target env vars and DATA_RETENTION_DAYS, and its 1–3650 bounds.
  • scripts/retention.test.ts: add two CLI tests:
    • a dry run never calls any write method (updateMany / deleteMany);
    • --only=<target> restricts the run to that target and doesn't touch
      other tables.

Motivation / Background

The CLI deletes production data, so "dry run never writes" and "--only
actually scopes the run" are worth pinning with tests. Existing tests covered
argument parsing and exit codes but not these behaviours.

How to Test

  • npx vitest run scripts/retention.test.ts
  • npm run lint
  • npm run format:check

Related Issues

Related to #1680 (the consolidation itself was completed in #1726).

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have made corresponding changes to documentation (if needed)
  • I have added tests that prove my fix/feature works (if applicable)
  • New and existing tests pass locally
  • My commits follow the Conventional Commits format
  • My branch is up-to-date with main

Additional Notes

Separately, the Helm CronJob runs node /app/scripts/retention.js, which the
Dockerfile runner stage doesn't appear to ship. I'll raise that as its own
issue rather than bundle it here.

@vercel

vercel Bot commented Nov 16, 2026

Copy link
Copy Markdown

@akira-616 is attempting to deploy a commit to the Gaurav's projects Team on Vercel.

A member of the Team first needs to authorize it.

@GauravKarakoti
GauravKarakoti merged commit 043b73a into GauravKarakoti:main Nov 16, 2026
6 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants