Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 0 additions & 31 deletions .github/workflows/changelog-to-confluence.yaml

This file was deleted.

78 changes: 40 additions & 38 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: "CodeQL"

on:
push:
branches: [ "**" ]
branches: ["publish"]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master", "develop", "release/**", "feature/**" ]
branches: ["publish"]

jobs:
analyze:
Expand All @@ -19,44 +19,46 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'java' ]
language: ["java"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup Java 17
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
with:
distribution: 'zulu'
java-version: 17

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@f47c8e6a9bd05ef3ee422fc8d8663be7fe4bdc61 # v3.31.9
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


- name: Setup Gradle
uses: gradle/actions/setup-gradle@d9c87d481d55275bb5441eef3fe0e46805f9ef70 # v3.5.0
with:
gradle-version: 8.14.3

# Manually build the java bytecode
- name: Execute Gradle build
run: ./gradlew assembleLibrariesRelease

# Perform the analysis
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@f47c8e6a9bd05ef3ee422fc8d8663be7fe4bdc61 # v3.31.9
with:
category: "/language:${{matrix.language}}"
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup Java 17
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
with:
distribution: "zulu"
java-version: 17

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@f47c8e6a9bd05ef3ee422fc8d8663be7fe4bdc61 # v3.31.9
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

- name: Setup Gradle
uses: gradle/actions/setup-gradle@d9c87d481d55275bb5441eef3fe0e46805f9ef70 # v3.5.0
with:
gradle-version: 8.14.3

# Manually build the java bytecode
- name: Execute Gradle build
run: ./gradlew assembleLibrariesRelease

- name: Stop Gradle Daemon
run: ./gradlew --stop

# Perform the analysis
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@f47c8e6a9bd05ef3ee422fc8d8663be7fe4bdc61 # v3.31.9
with:
category: "/language:${{matrix.language}}"
139 changes: 139 additions & 0 deletions .github/workflows/publish-maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
name: Publish to Maven Central

on:
push:
branches:
- publish # 推送到 publish 分支时触发 snapshot 发布
tags:
- "v*" # 推送 tag(如 v0.1.0)时触发正式发布

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "temurin"

- name: Setup Android SDK
uses: android-actions/setup-android@v3

- name: Cache Gradle packages
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build project
run: ./gradlew clean assembleRelease --stacktrace

- name: Run tests
run: ./gradlew testReleaseUnitTest --stacktrace

- name: Stop Gradle Daemon
run: ./gradlew --stop

- name: Publish to Maven Central
env:
# Maven Central Portal credentials
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
# GPG signing credentials (supports both base64 and ASCII armored)
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSWORD: ${{ secrets.GPG_PASSPHRASE }}
run: |
# Determine if this is a snapshot or release build
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
echo "📦 Publishing release version (from tag: ${{ github.ref_name }})"
VERSION_TYPE="release"
else
echo "📦 Publishing snapshot version (from branch: ${{ github.ref_name }})"
VERSION_TYPE="snapshot"
fi

# Publish all modules using Vanniktech plugin
# This will upload to Maven Central Portal
./gradlew publishAllPublicationsToMavenCentralRepository --no-daemon --stacktrace

echo "✅ Publishing completed"

notify-success:
needs: publish
runs-on: ubuntu-latest
if: success()
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Determine version type
id: version
run: |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
echo "type=正式版" >> $GITHUB_OUTPUT
echo "version=${{ github.ref_name }}" >> $GITHUB_OUTPUT
else
echo "type=快照版" >> $GITHUB_OUTPUT
echo "version=${{ github.ref_name }}-SNAPSHOT" >> $GITHUB_OUTPUT
fi

- name: Notify deployment success
uses: zcong1993/actions-ding@master
with:
dingToken: ${{ secrets.DING_TALK_TOKEN }}
secret: ${{ secrets.DING_TALK_SECRET }}
body: |
{
"msgtype": "markdown",
"markdown": {
"title": "fc-sdk-android 发布通知",
"text": "### ✅ fc-sdk-android 发布成功\n\n---\n\n 🔖 版本: ${{ steps.version.outputs.version }}\n\n 📦 类型: ${{ steps.version.outputs.type }}\n\n 👨‍💻 发布者: ${{ github.actor }}\n\n 🚀 [查看详情](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})"
}
}

notify-failure:
needs: publish
runs-on: ubuntu-latest
if: failure()
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Determine version type
id: version
run: |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
echo "type=正式版" >> $GITHUB_OUTPUT
echo "version=${{ github.ref_name }}" >> $GITHUB_OUTPUT
else
echo "type=快照版" >> $GITHUB_OUTPUT
echo "version=${{ github.ref_name }}-SNAPSHOT" >> $GITHUB_OUTPUT
fi

- name: Notify deployment failure
uses: zcong1993/actions-ding@master
with:
dingToken: ${{ secrets.DING_TALK_TOKEN }}
secret: ${{ secrets.DING_TALK_SECRET }}
body: |
{
"msgtype": "markdown",
"markdown": {
"title": "fc-sdk-android 发布通知",
"text": "### ❌ fc-sdk-android 发布失败\n\n---\n\n 🔖 版本: ${{ steps.version.outputs.version }}\n\n 📦 类型: ${{ steps.version.outputs.type }}\n\n 👨‍💻 发布者: ${{ github.actor }}\n\n 🚀 [查看详情](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})"
}
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ sdk_classpath
detekt_classpath
**/verification-metadata.xml
!gradle/verification-metadata.xml

local-docs/
openspec/
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
* [FEATURE] Feature flags context management. See [#2886](https://github.com/DataDog/dd-sdk-android/pull/2886)
* [FEATURE] Feature flags: Send exposures as batches. See [#2895](https://github.com/DataDog/dd-sdk-android/pull/2895)
* [FEATURE] Feature flags: Add a persistence layer. See [#2898](https://github.com/DataDog/dd-sdk-android/pull/2898)
* [FEATURE] Feature flags: `DatadogSite` extension for Flags endpoint. See [#2922](https://github.com/DataDog/dd-sdk-android/pull/2922)
* [FEATURE] Feature flags: `FlashcatSite` extension for Flags endpoint.
* [FEATURE] Feature flags: `Flags.enable` and `FlagsClient` APIs. See [#2900](https://github.com/DataDog/dd-sdk-android/pull/2900)
* [FEATURE] Feature flags: Support custom endpoints for exposures. See [#2942](https://github.com/DataDog/dd-sdk-android/pull/2942)
* [FEATURE] Feature flags: Custom flagging endpoint and assignment download refactoring. See [#2917](https://github.com/DataDog/dd-sdk-android/pull/2917)
Expand Down Expand Up @@ -792,7 +792,7 @@ This is the first official production version of SDK v3 containing the new archi
* [IMPROVEMENT] Synchronize SR info with webviews. See [#1990](https://github.com/DataDog/dd-sdk-android/pull/1990)
* [IMPROVEMENT] Core: Start sending batches immediately after feature is initialized. See [#1991](https://github.com/DataDog/dd-sdk-android/pull/1991)
* [IMRPOVEMENT] Create RUM Feature Integration Tests. See [#2004](https://github.com/DataDog/dd-sdk-android/pull/2004)
* [IMRROVEMENT] Make constructors of `DatadogSite` private. See [#2010](https://github.com/DataDog/dd-sdk-android/pull/2010)
* [IMRROVEMENT] Make constructors of `FlashcatSite` private.
* [IMRROVEMENT] Log warning about tag modification only once. See [#2017](https://github.com/DataDog/dd-sdk-android/pull/2017)
* [IMRROVEMENT] Add status code in user-facing message in case of `UnknownError` during batch upload. See [#2018](https://github.com/DataDog/dd-sdk-android/pull/2018)
* [MAINTENANCE] Next dev iteration. See [#1972](https://github.com/DataDog/dd-sdk-android/pull/1972)
Expand Down
30 changes: 15 additions & 15 deletions MIGRATION.MD
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Trace.enable(
1. Add the `OpenTelemetry` dependency to your `build.gradle.kts`:

```kotlin
implementation(project("com.datadoghq:dd-sdk-android-trace-otel:x.x.x"))
implementation(project("cloud.flashcat:dd-sdk-android-trace-otel:x.x.x"))
```

2. Replace the `OpenTracing` configuration:
Expand Down Expand Up @@ -153,7 +153,7 @@ Replacement hints:

### OkHttp instrumentation changes

The OkHttp instrumentation (`com.datadoghq:dd-sdk-android-okhttp:x.x.x`) doesn't require desugaring support. However few migration actions may be necessary.
The OkHttp instrumentation (`cloud.flashcat:dd-sdk-android-okhttp:x.x.x`) doesn't require desugaring support. However few migration actions may be necessary.

The default sample rate for the `traceSampler` got increased to 100% with the Android SDK version `3.0.0`.

Expand Down Expand Up @@ -250,17 +250,17 @@ The main changes introduced in SDK 2.0 compared to 1.x are:

1. All relevant products (RUM, Trace, Logs, etc.) are now extracted into different modules. That allows you to integrate only what is needed into your application.

Whereas all products in version 1.x were contained in the single artifact `com.datadoghq:dd-sdk-android:x.x.x`, you now need to adopt the following artifacts:
Whereas all products in version 1.x were contained in the single artifact `cloud.flashcat:dd-sdk-android:x.x.x`, you now need to adopt the following artifacts:

* RUM: `com.datadoghq:dd-sdk-android-rum:x.x.x`
* Logs: `com.datadoghq:dd-sdk-android-logs:x.x.x`
* Trace: `com.datadoghq:dd-sdk-android-trace:x.x.x`
* WebView Tracking: `com.datadoghq:dd-sdk-android-webview:x.x.x`
* OkHttp instrumentation: `com.datadoghq:dd-sdk-android-okhttp:x.x.x`
* RUM: `cloud.flashcat:dd-sdk-android-rum:x.x.x`
* Logs: `cloud.flashcat:dd-sdk-android-logs:x.x.x`
* Trace: `cloud.flashcat:dd-sdk-android-trace:x.x.x`
* WebView Tracking: `cloud.flashcat:dd-sdk-android-webview:x.x.x`
* OkHttp instrumentation: `cloud.flashcat:dd-sdk-android-okhttp:x.x.x`

**Note**: If you utilize NDK Crash Reporting and WebView Tracking, you also need to add RUM and/or Logs artifacts to be able to report events to RUM and/or Logs respectively.

Reference to the `com.datadoghq:dd-sdk-android` artifact should be removed from your Gradle buildscript, this artifact doesn't exist anymore.
Reference to the `cloud.flashcat:dd-sdk-android` artifact should be removed from your Gradle buildscript, this artifact doesn't exist anymore.

**Note**: The Maven coordinates of all the other artifacts stay the same.

Expand Down Expand Up @@ -316,7 +316,7 @@ All the classes related to the Logs product are now strictly contained in the `c
To use Logs product, import the following artifact:

```kotlin
implementation("com.datadoghq:dd-sdk-android-logs:x.x.x")
implementation("cloud.flashcat:dd-sdk-android-logs:x.x.x")
```

You can enable the Logs product with the following snippet:
Expand Down Expand Up @@ -352,7 +352,7 @@ All the classes related to the Trace product are now strictly contained in the `
To use the Trace product, import the following artifact:

```kotlin
implementation("com.datadoghq:dd-sdk-android-trace:x.x.x")
implementation("cloud.flashcat:dd-sdk-android-trace:x.x.x")
```

Enable the Trace product with the following snippet:
Expand Down Expand Up @@ -387,7 +387,7 @@ All classes related to the RUM product are now strictly contained in the `com.da
To use the RUM product, import the following artifact:

```kotlin
implementation("com.datadoghq:dd-sdk-android-rum:x.x.x")
implementation("cloud.flashcat:dd-sdk-android-rum:x.x.x")
```

The RUM product can be enabled with the following snippet:
Expand Down Expand Up @@ -429,7 +429,7 @@ API changes:

### NDK Crash Reporting changes

The artifact name stays the same as before: `com.datadoghq:dd-sdk-android-ndk:x.x.x`
The artifact name stays the same as before: `cloud.flashcat:dd-sdk-android-ndk:x.x.x`

NDK Crash Reporting can be enabled using the following snippet:

Expand All @@ -443,7 +443,7 @@ This configuration replaces the `com.datadog.android.core.configuration.Configur

### WebView Tracking changes

The artifact name stays the same as before: `com.datadoghq:dd-sdk-android-webview:x.x.x`
The artifact name stays the same as before: `cloud.flashcat:dd-sdk-android-webview:x.x.x`

You can enable WebView Tracking with the following snippet:

Expand All @@ -466,7 +466,7 @@ API changes:
In order to be able to use OkHttp Tracking you need to import the following artifact:

```kotlin
implementation("com.datadoghq:dd-sdk-android-okhttp:x.x.x")
implementation("cloud.flashcat:dd-sdk-android-okhttp:x.x.x")
```

OkHttp instrumentation now supports the case when Datadog SDK is initialized after the OkHttp client, allowing you to create `com.datadog.android.okhttp.DatadogEventListener`, `com.datadog.android.okhttp.DatadogInterceptor`, and `com.datadog.android.okhttp.trace.TracingInterceptor` before Datadog SDK. OkHttp instrumentation starts reporting events to Datadog once Datadog SDK is initialized.
Expand Down
Loading
Loading