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

chore: Update RUM models to fix webview integration tests #1643

Merged

Conversation

ncreated
Copy link
Member

@ncreated ncreated commented Jan 22, 2024

What and why?

🧰 Fixes the impact of recent update in rum-events-format: DataDog/rum-events-format#177. The PR to Browser RUM schema has changed optionality of the RUMConnectivity.interfaces field (non-optional → optional) breaking decoding of browser events in our WebView integration tests:

failed - keyNotFound(CodingKeys(stringValue: "interfaces", intValue: nil), Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "connectivity", intValue: nil)], debugDescription: "No value associated with key CodingKeys(stringValue: \"interfaces\", intValue: nil) (\"interfaces\").", underlyingError: nil)):

How?

I updated RUM models to the new commit in rum-events-format, so we use recent schema for decoding Browser events.

This comes along with 2 changes to rum-models-generator after DataDog/rum-events-format#177:

  • That PR added an enum with case names starting with digits (Connectivity → Effective Type: "2G", "3G", "4G"). Because enum cases in Swift cannot start with digit, the generator now sanitizes them by adding a prefix (the name of the enumeration).
  • That PR also changed interfaces: [Interfaces] to be optional (interfaces: [Interfaces]?). Because one of the cases in Interfaces enum is named "none", this caused compiler ambiguity with Optional<Interfaces>.none. To avoid this, in such situation the generator also uses the prefix (<enumName>None).

🎁 As a bonus, I added an option to the make command so we can now generate RUM and SR models for a certain commit of the rum-events-format repo, e.g.:

make rum-models-generate git_ref=389581be98dcf8efbfcfe7bffaa32d53f960fb6f

Review checklist

  • Feature or bugfix MUST have appropriate tests (unit, integration)
  • Make sure each commit and the PR mention the Issue number or JIRA reference
  • Add CHANGELOG entry for user facing changes

Custom CI job configuration (optional)

  • Run unit tests for Core, RUM, Trace, Logs, CR and WVT
  • Run unit tests for Session Replay
  • Run integration tests
  • Run smoke tests
  • Run tests for tools/

@ncreated ncreated self-assigned this Jan 22, 2024
@ncreated ncreated requested review from a team as code owners January 22, 2024 12:27
@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Jan 22, 2024

Datadog Report

Branch report: ncreated/chore/fix-webview-tracking-integration-tests
Commit report: 9334f28
Test service: dd-sdk-ios

✅ 0 Failed, 2530 Passed, 0 Skipped, 23m 9.16s Wall Time
🔻 Test Sessions change in coverage: 10 decreased, 3 increased, 1 no change

🔻 Code Coverage Decreases vs Default Branch (10)

This report shows up to 5 code coverage decreases.

  • test DatadogCoreTests tvOS 79.43% (Δ-0.14%) - Details
  • test DatadogWebViewTrackingTests iOS 23.00% (Δ-0.08%) - Details
  • test DatadogCrashReportingTests tvOS 28.99% (Δ-0.06%) - Details
  • test DatadogCrashReportingTests iOS 28.95% (Δ-0.06%) - Details
  • test DatadogInternalTests tvOS 81.21% (Δ-0.05%) - Details

Copy link
Member

@maxep maxep left a comment

Choose a reason for hiding this comment

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

Thank you!

@ncreated ncreated merged commit 9b41472 into develop Jan 22, 2024
8 checks passed
@ncreated ncreated deleted the ncreated/chore/fix-webview-tracking-integration-tests branch January 22, 2024 15:19
@ncreated ncreated mentioned this pull request Jan 25, 2024
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants