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.
Wanted to make a pr to add some missing installation.id s to the some of the payloads but got sucked into a rabbit hole...
This PR contains a tests that Deserializes the test payloads and Serializes it again, effectively checking finding missing properties in the structs (and the test data).
These tests now fail for now.
I noticed that the test data is pretty old and incomplete. So i added a simple scraper that fetches all the example payloads from https://developer..com/v3/activity/events/types/
Most example payloads dont contain the part containing installation id:
but my undestanding is that they are present in most payloads? (at least the ones I've seen). The scraper adds this to all payloads except a few selected ones.
(the test data is in
./tmp
for now).Im happy to start making the tests pass (even more happy if someone wants to help).
But want to touch base here before i spend more time on it.
Having these tests also enable us to refactor the huge
payloads.go
file. by creating named structs for things likeRepository
Owner
etc. which makes it easier to create mock payloads for testing applications using this library.to run the tests you need to install
.com/josephburnett/jd/lib
the scraper depends on
.com/gocolly/colly
to run the scaper:
go run scrape/.go
@deankarn