Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timeutil: sort timezones #60704

Merged
merged 1 commit into from
Feb 18, 2021
Merged

timeutil: sort timezones #60704

merged 1 commit into from
Feb 18, 2021

Conversation

mneverov
Copy link
Contributor

Previously, timezones in the generated file were not sorted. That led to
the file being changed greatly when Go version was updated, or even
within the same Go version when /usr/local/go/lib/time/zoneinfo.zip was
regenerated from different time zone releases:
https://data.iana.org/time-zones/releases
This patch sorts timezones before writing them down so the changes in
the file are minimal and only reflect the actual change in the
timezones.

Release note: None

Previously, timezones in the generated file were not sorted. That led to
the file being changed greatly when Go version was updated, or even
within the same Go version when /usr/local/go/lib/time/zoneinfo.zip was
regenerated from different time zone releases:
https://data.iana.org/time-zones/releases
This patch sorts timezones before writing them down so the changes in
the file are minimal and only reflect the actual change in the
timezones.

Release note: None
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@otan otan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!
bors r+

@craig
Copy link
Contributor

craig bot commented Feb 18, 2021

Build failed (retrying...):

@mneverov
Copy link
Contributor Author

Hi @otan, thanks for the review.
I have a second thought about this. I did not only add sort, but regenerated the file with the newest timezone release (which is https://data.iana.org/time-zones/releases/ tzdb-2021a.tar.lz).
I think after this change all the CRDB contributors will have lowercase_timezones.go changed every time they use make generate until they update the Go zoneinfo.zip manually, or update to the newest go version. That was a mistake to do the sorting now, I think it is better to do that together with the Go version update.
Sorry about this!

@otan
Copy link
Contributor

otan commented Feb 18, 2021

bors r-

@craig
Copy link
Contributor

craig bot commented Feb 18, 2021

Canceled.

@otan
Copy link
Contributor

otan commented Feb 18, 2021

Hmm, it seems as if it still passes CI so maybe there are no new timezones in go 1.16?

@otan
Copy link
Contributor

otan commented Feb 18, 2021

CI will automatically check that the generated file in go 1.15 is up to date, so it looks like it is?

@otan otan self-requested a review February 18, 2021 05:49
Copy link
Contributor Author

@mneverov mneverov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see one new release from 2021-01-24. I'll compare the timezones

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @otan)

Copy link
Contributor Author

@mneverov mneverov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I compared timezones in go 1.15 (2020a) and go 1.16 (2021a).
Release notes for the changes can be found here https://mm.icann.org/pipermail/tz-announce/.
You're right, no new timezones added, generated lowercase_timezones is the same except the order. Sorry about the confusion 🤦

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @otan)

@otan
Copy link
Contributor

otan commented Feb 18, 2021 via email

@craig
Copy link
Contributor

craig bot commented Feb 18, 2021

Build succeeded:

@craig craig bot merged commit c76fe62 into cockroachdb:master Feb 18, 2021
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.

3 participants