Skip to content

ci/k8s: superseded-run cancellation, Stryker env cleanup, CronJobs for scheduled work - #49

Merged
MikkoNumminen merged 3 commits into
mainfrom
ci/scheduled-work-followups
Jul 24, 2026
Merged

ci/k8s: superseded-run cancellation, Stryker env cleanup, CronJobs for scheduled work#49
MikkoNumminen merged 3 commits into
mainfrom
ci/scheduled-work-followups

Conversation

@MikkoNumminen

Copy link
Copy Markdown
Owner

The three follow-ups flagged at session close, one commit each.

1. ci: cancel superseded runs on the same ref

Same shape and rationale as the mutation workflow's fix (#44): a newer push always re-validates, so finishing the older ~5-minute run only burns a runner. Applies to PR refs and main alike — on main the newest run still validates the final state.

2. ci(mutation): drop the pre-v5 env names from the Stryker step

  • MONGODB_URI — read by nothing (server tests use mongodb-memory-server)
  • NEXTAUTH_URL — legacy URL name, unused in the mutated scope
  • NEXTAUTH_SECRETTOTP_ENCRYPTION_KEY — its only real job was totpCrypto's legacy fallback; give it the dedicated name

Validated by running the Stryker-scoped suites (totpCrypto, twoFactor actions, auditHashChain — 74 tests) with all three removed vars explicitly env -u unset: green. The Stryker run on this PR is the end-to-end confirmation.

3. feat(k8s): CronJobs for the cron endpoints

The audit-outbox drain and pg-boss job drain were scheduled only on Vercel (vercel.json) — a k8s deployment had no scheduler at all, so the outbox backlog and job queue would sit undrained. Adds the k8s-native mirror:

  • raw manifests: cronjob.yaml, two CronJobs (03:00 audit drain, 03:30 job drain), POST with Bearer $(CRON_SECRET) against hrmanager-svc:3000; CRON_SECRET promoted from commented-optional to a real key in the secret template
  • Helm: templated behind cron.enabled (default false — the endpoints 401/500 without secrets.data.CRON_SECRET; set it, then --set cron.enabled=true)
  • k8s/README.md: new "Scheduled work" section

Routes verified to accept POST + the constant-time Bearer check (src/app/api/cron/*/route.ts export both GET and POST). All YAML parses (multi-doc included); hrmanager.secretName/fullname helpers and the -svc:3000 service shape confirmed against the existing chart. Full suite green through the pre-push hook (2835).

🤖 Generated with Claude Code

MikkoNumminen and others added 3 commits July 24, 2026 09:15
Same rationale as the mutation workflow (b70e515): a newer push always
re-validates, so finishing the older ~5-minute run only burns a runner.
Today's nine-PR session left a trail of completed runs for superseded pushes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
MONGODB_URI is read by nothing (server tests use mongodb-memory-server),
NEXTAUTH_URL was the legacy URL name, and NEXTAUTH_SECRET only mattered as
totpCrypto's legacy fallback — give it the dedicated TOTP_ENCRYPTION_KEY name
instead. Validated by running the Stryker-scoped suites (totpCrypto,
twoFactor actions, auditHashChain — 74 tests) with all three removed vars
explicitly unset: green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The audit-outbox drain and pg-boss job drain only ran on Vercel (vercel.json
crons) — a k8s deployment had no scheduler at all, so the outbox backlog and
job queue would sit undrained. Add the k8s-native mirror: two CronJobs (raw
manifests; Helm behind cron.enabled, off by default until CRON_SECRET is
set), POSTing with the Bearer secret to the same routes. CRON_SECRET moves
from commented-optional to a real key in the raw secret template since
cronjob.yaml consumes it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
hr-manager Ignored Ignored Jul 24, 2026 6:20am

@MikkoNumminen
MikkoNumminen merged commit 68f28aa into main Jul 24, 2026
4 checks passed
@github-actions

Copy link
Copy Markdown

Mutation Testing

Score: 70.95% (break threshold 60% — ✅ pass). 320 detected / 451 valid mutants (killed 192, timeout 128, survived 30, no-coverage 101). Full report.

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