Repository navigation
Run CI on full matrix: ubuntu (with and without TZ), macOS and English and non-English windows - #62
jeremy-morren wants to merge 2 commits into
Conversation
80c4268 to
18378f1
Compare
|
@cursor review |
| if (failureScore < lowestFailureScore) { | ||
| lowestFailureScore = failureScore; | ||
| bestZone = candidate; | ||
| } |
There was a problem hiding this comment.
Zone guesser rejects perfect matches
Low Severity
lowestFailureScore is initialized to 30% of the instant count using integer division, and a candidate is accepted only when its failureScore is strictly less than that threshold. When there are fewer than four instants the threshold becomes 0, so a perfect match (failureScore of 0) is never accepted and the function returns null despite the documented 70% rule.
Reviewed by Cursor Bugbot for commit 18378f1. Configure here.
There was a problem hiding this comment.
Not applicable in practice. This is a line-for-line port of Noda Time's GuessZoneIdByTransitionsUncached, threshold included. The instants are every zone-interval start of every candidate over five years, which is hundreds of instants for the TZDB zones, so the threshold is never 0.
…luding non-English) On Windows, DateTimeZone.local was UTC on most systems: detection matched DateTime.timeZoneName (a Windows display name, localized on non-English Windows) against a hard-coded table of English names, and fell back to UTC. Six tests failed on Windows machines outside UTC as a result. Local zone detection now follows Noda Time, which maps .NET's TimeZoneInfo.Local.Id: - Windows: the Windows zone ID from GetDynamicTimeZoneInformation (via dart:ffi), mapped with CLDR data embedded in tzdb.bin. The ID is the same in every display language. With automatic DST adjustment turned off, the guess below is used instead. - Linux/macOS: the IANA ID found as .NET finds it: TZ (empty means UTC, ':' prefix ignored, absolute paths are zoneinfo files), else the /etc/localtime symlink target, else the zoneinfo file with the same contents. Android: persist.sys.timezone. - TZ on Windows follows Python's tzlocal and Node.js (.NET and Noda Time ignore it): an IANA ID, a Windows zone ID (mapped with CLDR) or a path to a zone file is used; empty or unrecognised values (e.g. POSIX rules) leave Windows' own zone. - Otherwise: a port of Noda Time's guess by transitions, then a fixed zone at the current offset (no longer UTC). On Windows with automatic DST adjustment off, the guess uses the zone's standard offset as Windows reports it, not Dart's DateTime (whose C runtime applies TZ). The abbreviation heuristic and its hard-coded name table are removed. Embedded CLDR Windows mapping (enabling the existing compiler port): - Check in CLDR windowsZones.xml for every version Noda Time has (21 to 49), from unicode-org/cldr release tags; the compiler picks the newest suitable file and validates it against the TZDB data. - Fix the ported CLDR parser (root element, otherVersion, splitting IDs, version from the file name) and MergeWindowsZones (identity-keyed map). - NameIdMappingSupport: Russia TZ 3/10/11 and Türkiye. Public API matching Noda Time's TzdbDateTimeZoneSource: defaultSource, tzdbVersion, canonicalIdMap, aliases, windowsMapping, windowsToTzdbIds, tzdbToWindowsIds and validate(); MapZone and WindowsZones are exported. Tests: ports of Noda Time's TzdbDateTimeZoneSourceTest, MapZoneTest, WindowsZonesTest, CldrWindowsZonesParserTest, NameIdMappingSupportTest and ProgramTest; Windows registry and local zone tests; Unix and TZ behaviour tests (including child processes with TZ set). Also: version 0.15.0 (0.14.0 is already published), with a CHANGELOG entry; require archive ^4.6.0 (XZDecoder); NOTICE references Noda Time 3.3.0, copyright to 2026. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
18378f1 to
4357689
Compare
|
@cursor review |
7a6b1f6 to
4357689
Compare
…ndows; publish test results and coverage CI only ran on Ubuntu in UTC, so it never saw platform-specific local time zone problems (such as Windows detecting UTC). Matrix legs: - Ubuntu: the /etc/localtime symlink. - Ubuntu with TZ=Australia/Sydney: the TZ environment variable, with DST. - Windows (English): the Windows zone ID mapped with CLDR, in AUS Eastern Standard Time (with DST). - Windows (non-English): W. Europe Standard Time with German display names, as on German Windows. GitHub has no non-English runners and language packs can't be installed on them in reasonable time, so the zone's display names are set with SetDynamicTimeZoneInformation; the zone ID stays English, exactly as on localized Windows. A guard test (TIME_MACHINE_EXPECT_LOCALIZED_WINDOWS=1) fails the leg if Dart doesn't report the localized names. - macOS is paused: GitHub's macOS arm64 runners are at capacity. Also runs the TZDB compiler's tests and validates the package on every leg, and publishes results with existing actions: - Each leg collects LCOV coverage (lib/ only) and JSON test results, writes a coverage summary to its job summary (ReportGenerator) and uploads them as an artifact. - A final job combines all legs: EnricoMi/publish-unit-test-result-action publishes a job summary, a "Test Results" check run and one PR comment for all platforms; ReportGenerator merges coverage into a job summary and an HTML artifact, posted as one PR comment (marocchino/sticky-pull-request-comment). Both comments are updated in place. Fork PRs get the job summaries only (read-only token). - Runs on pull requests as well as pushes. A pana job checks pub.dev platform support: it fails if pana stops reporting any of the tags for everywhere Dart runs (the six platforms, native AOT/JIT and web runtimes, WebAssembly, Dart and Flutter SDKs). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4357689 to
dfc90c7
Compare
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
1 issue from previous review remains unresolved.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit dfc90c7. Configure here.


CI only ran on Ubuntu in UTC, so it never saw platform-specific local time zone problems, such as Windows detecting UTC. This runs each way the local zone is found:
/etc/localtimesymlinkTZ=Australia/SydneyTZvariable, and a zone with DSTAUS Eastern Standard Time: the Windows ID mapped through CLDR, with DSTW. Europe Standard Timewith German display names (Mitteleuropäische Zeit)The non-English Windows leg
Install-Language de-DEhung until the 45-minute timeout, andAdd-WindowsCapabilityfor the basic language capability alone took 11.5 minutes and would still need a reboot to change the display language.SetDynamicTimeZoneInformation(.github/scripts/set-windows-time-zone-names.ps1). The zone ID, which is the registry key name, stays English, exactly as on localized Windows.DateTime.timeZoneNamethen reportsMitteleuropäische Zeit/Mitteleuropäische Sommerzeit, whileTimeZoneKeyNamestaysW. Europe Standard Time.TIME_MACHINE_EXPECT_LOCALIZED_WINDOWS=1guard test, added in the Windows PR, fails the leg if Dart doesn't report the localized names. So the leg can't silently test English.Test results and coverage
All of this uses existing actions; nothing is hand-rolled.
lib/anddart testJSON results for both the main suite and the TZDB compiler suite.danielpalme/ReportGenerator-GitHub-Action.EnricoMi/publish-unit-test-result-actionpublishes a job summary, a "Test Results" check, and one PR comment for all platforms.marocchino/sticky-pull-request-comment).lib/, higher than any single leg.Also
tool/tzdb_compiler/test) now run in CI. Previously nothing ran them.dart pub publish --dry-runruns on every leg. It passes with 0 warnings on Windows as well as Ubuntu.