Skip to content

Commit 7e7fae2

Browse files
committed
Merge remote-tracking branch 'origin/develop' into feature/v3
2 parents a4e41b1 + dc4ed17 commit 7e7fae2

File tree

13 files changed

+82
-46
lines changed

13 files changed

+82
-46
lines changed

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
variables:
2-
CURRENT_CI_IMAGE: "17"
2+
CURRENT_CI_IMAGE: "18"
33
CI_IMAGE_DOCKER: registry.ddbuild.io/ci/dd-sdk-android:$CURRENT_CI_IMAGE
44
GIT_DEPTH: 5
55

CONTRIBUTING.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,28 @@ In addition, to be able to run the static analysis tools locally, you should run
2424
This project hosts the following modules:
2525

2626
- `dd-sdk-android-core`: the main library implementing the core functionality of SDK (storage and upload of data, core APIs);
27+
- `dd-sdk-android-internal`: a library providing internal APIs, classes and utilities shared by the SDK modules;
2728
- `features/***`: a set of libraries implementing Datadog products:
2829
- `features/dd-sdk-android-logs`: a library to send logs to Datadog;
2930
- `features/dd-sdk-android-rum`: a library to track user navigation and interaction;
3031
- `features/dd-sdk-android-ndk`: a lightweight library to track crashes from NDK libraries;
3132
- `features/dd-sdk-android-session-replay`: a library to capture the window content;
33+
- `features/dd-sdk-android-session-replay-compose`: an extension for Session Replay to integrate with the Jetpack Compose;
3234
- `features/dd-sdk-android-session-replay-material`: an extension for Session Replay to integrate with the Material Design library;
33-
- `features/dd-sdk-android-session-trace`: a library to measure performance of operations locally;
34-
- `features/dd-sdk-android-session-webview`: a library to forward logs and RUM events captured in a webview to be linked with the mobile session;
35+
- `features/dd-sdk-android-trace`: a library to measure performance of operations locally;
36+
- `features/dd-sdk-android-trace-otel`: an extension of Trace library to integrate with OpenTelemetry;
37+
- `features/dd-sdk-android-webview`: a library to forward logs and RUM events captured in a webview to be linked with the mobile session;
3538
- `integrations/***`: a set of libraries integrating Datadog products in third party libraries:
3639
- `integrations/dd-sdk-android-coil`: a lightweight library providing a bridge integration between Datadog SDK and [Coil](https://coil-kt.github.io/coil/);
3740
- `integrations/dd-sdk-android-compose`: a lightweight library providing a bridge integration between Datadog SDK and [Jetpack Compose](https://developer.android.com/jetpack/compose);
3841
- `integrations/dd-sdk-android-fresco`: a lightweight library providing a bridge integration between Datadog SDK and [Fresco](https://frescolib.org/);
3942
- `integrations/dd-sdk-android-okhttp`: a lightweight library providing an instrumentation for [OkHttp](https://square.github.io/okhttp/);
43+
- `integrations/dd-sdk-android-okhttp-otel`: a lightweight library a support of OpenTelemetry for the [OkHttp](https://square.github.io/okhttp/) instrumentation;
4044
- `integrations/dd-sdk-android-rx`: a lightweight library providing a bridge integration between Datadog SDK and [RxJava](https://github.com/ReactiveX/RxJava);
4145
- `integrations/dd-sdk-android-sqldelight`: a lightweight library providing a bridge integration between Datadog SDK and [SQLDelight](https://cashapp.github.io/sqldelight/);
4246
- `integrations/dd-sdk-android-tv`: a lightweight library providing extensions for [Android TV](https://www.android.com/tv/)
43-
- `integrations/dd-sdk-android-ktx`: a set of Kotlin extensions to make the Datadog SDK more Kotlin friendly;
47+
- `integrations/dd-sdk-android-trace-coroutines`: a set of extensions for Kotlin Coroutines to ease the work with the Trace library;
48+
- `integrations/dd-sdk-android-rum-coroutines`: a set of extensions for Kotlin Coroutines to ease the work with the RUM library;
4449
- `integrations/dd-sdk-android-glide`: a lightweight library providing a bridge integration between Datadog SDK and [Glide](https://bumptech.github.io/glide/);
4550
- `integrations/dd-sdk-android-timber`: a lightweight library providing a bridge integration between Datadog SDK and [Timber](https://github.com/JakeWharton/timber);
4651
- `instrumented/***`: a set of modules used to run instrumented tests:
@@ -52,8 +57,11 @@ This project hosts the following modules:
5257
- `tools/unit`: a utility library with code to help writing unit tests;
5358
- `sample/***`: a few sample applications showcasing how to use the library features in production code;
5459
- `sample/kotlin`: a sample mobile application;
55-
- `sample/vendor-lib`: a sample android library, to showcase vendors using Datadog in a host app also using Datadog;
56-
- `sample/wear`: a sample watch application;
60+
- `sample/vendor-lib`: a sample Android library, to showcase vendors using Datadog in a host app also using Datadog;
61+
- `sample/wear`: a sample Wear OS application;
62+
- `sample/automotive`: a sample Automotive OS application;
63+
- `sample/tv`: a sample Android TV OS application;
64+
- `sample/benchmark`: a sample application to collect SDK performance metrics;
5765

5866
### Building the SDK
5967

build.gradle.kts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,16 @@ allprojects {
4949
nexusPublishing {
5050
this.repositories {
5151
sonatype {
52-
val sonatypeUsername = System.getenv("OSSRH_USERNAME")
53-
val sonatypePassword = System.getenv("OSSRH_PASSWORD")
54-
stagingProfileId.set("378eecbbe2cf9")
52+
val sonatypeUsername = System.getenv("CENTRAL_PUBLISHER_USERNAME")
53+
val sonatypePassword = System.getenv("CENTRAL_PUBLISHER_PASSWORD")
5554
if (sonatypeUsername != null) username.set(sonatypeUsername)
5655
if (sonatypePassword != null) password.set(sonatypePassword)
56+
// see https://github.com/gradle-nexus/publish-plugin#publishing-to-maven-central-via-sonatype-central
57+
// For official documentation:
58+
// staging repo publishing https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/#configuration
59+
// snapshot publishing https://central.sonatype.org/publish/publish-portal-snapshots/#publishing-via-other-methods
60+
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
61+
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
5762
}
5863
}
5964
}

ci/Dockerfile.gitlab

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM registry.ddbuild.io/images/docker:24.0.4-gbi-focal
1+
# This base image is based on a GBI image
2+
FROM registry.ddbuild.io/images/docker:24.0.4-jammy
23

34
ENV DEBIAN_FRONTEND=noninteractive
45

ci/pipelines/default-pipeline.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ stages:
4242
- aws ssm get-parameter --region us-east-1 --name ci.dd-sdk-android.gradle-properties --with-decryption --query "Parameter.Value" --out text >> ./gradle.properties
4343
- export GPG_PRIVATE_KEY=$(aws ssm get-parameter --region us-east-1 --name ci.dd-sdk-android.signing.gpg_private_key --with-decryption --query "Parameter.Value" --out text)
4444
- export GPG_PASSWORD=$(aws ssm get-parameter --region us-east-1 --name ci.dd-sdk-android.signing.gpg_passphrase --with-decryption --query "Parameter.Value" --out text)
45-
- export OSSRH_USERNAME=$(aws ssm get-parameter --region us-east-1 --name ci.dd-sdk-android.signing.ossrh_username --with-decryption --query "Parameter.Value" --out text)
46-
- export OSSRH_PASSWORD=$(aws ssm get-parameter --region us-east-1 --name ci.dd-sdk-android.signing.ossrh_password --with-decryption --query "Parameter.Value" --out text)
45+
- export CENTRAL_PUBLISHER_USERNAME=$(aws ssm get-parameter --region us-east-1 --name ci.dd-sdk-android.publishing.central_username --with-decryption --query "Parameter.Value" --out text)
46+
- export CENTRAL_PUBLISHER_PASSWORD=$(aws ssm get-parameter --region us-east-1 --name ci.dd-sdk-android.publishing.central_password --with-decryption --query "Parameter.Value" --out text)
4747
- export GPG_PUBLIC_FINGERPRINT=$(aws ssm get-parameter --region us-east-1 --name ci.dd-sdk-android.signing.gpg_public_key --with-decryption --query "Parameter.Value" --out text | gpg --import --import-options show-only | grep -E -o -e "[A-F0-9]{40}")
4848

4949
# CI IMAGE
@@ -53,7 +53,7 @@ ci-image:
5353
when: manual
5454
except: [ tags, schedules ]
5555
tags: [ "arch:amd64" ]
56-
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/docker:24.0.4-gbi-focal
56+
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/docker:24.0.4-jammy
5757
script:
5858
- docker buildx build --tag $CI_IMAGE_DOCKER -f ./ci/Dockerfile.gitlab --push .
5959

@@ -974,6 +974,9 @@ notify:dogfood-app:
974974
only:
975975
- tags
976976
image: $CI_IMAGE_DOCKER
977+
id_tokens:
978+
DDOCTOSTS_ID_TOKEN:
979+
aud: dd-octo-sts
977980
stage: notify
978981
when: on_success
979982
script:
@@ -986,6 +989,9 @@ notify:dogfood-demo:
986989
only:
987990
- tags
988991
image: $CI_IMAGE_DOCKER
992+
id_tokens:
993+
DDOCTOSTS_ID_TOKEN:
994+
aud: dd-octo-sts
989995
stage: notify
990996
when: on_success
991997
script:

ci/scripts/check_latest_release_is_published.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,5 @@ for artifactId in $(./gradlew -q listAllPublishedArtifactIds); do
1818
echo "Release $tag_name exists for $artifactId"
1919
else
2020
echo "Release $tag_name doesn't exist for $artifactId"
21-
# TODO remove this check when
22-
# https://github.com/DataDog/dd-sdk-android/commit/ccd79322895a6ba135e2b73b32005fb4aeb5c31c
23-
# is released
24-
if [ $artifactId != "dd-sdk-android-benchmark-internal" ]; then
25-
exit 1
26-
fi
2721
fi
2822
done

features/dd-sdk-android-session-replay/src/main/kotlin/com/datadog/android/sessionreplay/internal/async/RecordedDataQueueHandler.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ internal class RecordedDataQueueHandler(
9999
* for example if a snapshot failed to traverse the tree).
100100
* If neither of the previous conditions occurs, the loop breaks.
101101
*/
102-
@MainThread
103102
override fun tryToConsumeItems() {
104103
// no need to create a thread if the queue is empty
105104
if (recordedDataQueue.isEmpty()) {

features/dd-sdk-android-session-replay/src/main/kotlin/com/datadog/android/sessionreplay/internal/async/RecordedDataQueueRefs.kt

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,11 @@
66

77
package com.datadog.android.sessionreplay.internal.async
88

9-
import android.os.Handler
10-
import android.os.Looper
11-
129
/**
1310
* References to the work queue context.
1411
*/
1512
internal data class RecordedDataQueueRefs(
16-
private val recordedDataQueueHandler: RecordedDataQueueHandler,
17-
private val mainThreadHandler: Handler = Handler(Looper.getMainLooper())
13+
private val recordedDataQueueHandler: RecordedDataQueueHandler
1814
) {
1915
// this can only be populated after the snapshot has been created
2016
internal var recordedDataQueueItem: SnapshotRecordedDataQueueItem? = null
@@ -28,9 +24,6 @@ internal data class RecordedDataQueueRefs(
2824
}
2925

3026
internal fun tryToConsumeItem() {
31-
mainThreadHandler.post {
32-
@Suppress("ThreadSafety") // we are in the main thread context
33-
recordedDataQueueHandler.tryToConsumeItems()
34-
}
27+
recordedDataQueueHandler.tryToConsumeItems()
3528
}
3629
}

features/dd-sdk-android-session-replay/src/main/kotlin/com/datadog/android/sessionreplay/internal/processor/NodeFlattener.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ internal class NodeFlattener(private val wireframeUtils: WireframeUtils = Wirefr
1919
stack.push(root)
2020
while (stack.isNotEmpty()) {
2121
val node = stack.pop()
22-
node.wireframes
22+
node.wireframes.toList()
2323
.map { wireframe ->
2424
val clip = wireframeUtils.resolveWireframeClip(wireframe, node.parents)
2525
wireframe.copy(clip = clip)

features/dd-sdk-android-session-replay/src/test/kotlin/com/datadog/android/sessionreplay/internal/async/RecordedDataQueueRefsTest.kt

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
package com.datadog.android.sessionreplay.internal.async
88

9-
import android.os.Handler
109
import com.datadog.android.sessionreplay.forge.ForgeConfigurator
1110
import fr.xgouchet.elmyr.junit5.ForgeConfiguration
1211
import fr.xgouchet.elmyr.junit5.ForgeExtension
@@ -15,10 +14,8 @@ import org.junit.jupiter.api.Test
1514
import org.junit.jupiter.api.extension.ExtendWith
1615
import org.junit.jupiter.api.extension.Extensions
1716
import org.mockito.Mock
18-
import org.mockito.Mockito.`when`
1917
import org.mockito.junit.jupiter.MockitoExtension
2018
import org.mockito.junit.jupiter.MockitoSettings
21-
import org.mockito.kotlin.any
2219
import org.mockito.kotlin.verify
2320
import org.mockito.quality.Strictness
2421

@@ -37,18 +34,9 @@ internal class RecordedDataQueueRefsTest {
3734
@Mock
3835
lateinit var mockRecordedDataQueueItem: SnapshotRecordedDataQueueItem
3936

40-
@Mock
41-
lateinit var mockHandler: Handler
42-
4337
@BeforeEach
4438
fun setup() {
45-
// make mockHandler execute all runnables immediately
46-
`when`(mockHandler.post(any())).thenAnswer {
47-
(it.arguments[0] as Runnable).run()
48-
true
49-
}
50-
51-
testedDataQueueRefs = RecordedDataQueueRefs(mockDataQueueHandler, mockHandler)
39+
testedDataQueueRefs = RecordedDataQueueRefs(mockDataQueueHandler)
5240
testedDataQueueRefs.recordedDataQueueItem = mockRecordedDataQueueItem
5341
}
5442

0 commit comments

Comments
 (0)