fix: interpret policy InitialStart values as UTC - #64
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
InitialStartvalues are now interpreted and stored as UTC. Previously,InitialStartstrings andDateTimevalues were converted to the local time of the machine generating the migration, making snapshots and migration files timezone-dependent - teams working across time zones saw phantom policy migrations for the same instant. Now all paths normalize to UTC and render machine-independentDateTimeKind.Utcliterals. Two effects to be aware of:InitialStartstrings without a timezone suffix (andDateTimevalues withKind.Unspecified) are now interpreted as UTC instead of machine-local time. If you relied on an unsuffixed value meaning local time, append an explicit offset (e.g. +02:00) or Z to state your intent.Snapshots written by earlier versions store local wall-clock values without their originating zone. Regenerating a migration on the same machine (or timezone) that produced the snapshot upgrades seamlessly; regenerating on a machine in a different timezone produces one final
AlterXxxPolicydiff — review that the resulting UTC instant is the one you intended, after which the snapshot is UTC and permanently stable. This cross-machine case produced phantom diffs on every regeneration before this release; now it happens at most once.Type of Change
Test Plan
dotnet test)Checklist