Add jobs/station-signup-attempt-prune for 30-day signup-attempt retention - #2374
Merged
Merged
Conversation
…tion station_signup_attempt grows without bound. Add a daily cron job workspace, following the jobs/flowsheet-ghost-row-sweep template, that deletes attempt rows older than the 30-day audit window via the already-exported pruneSignupAttempts. Split from jobs/station-signup-review since the failure consequences differ enough to want separate alerting: a failed prune just grows a table, a failed review is a silent security gap. Registers the job in docs/ops-cron-scheduling.md's DB-only section (it never calls @wxyc/lml-client) and pins the 30-day retention boundary with an integration test against real Postgres. Closes #2363
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.
Summary
station_signup_attemptgrows without bound. This adds ajobs/station-signup-attempt-pruneworkspace, following thejobs/flowsheet-ghost-row-sweeptemplate, that deletes attempt rows older than the 30-day audit window via the already-exportedpruneSignupAttempts(shared/authentication/src/station-passcode.ts).job.tsis a thin lifecycle wrapper callingpruneSignupAttempts()with its default 30-day retention, logging the deleted-row count.jobs/*packaging:package.json,tsconfig.json,tsup.config.ts,logger.ts,README.md.Dockerfile.station-signup-attempt-prune; deploy wiring is automatic (deploy-base.ymldiscovers jobs by directory +job-typeinpackage.json).docs/ops-cron-scheduling.md's "Excluded / DB-only" section, not the LML slot table — this job never calls@wxyc/lml-client.jobs/station-signup-reviewbecause the failure consequences differ: a failed prune just grows a table, a failed review is a silent security gap, and those want separate alerting.Test plan
tests/integration/station-signup-attempt-prune.spec.jspins the 30-day retention boundary against real Postgres: a row exactly at the cutoff survives, a row 1 second older is deleted, and an all-fresh cohort is a no-op.npm run typecheck --workspace=jobs/station-signup-attempt-prunenpm run lint/npm run format:check(repo-wide, clean)npm run test:unit(531 suites / 9406 tests, all passing).github/workflows/test.yml, mirroring the siblingstation-signup-reviewstep.Closes #2363