Libra CodeHub

CedarCopilot/cedar-mail

Branch: staging

fix(ci): force TZ=UTC for the mail Jest run instead of assuming it

merged#2893CedarCopilot

CedarCopilot wants to merge 0 commits into staging from fix/mail-jest-ci-runner-tz

Live on prod, watching, 2 days leftTimeline and evidence
  1. Opened
    Sep 22, 2026, 7:30 PM
  2. Merged
    Sep 22, 2026, 7:44 PM
  3. Live on prod
    Sep 22, 2026, 7:44 PM
  4. Observed 0 hours
    Sep 22, 2026, 7:44 PM
  5. Watching

    Live on prod, watching, 2 days left

    Sep 22, 2026, 7:44 PM
  6. Pipelines steady after this deploy
    Sep 22, 2026, 7:44 PM

Behaviors Libra is checking

The main mail Jest suite runs with TZ=UTC explicitly on every configured runner, making calendar and date-sensitive tests deterministic regardless of the runner image's ambient timezone.Not checked
prod

Libra has verdicts on 0 of 1 tracked behaviors on prod; 1 is still being checked. Libra checks hourly for 3 days after each deploy.

Summary

  • test-mail's runs-on resolves to vars.RUNNER_IMAGE || 'ubuntu-latest' , a configurable custom image, not guaranteed to be GitHub's own ubuntu-latest. Every comment near this job (and the whole reason tests/timezone/ exists as a separate non-UTC pass) assumes the main "Run mail tests" step runs under UTC, without that actually being enforced.
  • That assumption is currently false for at least this runner: chatHistoryPopover.test.tsx's calendar-day bucketing test (fixed-instant fixture, clock already frozen via Jest fake timers as of #2891/staging) failed deterministically on this exact CI job on 2026-09-23, twice, ~19 minutes apart, on an unrelated PR (#2891). Locally, that same test only fails under TZ=Pacific/Auckland or TZ=Pacific/Tongatapu (UTC+12/+13) and passes under TZ=UTC / TZ=Etc/UTC , pinning the failure to the runner's ambient timezone, not test flakiness or a real product bug (the component's local-calendar-day bucketing is correct behavior for an end user's own browser).

Fix

Sets TZ: UTC explicitly as a step-level env var on "Run mail tests", rather than trying to track down which runner image needs its own default changed. The dedicated "Run mail tests (non-UTC timezone)" step two lines down is untouched , it's deliberately west of UTC for the opposite reason (catching bugs that mix a UTC calendar reading with a local one).

Test plan

  • Reproduced the failure locally with TZ=Pacific/Auckland pnpm exec jest tests/modules/chat-store/chatHistoryPopover.test.tsx and confirmed it passes under TZ=UTC / TZ=Etc/UTC with identical code.
  • This PR's own CI run should confirm "Run mail tests" passes cleanly with TZ=UTC forced (watching after open).

RetriggerConfidence Score: 5/5

The PR appears safe to merge and correctly makes the main mail test run independent of the runner image's ambient timezone.

Summary

The PR makes the main mail Jest run deterministic across configurable runner images by explicitly setting its timezone to UTC.

  • Adds a step-scoped TZ: UTC environment variable to the main mail test pass.
  • Preserves the separate non-UTC test pass and clarifies why the two timezone contexts are intentional.

Reviews (1) · Last reviewed commit: "fix(ci): force TZ=UTC for the mail Jest ..."

Show production surfaces and changed-file mapping

Production surfaces

Libra has not measured any production surfaces for this change yet.

Changed files → surfaces

  • .github/workflows/ci.ymlno production surface mapped