Repository navigation
feat(deploy): run the portal retention purge as a daily CronJob - #620
Conversation
@codex review for A daily retention CronJob mirroring the migration Job from #619: image copied by kustomize replacements, migration Secret via --migration-database-projection, migration pod label, Forbid/no retries/deadline; checker, refusal tests and publication verifier. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fb647fd437
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
✅MegaLinter analysis: Success
See detailed reports in MegaLinter artifacts Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining
|
The package ships cronjob-portal-retention.yaml beside the migration Job. It runs the release's own image (kustomization.yaml copies the WebApp's pinned image into it) once a day with --retention-purge --migration-database-projection, reading the platform's migration Secret as the migration role. Its pods carry the migration Job's label, so the platform's migration network policy is their only path to the database. concurrencyPolicy Forbid, no retries, a 300-second deadline, 65532 with fsGroup 65532, a memory /tmp, no service-account token and restricted PSS, as for the migration Job. The package checker, its tests and the publication verifier admit exactly this CronJob. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex review on #620: manifest checks cannot tell whether the image accepts the arguments the package gives it. The runtime smoke test now runs the image CI builds with the rendered migration Job's and retention CronJob's arguments and no Secret mounted. Each must fail on its missing connection, not on its arguments. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fb647fd to
d483b31
Compare
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |

#616, which adds
--retention-purge, has merged, and this branch is rebased onto it. Package and image ship in the same release.The privacy notice keeps a former client's portal records for 3 years after their last membership ended (#614). #616 adds the deletion as an exclusive one-shot mode of the executable. This PR runs that mode once a day from the package, beside the portal migration Job (#619).
What changes
deploy/cronjob-portal-retention.yaml: a daily CronJob at 03:17 Copenhagen time running--retention-purge --migration-database-projection /run/portal-migration/database-url.kustomization.yamlcopies the WebApp's pinned image into it as a secondreplacementstarget.business-site-portal-db-migrationSecret (feat(business-site): give the portal migration job its own inputs platform#6372) as the migration role, mounted exactly as for the migration Job.app.kubernetes.io/name: business-site-portal-migrationlabel (plusapp.kubernetes.io/component: retention-purge). The platform's migration network policy is therefore their only path to the database, with no platform change.concurrencyPolicy: Forbid,backoffLimit: 0and a 300-second deadline. A failed run deletes nothing, and the next day's run tries again.fsGroup65532, a memory/tmp, no service-account token, and restricted PSS.scripts/check-tenant-package.mjsadmits exactly this CronJob, derived from the migration Job's pod spec, so the two cannot drift. The resource count goes to 11.scripts/tenant-package.test.mjsadds refusal cases. Each must fail:scripts/verify-runtime-publication.shadmits the new manifest member, andscripts/runtime-verification.test.shrefuses its absence or alteration.deploy/README.mdadds Portal retention purge.Flux does not health-check a CronJob, so a failed run never makes the tenant unhealthy. While a new release's migration Job has not finished, the purge's schema ownership check refuses to run.
Validation
node --test scripts/tenant-package.test.mjs: 164 pass.bash scripts/runtime-verification.test.sh: PASS.scripts/tenant-runtime-smoke.test.mjsnow runs the image CI builds with the rendered Job's and CronJob's own arguments and no Secret mounted. Each must fail on its missing connection, not on its arguments.Part of #21
🤖 Generated with Claude Code