Skip to content

Use UTC for future release date #926

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

Conversation

smortex
Copy link
Contributor

@smortex smortex commented Dec 28, 2020

When using future releases, the current local date is writen in the
generated CHANGELOG. This is usualy done as part of releasing a new
version, that is a few seconds before a that version is tagged and
that tag is pushed to GitHub.

On next version bump, that previous tag exist and it's date is read from
GitHub which provide this information in Coordinated Universal Time
(UTC).

Depending on the time-zone of the user, the date of these two Ruby Time
objects may be different, leading to an unexpected change in the
previous entry of the CHANGELOG.

To avoid this, convert the local time to UTC when we do not have an
actual tag time to use.

@smortex smortex force-pushed the utc-date-for-future-release branch from 9b617c2 to 1139c1b Compare December 28, 2020 19:28
Copy link
Collaborator

@olleolleolle olleolleolle left a comment

Choose a reason for hiding this comment

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

Thanks a lot, this looks like a quality of life change!

end

it { is_expected.to eq(["2.0.0", "2.0.0", Time.gm(2020, 12, 28, 3)]) }
end
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for adding a spec, this helps catch regressions. But, perhaps a code comment, or an "it" being described with a note that captures the essence of the change (should always use UTC since GitHub uses UTC for the things we care about, etc).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

lol, I was focusing what was being tested and the reason for this has been completely lost!

I amended my commit to add a context and an explicit comment. Thanks!

Copy link
Collaborator

Choose a reason for hiding this comment

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

This looks perfect, and will guide the interested reader in the future.

Thanks, @smortex for the repairs!

@smortex smortex force-pushed the utc-date-for-future-release branch from 1139c1b to 0ed7f4c Compare December 29, 2020 07:46
When using future releases, the current local date is writen in the
generated CHANGELOG.  This is usualy done as part of releasing a new
version, that is a few seconds before a that version is tagged and
that tag is pushed to GitHub.

On next version bump, that previous tag exist and it's date is read from
GitHub which provide this information in Coordinated Universal Time
(UTC).

Depending on the time-zone of the user, the date of these two Ruby Time
objects may be different, leading to an unexpected change in the
previous entry of the CHANGELOG.

To avoid this, convert the local time to UTC when we do not have an
actual tag time to use.
@smortex smortex force-pushed the utc-date-for-future-release branch from 0ed7f4c to 2a44a8f Compare December 29, 2020 07:48
@smortex smortex requested a review from olleolleolle December 29, 2020 07:50
Copy link
Collaborator

@olleolleolle olleolleolle left a comment

Choose a reason for hiding this comment

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

LGTM!

end

it { is_expected.to eq(["2.0.0", "2.0.0", Time.gm(2020, 12, 28, 3)]) }
end
Copy link
Collaborator

Choose a reason for hiding this comment

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

This looks perfect, and will guide the interested reader in the future.

Thanks, @smortex for the repairs!

@olleolleolle olleolleolle merged commit 838655b into github-changelog-generator:master Dec 29, 2020
@smortex smortex deleted the utc-date-for-future-release branch December 29, 2020 07:57
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.

2 participants