RUMM-2372 Adapt PokoGenerator and Session Replay models generator to new schemas#1002
Conversation
15950e3 to
1360359
Compare
Codecov Report
@@ Coverage Diff @@
## feature/session-replay-vo #1002 +/- ##
=============================================================
+ Coverage 82.81% 82.89% +0.08%
=============================================================
Files 306 306
Lines 9853 9852 -1
Branches 1616 1615 -1
=============================================================
+ Hits 8159 8166 +7
+ Misses 1190 1186 -4
+ Partials 504 500 -4
|
| "https://github.com/DataDog/rum-events-format.git", | ||
| "schemas/session-replay/mobile", | ||
| destinationFolder = "src/main/json/schemas/session-replay/mobile", | ||
| excludedPrefixes = listOf(), |
There was a problem hiding this comment.
minor: default value is emptyList() anyway, so there is no need to specify this parameter explicitly
| "https://github.com/DataDog/rum-events-format.git", | ||
| "schemas/session-replay/common", | ||
| destinationFolder = "src/main/json/schemas/session-replay/common", | ||
| excludedPrefixes = listOf(), |
| fun readSchema(schemaFile: File): TypeDefinition { | ||
| logger.info("Reading schema ${schemaFile.name}") | ||
| val schema = loadSchema(schemaFile) | ||
| require(schema.type == JsonType.OBJECT) { |
There was a problem hiding this comment.
why this is removed if no changes are done to the reader logic?
There was a problem hiding this comment.
is to support the special case I added in the tests. Is because the browser team needed this in the schemas and we are sharing that with them.
There was a problem hiding this comment.
ok, just wanted to make sure things work as expected in the JsonSchemaReader for the schema.type != JsonType.OBJECT case
There was a problem hiding this comment.
Yes, apparently they work, I still need to ask Xavier why he added this there in the first place. Maybe it was a constraint in the beginning.
1360359 to
0a1a561
Compare
What does this PR do?
The Session Replay schemas structure was modified in order to support also the browser events format.
We had to adapt our PokoGenerator to support a root schema for which the type is resolved from a referenced schema.
We also had to change/adapt our models generator Gradle tasks in the
dd-sdk-android-session-replaymodule.Motivation
What inspired you to submit this pull request?
Additional Notes
Anything else we should know when reviewing?
Review checklist (to be filled by reviewers)