-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add specification packages #78
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #78 +/- ##
==========================================
- Coverage 80.05% 79.94% -0.12%
==========================================
Files 46 48 +2
Lines 3164 3291 +127
==========================================
+ Hits 2533 2631 +98
- Misses 524 552 +28
- Partials 107 108 +1 ☔ View full report in Codecov by Sentry. |
59b4477
to
ef7a8ca
Compare
Add a go package that holds an unversioned alias of the API for creating events. This let user import the versioned package and have access to a simpler API which picks the right version of each event based on the spec version. There is still work to be done to support multiple versions, as the context may vary across versions, which is not yet handled. Signed-off-by: Andrea Frittoli <andrea.frittoli@gmail.com>
Add the spec version to the event contructors. Use the constructors aliases in docs.go to pass the correct version of the spec directly. Extend the parsing API with generics, so that it may take the type of context as input. For now, the only type available is Context, but once we do breaking changes to the spec, there will be more than one version of Context, and the parsing method will need to take a version specific context type. Change the context.type from String to CDEventsType and define custom JSON marshaller and unmarshaller to keep the error handling logic in the correct place in the code and simplify the code in general. Signed-off-by: Andrea Frittoli <andrea.frittoli@gmail.com>
Make the test events part of a test spec version. Move parsing functions to spec specific packages where needed. Signed-off-by: Andrea Frittoli <andrea.frittoli@gmail.com>
Signed-off-by: Andrea Frittoli <andrea.frittoli@gmail.com>
Use a bit of template logic to reduce the number of templates. Add no-build tags to the test SDK files. Signed-off-by: Andrea Frittoli <andrea.frittoli@gmail.com>
Signed-off-by: Andrea Frittoli <andrea.frittoli@gmail.com>
Signed-off-by: Andrea Frittoli <andrea.frittoli@gmail.com>
Signed-off-by: Andrea Frittoli <andrea.frittoli@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add a go package that holds an unversioned alias of the API for creating events. This let user import the versioned package and have access to a simpler API which picks the right version of each event based on the spec version.
There is still work to be done to support multiple versions, as the context may vary across versions, which is not yet handled.