Skip to content

Make the rule engine and its tests independent of the process TZ - #121

Open
Portals wants to merge 2 commits into
mainfrom
fix/tz-independent-tests
Open

Portals wants to merge 2 commits into
mainfrom
fix/tz-independent-tests

Conversation

@Portals

@Portals Portals commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

pnpm test failed with 12 failures under any negative UTC offset (for example TZ=America/Chicago) because the rule engine used process-local Date methods while its fixtures were built from zone-less date strings, and the frontend out-of-range picker test used an instant that is in range in such zones. The rule engine now expands rules in Europe/Stockholm wall-clock time through a small Intl-based helper that resolves DST gaps and overlaps the same way V8 does for a process running in that zone, so production behaviour on a server with TZ=Europe/Stockholm is unchanged (checked with a differential sweep of the old and new code). The fixtures now use explicit offsets and instants outside the picker range at any offset, and the suite passes under TZ=UTC, Europe/Stockholm, America/Chicago, Pacific/Kiritimati and with TZ unset, with no TZ pin in the vitest config.

The second commit resolves the four dependency advisories that made the CI audit step fail for any PR opened now: follow-redirects and joi are bumped to their patched releases in the lockfile, and the dev-only glob and minimatch advisories reachable through testcontainers are ignored the same way as the existing braces one.

🤖 Generated with Claude Code

Portals and others added 2 commits November 6, 2026 21:43
The rule engine used process-local Date methods and the test fixtures
used zone-less date strings, so pnpm test failed under any negative UTC
offset. Rules are now expanded in Europe/Stockholm wall-clock time
through a small Intl-based helper that resolves DST gaps and overlaps
the same way V8 does for a process running in that zone, so a server
with TZ=Europe/Stockholm behaves exactly as before. The fixtures carry
explicit offsets, and the frontend out-of-range picker fixture uses
instants that fall outside the picker range at any UTC offset.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
follow-redirects and joi move to their patched releases within the
ranges axios and express-openid-connect already declare. The glob and
minimatch advisories are only reachable through archiver-utils in the
testcontainers tooling for the e2e suite and have no patched release
within its ranges, so they are ignored like the existing braces one.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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