Skip to content

Commit 98a5272

Browse files
committed
fix: address Copilot review comments on PR #1335
- Fix JAVA_HOME/install-jdk-17 ordering in test:native-android and build-and-upload:app so JDK 17 is installed before the Android SDK snippet relies on it - Centralize the duplicated tart VM image string into a TART_VM_IMAGE variable in .gitlab-ci.yml and benchmarks/.benchmarks-ci.yml - Check the exit status of `aws configure export-credentials` before eval'ing its output in get-secret.sh, instead of failing silently
1 parent 8434196 commit 98a5272

3 files changed

Lines changed: 18 additions & 11 deletions

File tree

.gitlab-ci.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ include:
66
variables:
77
GIT_DEPTH: 5
88
DEVELOP_BRANCH: 'develop'
9+
TART_VM_IMAGE: '486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/ci-platform-machine-images/tart-vm:dd-sdk-reactnative-sonoma-latest'
910
ANDROID_SDK_VERSION: 'commandlinetools-mac-11076708_latest'
1011
EMULATOR_NAME: 'android_emulator'
1112
ANDROID_ARCH: 'arm64-v8a'
@@ -48,7 +49,7 @@ stages:
4849

4950
test:lint:
5051
tags: ['macos:tart']
51-
image: "486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/ci-platform-machine-images/tart-vm:dd-sdk-reactnative-sonoma-latest"
52+
image: "$TART_VM_IMAGE"
5253
stage: test
5354
rules:
5455
- if: '$BUILD_BENCHMARK != "true"'
@@ -59,7 +60,7 @@ test:lint:
5960

6061
test:js:
6162
tags: ['macos:tart']
62-
image: "486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/ci-platform-machine-images/tart-vm:dd-sdk-reactnative-sonoma-latest"
63+
image: "$TART_VM_IMAGE"
6364
stage: test
6465
rules:
6566
- if: '$BUILD_BENCHMARK != "true"'
@@ -71,7 +72,7 @@ test:js:
7172

7273
test:build:
7374
tags: ['macos:tart']
74-
image: "486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/ci-platform-machine-images/tart-vm:dd-sdk-reactnative-sonoma-latest"
75+
image: "$TART_VM_IMAGE"
7576
stage: test
7677
rules:
7778
- if: '$BUILD_BENCHMARK != "true"'
@@ -82,14 +83,14 @@ test:build:
8283

8384
test:native-android:
8485
tags: ['macos:tart']
85-
image: "486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/ci-platform-machine-images/tart-vm:dd-sdk-reactnative-sonoma-latest"
86+
image: "$TART_VM_IMAGE"
8687
stage: test
8788
rules:
8889
- if: '$BUILD_BENCHMARK != "true"'
8990
timeout: 1h
9091
script:
91-
- !reference [.snippets, install-android-sdk]
9292
- !reference [.snippets, install-jdk-17]
93+
- !reference [.snippets, install-android-sdk]
9394
- /opt/homebrew/opt/openjdk@17/bin/java --version
9495
- echo "org.gradle.java.home=/opt/homebrew/opt/openjdk@17" >> packages/core/android/gradle.properties
9596
- echo "org.gradle.java.home=/opt/homebrew/opt/openjdk@17" >> packages/react-native-session-replay/android/gradle.properties
@@ -101,7 +102,7 @@ test:native-android:
101102

102103
test:native-ios:
103104
tags: ['macos:tart']
104-
image: "486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/ci-platform-machine-images/tart-vm:dd-sdk-reactnative-sonoma-latest"
105+
image: "$TART_VM_IMAGE"
105106
stage: test
106107
rules:
107108
- if: '$BUILD_BENCHMARK != "true"'
@@ -113,7 +114,7 @@ test:native-ios:
113114

114115
test:native-ios-sr:
115116
tags: ['macos:tart']
116-
image: "486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/ci-platform-machine-images/tart-vm:dd-sdk-reactnative-sonoma-latest"
117+
image: "$TART_VM_IMAGE"
117118
stage: test
118119
rules:
119120
- if: '$BUILD_BENCHMARK != "true"'
@@ -125,7 +126,7 @@ test:native-ios-sr:
125126

126127
test:native-ios-newarch:
127128
tags: ['macos:tart']
128-
image: "486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/ci-platform-machine-images/tart-vm:dd-sdk-reactnative-sonoma-latest"
129+
image: "$TART_VM_IMAGE"
129130
stage: test
130131
rules:
131132
- if: '$BUILD_BENCHMARK != "true"'

benchmarks/.benchmarks-ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ include:
55
variables:
66
GIT_DEPTH: 5
77
NODE_VERSION: '22.5.1'
8+
TART_VM_IMAGE: '486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/ci-platform-machine-images/tart-vm:dd-sdk-reactnative-sonoma-latest'
89
ANDROID_SDK_VERSION: 'commandlinetools-mac-11076708_latest'
910
EMULATOR_NAME: 'android_emulator'
1011
ANDROID_ARCH: 'arm64-v8a'
@@ -63,11 +64,11 @@ stages:
6364
build-and-upload:app:
6465
stage: build-and-upload
6566
tags: ['macos:tart']
66-
image: "486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/ci-platform-machine-images/tart-vm:dd-sdk-reactnative-sonoma-latest"
67+
image: "$TART_VM_IMAGE"
6768
script:
6869
- !reference [.snippets, install-node]
69-
- !reference [.snippets, install-android-sdk]
7070
- !reference [.snippets, install-jdk-17]
71+
- !reference [.snippets, install-android-sdk]
7172
- !reference [.snippets, check-versions]
7273

7374
- echo $(pwd)

benchmarks/scripts/secrets/get-secret.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ get_secret() {
1010
export VAULT_ADDR=$DD_VAULT_ADDR
1111
if [ "$CI" = "true" ]; then
1212
if [ -z "${AWS_ACCESS_KEY_ID:-}" ] || [ -z "${AWS_SECRET_ACCESS_KEY:-}" ]; then
13-
eval "$(aws configure export-credentials --format env)"
13+
local aws_env
14+
if ! aws_env="$(aws configure export-credentials --format env)"; then
15+
echo "Error: Failed to export AWS credentials via 'aws configure export-credentials'." >&2
16+
exit 1
17+
fi
18+
eval "$aws_env"
1419
fi
1520
vault login -method=aws -no-print
1621
else

0 commit comments

Comments
 (0)