fix(scripts): compute nightly-audit 24h window in UTC - #643
JakubAnderwald wants to merge 1 commit into
Conversation
The YESTERDAY cutoff was built in local time but compared as a string against GitHub's UTC createdAt/mergedAt, so on the CET/CEST Mac mini the audit silently dropped the first 1-2 hours of its 24h window. Pass -u to both the BSD (-v) and GNU (-d) date branches, and add a regression test that asserts -u on every date invocation and evaluates the line under a non-UTC TZ. Closes #511 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Warning Review limit reachedNext included review available in 45 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository: JakubAnderwald/drafto/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Factory code reviewNo findings — the change matches the approved plan and fixes the window correctly.
What I checked:
|
CodeRabbit CLI review —
|
Closes #511
Summary
scripts/nightly-audit.shbuilt its "24 hours ago" cutoff in local time. It then compared that cutoff as a string against GitHub's UTCcreatedAt/mergedAt. On the Mac mini (CET/CEST) the cutoff ran 1–2h ahead of UTC, so the audit silently dropped the first 1–2 hours of its window. That affected support-issue attachment-failure detection and the post-merge main-CI check. Bothdatebranches on theYESTERDAY=line (BSD-v-24Hand the GNU-d '24 hours ago'fallback) now pass-u, as the approved plan specified. The suffix-less%Y-%m-%dT%H:%M:%Sformat is kept. It is a prefix of GitHub's Z-suffixed form, so the jq>=filters needed no change.Parity report
parity:infra-only: no app platform is affected. The diff stays entirely underscripts/; nothing inapps/**orpackages/shared/**changed.scripts/nightly-audit.sh(cutoff computation) ✅scripts/__tests__/nightly-audit-window.test.mjs(regression guard) ✅Test plan
bash -n scripts/nightly-audit.sh: passednode --test scripts/__tests__/nightly-audit-window.test.mjs: 3/3 passed-uis removed from both branches, only the GNU branch, or only the macOS branch, and when aTZ=UTCprefix replaces-upnpm format:check: passedcd scripts && pnpm test: 1691/1694 passed. The 3 failures are infactory-agent-intest.test.mjs→intest_check_lane_outcomes (extracted, real bash). They are the tests that assert a process holding a lane log gets killed (HELD_DEADexpected). They fail the same way on a cleangit archive HEADexport ofmain(d2b0957), so they were already failing in this environment and are not caused by this change. They don't readnightly-audit.sh.pnpm migration:check: no schema changespnpm lint/pnpm typecheck: no app or package code touchedDrift vs. approved plan
Only the two files the plan listed were touched. The new test has the text-level checks the plan asked for:
YESTERDAY=assignment;dateinvocations on it, each carrying a standalone-u;dateon the line is one the parser captured, so adatein an unexpected position fails loudly.One addition beyond the plan, in the same file: a behavioural check. It runs the real
YESTERDAY=line under a non-UTC POSIX TZ (XYZ-05:45, so it doesn't depend on tzdata) and asserts three things:%Y-%m-%dT%H:%M:%Sshape;On CI (ubuntu) this also exercises the GNU fallback branch, which the Mac mini never takes.
🤖 Generated by the dark factory (approved plan)
🤖 Generated with Claude Code