Skip to content

(#715) Add test for anomalous timestamp format from Projects API. #716

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

Merged
merged 2 commits into from
Sep 20, 2017

Conversation

elliott-beach
Copy link
Contributor

@elliott-beach elliott-beach commented Sep 9, 2017

This PR adds test logic verifying that timestamp strings in the "2006-01-02T15:04:05.000Z" format are converted properly into Timestamps by JSON unmarshalling.
Fixes #715.

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

LGTM.
Thank you, @e-beach!
Awaiting second LGTM before merging.

@gmlewis gmlewis added the lgtm label Sep 11, 2017
@elliott-beach
Copy link
Contributor Author

@shurcooL Any word on this? 😀

Copy link
Member

@dmitshur dmitshur left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you!

referenceUnixTimeStr = `1136214245`
emptyTimeStr = `"0001-01-01T00:00:00Z"`
referenceTimeStr = `"2006-01-02T15:04:05Z"`
referenceTimeStrFractional = `"2006-01-02T15:04:05.000Z"` // This format was returned by the Projects API before October 1, 2017.
Copy link
Member

Choose a reason for hiding this comment

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

GitHub announcement says:

Starting on Monday October 2nd, 2017

So, wouldn't it be more accurate to say this?

-before October 1, 2017.
+before October 2, 2017.

At least I parse "before day X" to mean "before and not including day X" rather than "before and also on day X".

But this is extremely insignificant.

@dmitshur dmitshur merged commit ea6e70f into google:master Sep 20, 2017
nbareil pushed a commit to nbareil/go-github that referenced this pull request May 1, 2018
This PR adds a test case verifying that timestamp strings in the
"2006-01-02T15:04:05.000Z" format are converted properly into
github.Timestamp by JSON unmarshaling.

This is related to the minor GitHub API change described at
https://developer.github.com/changes/2017-09-01-breaking-changes-to-projects-api-preview-and-webhooks-date-format/.

Fixes google#715.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants