Repository navigation
docs(retention): document --days flag and add scoping tests - #1802
Merged
GauravKarakoti merged 2 commits intoNov 16, 2026
Merged
GauravKarakoti merged 2 commits into
GauravKarakoti merged 2 commits into
Conversation
|
@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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
What Changed
docs/data-retention.md: document the--days=<n>flag (it wasimplemented 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:updateMany/deleteMany);--only=<target>restricts the run to that target and doesn't touchother tables.
Motivation / Background
The CLI deletes production data, so "dry run never writes" and "
--onlyactually 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.tsnpm run lintnpm run format:checkRelated Issues
Related to #1680 (the consolidation itself was completed in #1726).
Checklist
mainAdditional Notes
Separately, the Helm CronJob runs
node /app/scripts/retention.js, which theDockerfile runner stage doesn't appear to ship. I'll raise that as its own
issue rather than bundle it here.