Skip to content
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

RUMM-2372 Adapt PokoGenerator and Session Replay models generator to new schemas #1002

Conversation

mariusc83
Copy link
Collaborator

@mariusc83 mariusc83 commented Jul 26, 2022

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-replay module.

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)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

@mariusc83 mariusc83 self-assigned this Jul 26, 2022
@mariusc83 mariusc83 force-pushed the mconstantin/rumm-2372/adapt-session-replay-schemas-generator-to-new-structure branch 2 times, most recently from 15950e3 to 1360359 Compare July 26, 2022 15:45
@xgouchet xgouchet added the size-large This PR is large sized label Jul 26, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jul 26, 2022

Codecov Report

Merging #1002 (1360359) into feature/session-replay-vo (4e78a34) will increase coverage by 0.08%.
The diff coverage is n/a.

@@                      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     
Impacted Files Coverage Δ
...tadog/android/tv/LeanbackViewAttributesProvider.kt 88.24% <0.00%> (-0.65%) ⬇️
...src/main/kotlin/com/datadog/android/DatadogSite.kt 86.67% <0.00%> (ø)
...android/rum/internal/ndk/DatadogNdkCrashHandler.kt 86.17% <0.00%> (ø)
...rc/main/java/com/datadog/opentracing/DDTracer.java 56.49% <0.00%> (+0.42%) ⬆️
...ain/java/com/datadog/opentracing/PendingTrace.java 60.34% <0.00%> (+1.72%) ⬆️
...al/persistence/file/batch/BatchFileOrchestrator.kt 94.44% <0.00%> (+1.85%) ⬆️
...rsistence/file/batch/PlainBatchFileReaderWriter.kt 88.24% <0.00%> (+1.96%) ⬆️
...tadog/android/core/internal/net/CurlInterceptor.kt 83.33% <0.00%> (+2.38%) ⬆️

@mariusc83 mariusc83 marked this pull request as ready for review July 27, 2022 07:35
@mariusc83 mariusc83 requested a review from a team as a code owner July 27, 2022 07:35
"https://github.com/DataDog/rum-events-format.git",
"schemas/session-replay/mobile",
destinationFolder = "src/main/json/schemas/session-replay/mobile",
excludedPrefixes = listOf(),
Copy link
Contributor

Choose a reason for hiding this comment

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

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(),
Copy link
Contributor

Choose a reason for hiding this comment

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

minor: same as above

@@ -27,9 +27,6 @@ class JsonSchemaReader(
fun readSchema(schemaFile: File): TypeDefinition {
logger.info("Reading schema ${schemaFile.name}")
val schema = loadSchema(schemaFile)
require(schema.type == JsonType.OBJECT) {
Copy link
Contributor

Choose a reason for hiding this comment

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

why this is removed if no changes are done to the reader logic?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok, just wanted to make sure things work as expected in the JsonSchemaReader for the schema.type != JsonType.OBJECT case

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

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.

@mariusc83 mariusc83 force-pushed the mconstantin/rumm-2372/adapt-session-replay-schemas-generator-to-new-structure branch from 1360359 to 0a1a561 Compare July 27, 2022 11:12
@mariusc83 mariusc83 merged commit 49fb615 into feature/session-replay-vo Jul 27, 2022
@mariusc83 mariusc83 deleted the mconstantin/rumm-2372/adapt-session-replay-schemas-generator-to-new-structure branch July 27, 2022 11:39
@xgouchet xgouchet added this to the internal milestone Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size-large This PR is large sized
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants