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

Allow all activities to ge traced by default #1789

Merged
merged 2 commits into from
Jan 6, 2025
Merged

Conversation

bidetofevil
Copy link
Collaborator

@bidetofevil bidetofevil commented Jan 1, 2025

Goal

Add in annotations that allow a local config to specify that all activities loads are traced, with an opt-out annotation for those that shouldn't be.

Note: a change to the swazzler is needed to properly wire this up, but the SDK changes are all contained and tested in this PR.

Copy link

codecov bot commented Jan 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.46%. Comparing base (357553b) to head (ec714ae).
Report is 3 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1789      +/-   ##
==========================================
- Coverage   85.47%   85.46%   -0.01%     
==========================================
  Files         466      466              
  Lines       10944    10948       +4     
  Branches     1626     1626              
==========================================
+ Hits         9354     9357       +3     
  Misses        861      861              
- Partials      729      730       +1     
Files with missing lines Coverage Δ
...nal/config/behavior/AutoDataCaptureBehaviorImpl.kt 91.30% <100.00%> (+0.39%) ⬆️
.../embracesdk/internal/capture/activity/UiLoadExt.kt 100.00% <100.00%> (ø)
...internal/injection/DataCaptureServiceModuleImpl.kt 95.34% <100.00%> (+0.11%) ⬆️
...config/instrumented/schema/EnabledFeatureConfig.kt 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

Copy link
Contributor

@fractalwrench fractalwrench left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +178 to +179
return javaClass.isAnnotationPresent(TracedActivity::class.java) ||
autoTraceEnabled && !javaClass.isAnnotationPresent(NotTracedActivity::class.java)
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this work with R8 or are additional rules required?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This should work given that it's how we check @StartupActivity, but I'll double check.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nice catch. Looks like this is an issue - which means @startupactivity detection didn't work either at runtime either.

@bidetofevil bidetofevil force-pushed the hho/trim-ui-load-events branch from 6841bf2 to 5c4591e Compare January 6, 2025 16:05
@bidetofevil bidetofevil force-pushed the hho/load-trace-config branch from 7bbd8fe to 5065414 Compare January 6, 2025 16:05
@bidetofevil bidetofevil changed the base branch from hho/trim-ui-load-events to graphite-base/1789 January 6, 2025 19:40
@bidetofevil bidetofevil force-pushed the hho/load-trace-config branch from 5065414 to cd6536e Compare January 6, 2025 19:52
@bidetofevil bidetofevil changed the base branch from graphite-base/1789 to main January 6, 2025 19:52
@bidetofevil bidetofevil force-pushed the hho/load-trace-config branch from cd6536e to 42f2e2b Compare January 6, 2025 19:52
Copy link
Contributor

github-actions bot commented Jan 6, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Files

@@ -1,4 +1,4 @@
-keepattributes LineNumberTable, SourceFile
-keepattributes LineNumberTable, SourceFile, RuntimeVisibleAnnotations
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This will minimally make annotations work if it's not specified in another proguard file. We should probably just add all annotations, but we can do that in a different PR.

Copy link
Collaborator Author

bidetofevil commented Jan 6, 2025

Merge activity

  • Jan 6, 5:37 PM EST: A user started a stack merge that includes this pull request via Graphite.
  • Jan 6, 5:37 PM EST: A user merged this pull request with Graphite.

@bidetofevil bidetofevil merged commit 505d329 into main Jan 6, 2025
8 checks passed
@bidetofevil bidetofevil deleted the hho/load-trace-config branch January 6, 2025 22:37
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