-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Support breaking changes to the Projects API preview #715
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
Comments
But GitHub only sends at most one format at a time, never both. We can opt-in to the new format earlier by using a preview header. The date the list is when the old format will stop being available and will become the default even without the preview header. So if you want to to support old format while having the new format, we'd have to compute the old one locally. I'd prefer a more instantaneous change. People will need to change their code eventually regardless. If they want to wait, they can use an older version of go-github for a while longer. There's very little benefit in allowing people to use old format with latest version of go-github, it just delays the inevitable.
Unless I'm missing something, a breaking API change is unavoidable. The only thing we can control is whether it happens on October 1st, 2017 or sooner. |
If I understand correctly, GitHub is only changing the format of their webhook timestamps... and our API returns |
Ah, indeed. We're likely using our That's great, lucky us! :) |
Great! Please assign to me. |
Interestingly, the I'll add a unit test covering the timestamp format after the change, although, logically, it shouldn't make any difference, because all the timestamp logic is handled by the Line 458 in 12126fb
|
@e-beach You're probably already aware, but we already have some unit tests for |
I was not aware, thanks! |
The revised timestamp format is already covered by the tests in go-github/github/timestamp_test.go Lines 15 to 19 in 12126fb
Based on this, I don't believe any changes to code/tests need to be made to cover the change. We could add a test to cover the format currently returned by the Projects API, which contains milliseconds, e.g., |
Sounds good. Thanks!
That sounds like an improvement. Want to send a PR for that? Mention in the test case where the value comes from (in this case, some Projects API endpoint). |
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 #715.
I know this is a closed issue, but just for completeness, I wanted to include the latest GitHub Developer's API announcement: |
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.
GitHub Announcement:
https://developer.github.com/changes/2017-09-01-breaking-changes-to-projects-api-preview-and-webhooks-date-format/
To resolve this issue, it appears that unit tests will need to be updated for the time parsing functions that process webhook payloads. It is possible that the new format is already supported, but it is more likely that the parsing format needs to be changed slightly.
I personally think that it might be nice to support both formats (old and new) in the code base with a "TODO" to remove support for the old format once it is no longer being sent by GitHub, but this is completely up for discussion and I don't have my heart set on this. (One nice serendipity of this would be that no breaking changes would be made to the API.)
Thank you in advance for contributing to this open source project!
Your assistance is greatly appreciated.
The text was updated successfully, but these errors were encountered: