Skip to content

Commit a9eed53

Browse files
Merge branch 'master' into alexeyk/mute-forwarder-trace
2 parents daa7cf2 + e68b605 commit a9eed53

95 files changed

Lines changed: 723 additions & 375 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/README.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,6 @@ _Action:_
8585

8686
_Recovery:_ Check at the milestone for the related issues and update them manually.
8787

88-
### prune-github-container-registry [🔗](prune-github-container-registry.yaml)
89-
90-
_Trigger:_ Every day or manually.
91-
92-
_Action:_ Clean up old lib-injection OCI images from GitHub Container Registry.
93-
94-
_Recovery:_ Manually trigger the action again.
9588

9689
### prune-old-pull-requests [🔗](prune-old-pull-requests.yaml)
9790

.github/workflows/prune-github-container-registry.yaml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.gitlab-ci.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,11 @@ default:
123123
- |
124124
if [[ ! $CI_COMMIT_BRANCH =~ ^(master|release/.*)$ ]]; then
125125
export GIT_BASE_REF=$(.gitlab/find-gh-base-ref.sh)
126-
export GRADLE_PARAMS="$GRADLE_PARAMS -PgitBaseRef=origin/$GIT_BASE_REF"
126+
if [[ -n "$GIT_BASE_REF" ]]; then
127+
export GRADLE_PARAMS="$GRADLE_PARAMS -PgitBaseRef=origin/$GIT_BASE_REF"
128+
else
129+
echo "Failed to find base ref for PR" >&2
130+
fi
127131
fi
128132
129133
.gradle_build: &gradle_build
@@ -739,6 +743,7 @@ deploy_to_di_backend:manual:
739743
UPSTREAM_COMMIT_AUTHOR: $CI_COMMIT_AUTHOR
740744
UPSTREAM_COMMIT_SHORT_SHA: $CI_COMMIT_SHORT_SHA
741745

746+
# If the deploy_to_sonatype job is re-run, re-trigger the deploy_artifacts_to_github job as well so that the artifacts match.
742747
deploy_to_sonatype:
743748
extends: .gradle_build
744749
stage: publish
@@ -775,7 +780,7 @@ deploy_artifacts_to_github:
775780
when: never
776781
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/'
777782
when: on_success
778-
# Requires the deploy_to_sonatype job to have run first the UP-TO-DATE gradle check across jobs is broken
783+
# Requires the deploy_to_sonatype job to have run first (the UP-TO-DATE gradle check across jobs is broken)
779784
# This will deploy the artifacts built from the publishToSonatype task to the GitHub release
780785
needs:
781786
- job: deploy_to_sonatype

.gitlab/benchmarks.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727
UPSTREAM_BRANCH: $CI_COMMIT_REF_NAME # The branch or tag name for which project is built.
2828
UPSTREAM_COMMIT_SHA: $CI_COMMIT_SHA # The commit revision the project is built for.
2929

30-
KUBERNETES_SERVICE_ACCOUNT_OVERWRITE: dd-trace-java
31-
FF_USE_LEGACY_KUBERNETES_EXECUTION_STRATEGY: "true"
32-
3330
benchmarks-startup:
3431
extends: .benchmarks
3532
script:
@@ -56,6 +53,7 @@ benchmarks-dacapo:
5653

5754
benchmarks-post-results:
5855
extends: .benchmarks
56+
tags: ["arch:amd64"]
5957
script:
6058
- !reference [ .benchmarks, script ]
6159
- ./steps/upload-results-to-s3.sh

.gitlab/find-gh-base-ref.sh

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,40 @@
22
# Determines the base branch for the current PR (if we are running in a PR).
33
set -euo pipefail
44

5+
CURRENT_HEAD_SHA="$(git rev-parse HEAD)"
6+
if [[ -z "${CURRENT_HEAD_SHA:-}" ]]; then
7+
echo "Failed to determine current HEAD SHA" >&2
8+
exit 1
9+
fi
10+
11+
# 'workspace' is declared in the ci pipeline cache
12+
CACHE_PATH=workspace/find-gh-base-ref.cache
13+
save_cache() {
14+
local base_ref="$1"
15+
local head_sha="$2"
16+
mkdir -p workspace
17+
echo "CACHED_BASE_REF=${base_ref}" > "$CACHE_PATH"
18+
echo "CACHED_HEAD_SHA=${head_sha}" >> "$CACHE_PATH"
19+
}
20+
21+
# Get cached result (if HEAD commit matches)
22+
if [[ -f $CACHE_PATH ]]; then
23+
set -a
24+
source "$CACHE_PATH"
25+
set +a
26+
if [[ "$CURRENT_HEAD_SHA" == "${CACHED_HEAD_SHA:-}" && -n "${CACHED_BASE_REF:-}" ]]; then
27+
echo "Cache hit on $CACHE_PATH" >&2
28+
echo "$CACHED_BASE_REF"
29+
exit 0
30+
else
31+
echo "Cache miss on $CACHE_PATH" >&2
32+
fi
33+
fi
34+
535
# Happy path: if we're just one commit away from master, base ref is master.
636
if [[ $(git log --pretty=oneline origin/master..HEAD | wc -l) -eq 1 ]]; then
737
echo "We are just one commit away from master, base ref is master" >&2
38+
save_cache "master" "$CURRENT_HEAD_SHA"
839
echo "master"
940
exit 0
1041
fi
@@ -17,14 +48,19 @@ if [[ -z "${CI_COMMIT_REF_NAME}" ]]; then
1748
exit 1
1849
fi
1950

51+
# In GitLab, CI_PROJECT_NAME is set, otherwise, set it for testing.
52+
export CI_PROJECT_NAME="${CI_PROJECT_NAME:-dd-trace-java}"
53+
2054
if [[ -z "${GITHUB_TOKEN:-}" ]]; then
2155
echo "GITHUB_TOKEN is not set, fetching from AWS SSM" >&2
2256
if ! command -v aws >/dev/null 2>&1; then
2357
echo "aws is not installed, please install it" >&2
2458
exit 1
2559
fi
60+
set +e
2661
GITHUB_TOKEN=$(aws ssm get-parameter --name "ci.$CI_PROJECT_NAME.gh_release_token" --with-decryption --query "Parameter.Value" --output text)
27-
if [[ -z "${GITHUB_TOKEN}" ]]; then
62+
set -e
63+
if [[ -z "${GITHUB_TOKEN:-}" ]]; then
2864
echo "Failed to fetch GITHUB_TOKEN from AWS SSM" >&2
2965
exit 1
3066
fi
@@ -57,9 +93,12 @@ while true; do
5793
if [[ ${exit_code} -eq 0 ]]; then
5894
PR_NUMBER=$(echo "$PR_DATA" | sed '1,/^[[:space:]]*$/d' | jq -r '.[].number')
5995
PR_BASE_REF=$(echo "$PR_DATA" | sed '1,/^[[:space:]]*$/d' | jq -r '.[].base.ref')
60-
echo "PR is https://github.com/datadog/dd-trace-java/pull/${PR_NUMBER} and base ref is ${PR_BASE_REF}">&2
61-
echo "${PR_BASE_REF}"
62-
exit 0
96+
if [[ -n "${PR_BASE_REF:-}" ]]; then
97+
echo "PR is https://github.com/datadog/dd-trace-java/pull/${PR_NUMBER} and base ref is ${PR_BASE_REF}">&2
98+
save_cache "${PR_BASE_REF}" "$CURRENT_HEAD_SHA"
99+
echo "${PR_BASE_REF}"
100+
exit 0
101+
fi
63102
fi
64103
if echo "$PR_DATA" | grep -q "^x-ratelimit-reset:"; then
65104
reset_timestamp=$(echo -n "$PR_DATA" | grep "^x-ratelimit-reset:" | sed -e 's/^x-ratelimit-reset: //' -e 's/\r//')
@@ -70,7 +109,5 @@ while true; do
70109
continue
71110
fi
72111
echo -e "GitHub request failed for an unknown reason:\n$(echo "$PR_DATA" | sed '/^$/q')" >&2
73-
echo "Assuming base ref is master" >&2
74-
echo "master"
75-
exit 0
112+
exit 1
76113
done

.gitlab/macrobenchmarks.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
- platform/artifacts/
2323
expire_in: 3 months
2424
variables:
25-
FF_USE_LEGACY_KUBERNETES_EXECUTION_STRATEGY: "true"
26-
2725
K6_OPTIONS_WARMUP_RATE: 2000
2826
K6_OPTIONS_WARMUP_DURATION: 5m
2927
K6_OPTIONS_WARMUP_GRACEFUL_STOP: 10s

0 commit comments

Comments
 (0)