Skip to content

RUM-9297: Add Compose actions tracking strategy API in RumConfiguration#2575

Merged
ambushwork merged 1 commit into
feature/actions-trackingfrom
yl/track-actions/add-rum-config-api
Apr 4, 2025
Merged

RUM-9297: Add Compose actions tracking strategy API in RumConfiguration#2575
ambushwork merged 1 commit into
feature/actions-trackingfrom
yl/track-actions/add-rum-config-api

Conversation

@ambushwork

Copy link
Copy Markdown
Member

What does this PR do?

Add API setComposeTrackingStrategy in RumConfiguration which allows user to add ComposeActionsTrackingStategy.

So that GestureListener will be able to use this strategy to locate target in Jetpack Compose.

Motivation

RUM-9297

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)

@ambushwork
ambushwork force-pushed the yl/track-actions/add-rum-config-api branch 4 times, most recently from 4a17a14 to cb9c390 Compare April 1, 2025 15:35
@codecov-commenter

codecov-commenter commented Apr 1, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 72.09302% with 12 lines in your changes missing coverage. Please review.

Project coverage is 70.14%. Comparing base (8464f0f) to head (c80f7cc).

Files with missing lines Patch % Lines
...instrumentation/gestures/DatadogGesturesTracker.kt 12.50% 7 Missing ⚠️
...com/datadog/android/compose/RumConfigurationExt.kt 0.00% 4 Missing ⚠️
...otlin/com/datadog/android/rum/_RumInternalProxy.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                     Coverage Diff                      @@
##           feature/actions-tracking    #2575      +/-   ##
============================================================
- Coverage                     70.31%   70.14%   -0.17%     
============================================================
  Files                           804      808       +4     
  Lines                         30196    30235      +39     
  Branches                       5050     5052       +2     
============================================================
- Hits                          21230    21206      -24     
- Misses                         7587     7618      +31     
- Partials                       1379     1411      +32     
Files with missing lines Coverage Δ
...kotlin/com/datadog/android/rum/RumConfiguration.kt 97.30% <100.00%> (+0.11%) ⬆️
...lin/com/datadog/android/rum/internal/RumFeature.kt 91.43% <100.00%> (-0.97%) ⬇️
...ernal/instrumentation/gestures/GesturesListener.kt 92.45% <100.00%> (-1.38%) ⬇️
...g/android/compose/ComposeActionTrackingStrategy.kt 100.00% <100.00%> (ø)
...otlin/com/datadog/android/rum/_RumInternalProxy.kt 70.59% <0.00%> (-4.41%) ⬇️
...com/datadog/android/compose/RumConfigurationExt.kt 0.00% <0.00%> (ø)
...instrumentation/gestures/DatadogGesturesTracker.kt 63.64% <12.50%> (-0.65%) ⬇️

... and 30 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ambushwork
ambushwork marked this pull request as ready for review April 1, 2025 16:25
@ambushwork
ambushwork requested review from a team as code owners April 1, 2025 16:25
@ambushwork
ambushwork force-pushed the yl/track-actions/add-rum-config-api branch 3 times, most recently from 6eabf12 to 3de5964 Compare April 3, 2025 10:24
@ambushwork
ambushwork force-pushed the yl/track-actions/add-rum-config-api branch from 3de5964 to 5f876ce Compare April 3, 2025 11:10

@0xnm 0xnm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

overall lgtm! I've added few comments and suggestions.

Comment on lines +111 to +112
composeActionTrackingStrategy = composeActionsTrackingStrategy,
internalLogger = internalLogger

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

do we need to use named arguments if variable name matches?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Personally I prefer always adding named argument for function call, for mainly these reasons:

  • avoid argument orders mistakes if some arguments have same type.
  • more readable in PR on GH, especially the variable name doesn't match exactly with argument name.
  • be alerted with the silent break of argument name in the function declaration.

Maybe none of these advantages apply here in this PR, but I think it's a good thing to have more in our code base, WDYT?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

yes, sure, makes sense. just then maybe we can make it consistent and add all names for the remaining arguments in this function call?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

updated with full named arguments

@ambushwork
ambushwork force-pushed the yl/track-actions/add-rum-config-api branch from 5f876ce to e8b3239 Compare April 4, 2025 08:21
@ambushwork
ambushwork force-pushed the yl/track-actions/add-rum-config-api branch from e8b3239 to c80f7cc Compare April 4, 2025 09:40

@0xnm 0xnm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nice!

@ambushwork
ambushwork merged commit 4e4c289 into feature/actions-tracking Apr 4, 2025
@ambushwork
ambushwork deleted the yl/track-actions/add-rum-config-api branch April 4, 2025 10:44
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.

4 participants