Skip to content

ops: retention cron dry-run and backup runbook (#86) - #320

Merged
unjica merged 3 commits into
developfrom
ops/86-retention-cron-backups
Jul 9, 2026
Merged

unjica merged 3 commits into
developfrom
ops/86-retention-cron-backups

Conversation

@unjica

@unjica unjica commented Jul 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Add --dry-run / --help to the retention CLI so operators can verify sweeps locally without deleting data
  • Expand docs/RAILWAY.md with step-by-step Railway cron setup and Postgres backup/restore procedures
  • Link production-readiness checklist items to the new runbook

Part of #86 — merge after review; close the issue only after manual Railway steps below are done.

Issue #86 checklist

Repo (this PR)

  • Retention job implementation exists (run-retention.ts → node dist/jobs/run-retention.js)
  • Document Railway cron service setup (root dir, start command, schedule, DATABASE_URL)
  • Document backup verification and restore procedure (pg_dump, PITR, restore drill)
  • Add local verification via pnpm --filter api retention -- --dry-run
  • Unit tests for dry-run mode

Manual Railway (operator — not automatable in repo)

  • Add cron service: root apps/api, start node dist/jobs/run-retention.js, schedule 0 3 * * *
  • Share DATABASE_URL with cron service (same as API)
  • Deploy and Run now; confirm logs show {"ok":true,"dryRun":false,"projectsProcessed":…} and deployment exits
  • Confirm Postgres Backups tab shows automated backups enabled (enable PITR if on plan)
  • Perform one restore drill to a separate service (see RAILWAY.md → PostgreSQL backups and restore)

Test plan

  • pnpm lint
  • pnpm test
  • pnpm build
  • pnpm --filter api retention -- --help
  • pnpm --filter api retention -- --dry-run against dev Postgres (requires docker compose up -d)

unjica and others added 3 commits July 9, 2026 19:26
Finalize CHANGELOG for patch release; build-time /health version no longer needs TELEMETRY_API_VERSION on Railway.

Co-authored-by: Cursor <[email protected]>
Document step-by-step Railway cron setup and Postgres backup/restore, and add --dry-run to the retention CLI so operators can verify sweeps locally without deleting data.

Co-authored-by: Cursor <[email protected]>
@unjica
unjica merged commit bc26a93 into develop Jul 9, 2026
4 checks passed
@unjica
unjica deleted the ops/86-retention-cron-backups branch July 9, 2026 18:07
unjica added a commit to Dari0o/telemetry-tracker that referenced this pull request Jul 9, 2026
Retention dry-run CLI and Railway backup/cron runbook from PR Telemetry-Tracker#320 (Telemetry-Tracker#86).

Co-authored-by: Cursor <[email protected]>
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