From a41c407742f86caddc41c09addc90402a55aeccd Mon Sep 17 00:00:00 2001 From: Sarah Chen Date: Fri, 18 Jul 2025 22:39:11 -0400 Subject: [PATCH 01/20] Add dependency to OCI publish jobs --- .gitlab-ci.yml | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9d1d8304721..5921621a999 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,6 +9,7 @@ stages: - build - shared-pipeline - publish + - publish-oci-images - benchmarks - macrobenchmarks - tests @@ -880,6 +881,49 @@ requirements_json_test: package-oci: needs: [ build ] +# "needs" parameters are taken from the one-pipeline template: https://github.com/DataDog/libdatadog-build/blob/main/templates/one-pipeline.yml +# but with an additional dependency on the deploy_to_maven_central job. +internal-publish-lib-init-tags: + stage: publish-oci-images + needs: + - job: deploy_to_maven_central + - job: generate-lib-init-pinned-tag-values + artifacts: true + - job: create-multiarch-lib-injection-image + +promote-oci-to-prod: + stage: publish-oci-images + needs: + - job: deploy_to_maven_central + - job: package-oci + artifacts: true + - job: oci-internal-publish + artifacts: true + +promote-oci-to-prod-beta: + stage: publish-oci-images + needs: + - job: package-oci + artifacts: true + - job: oci-internal-publish + artifacts: true + +promote-oci-to-staging: + stage: publish-oci-images + needs: + - job: package-oci + artifacts: true + - job: oci-internal-publish + artifacts: true + +publish-lib-init-pinned-tags: + stage: publish-oci-images + needs: + - job: deploy_to_maven_central + - job: generate-lib-init-pinned-tag-values + artifacts: true + - job: create-multiarch-lib-injection-image + configure_system_tests: variables: SYSTEM_TESTS_SCENARIOS_GROUPS: "simple_onboarding,simple_onboarding_profiling,simple_onboarding_appsec,docker-ssi,lib-injection" From a5eb6050ed5eb36cc233da3c1584fc38121a027a Mon Sep 17 00:00:00 2001 From: Sarah Chen Date: Wed, 23 Jul 2025 13:17:57 -0400 Subject: [PATCH 02/20] Override new publishing-gate job --- .gitlab-ci.yml | 46 +++------------------------------------------- 1 file changed, 3 insertions(+), 43 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5921621a999..07d5b7969f7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,7 +9,6 @@ stages: - build - shared-pipeline - publish - - publish-oci-images - benchmarks - macrobenchmarks - tests @@ -881,48 +880,9 @@ requirements_json_test: package-oci: needs: [ build ] -# "needs" parameters are taken from the one-pipeline template: https://github.com/DataDog/libdatadog-build/blob/main/templates/one-pipeline.yml -# but with an additional dependency on the deploy_to_maven_central job. -internal-publish-lib-init-tags: - stage: publish-oci-images - needs: - - job: deploy_to_maven_central - - job: generate-lib-init-pinned-tag-values - artifacts: true - - job: create-multiarch-lib-injection-image - -promote-oci-to-prod: - stage: publish-oci-images - needs: - - job: deploy_to_maven_central - - job: package-oci - artifacts: true - - job: oci-internal-publish - artifacts: true - -promote-oci-to-prod-beta: - stage: publish-oci-images - needs: - - job: package-oci - artifacts: true - - job: oci-internal-publish - artifacts: true - -promote-oci-to-staging: - stage: publish-oci-images - needs: - - job: package-oci - artifacts: true - - job: oci-internal-publish - artifacts: true - -publish-lib-init-pinned-tags: - stage: publish-oci-images - needs: - - job: deploy_to_maven_central - - job: generate-lib-init-pinned-tag-values - artifacts: true - - job: create-multiarch-lib-injection-image +# Publish OCI images after deployment to Maven Central is successful. +publishing-gate: + needs: [ deploy_to_maven_central ] configure_system_tests: variables: From ca2fa737808829402524eb591ae266ad13d0e479 Mon Sep 17 00:00:00 2001 From: Sarah Chen Date: Wed, 23 Jul 2025 15:48:18 -0400 Subject: [PATCH 03/20] Change stage order because publishing-gate depends on deploy_to_maven_central --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 07d5b7969f7..cf484b8e707 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,8 +7,8 @@ include: stages: - build - - shared-pipeline - publish + - shared-pipeline - benchmarks - macrobenchmarks - tests From a68de5d23b0f5a5a9753fe2a2c93c696bfd15767 Mon Sep 17 00:00:00 2001 From: Sarah Chen Date: Mon, 28 Jul 2025 10:31:08 -0400 Subject: [PATCH 04/20] Add verify_maven_central_deployment job --- .gitlab-ci.yml | 44 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cf484b8e707..786986628da 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -880,9 +880,49 @@ requirements_json_test: package-oci: needs: [ build ] -# Publish OCI images after deployment to Maven Central is successful. -publishing-gate: +# Verify Maven Central deployment is publicly available before publishing OCI images +verify_maven_central_deployment: + image: curlimages/curl:8.15.0 # minimum docker image for curling: https://hub.docker.com/r/curlimages/curl + stage: publish needs: [ deploy_to_maven_central ] + rules: + - if: '$POPULATE_CACHE' + when: never + - if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/' + when: on_success + - when: manual + allow_failure: true + script: + - | + export VERSION=1.51.2 # hardcoded VERSION for testing + # export VERSION=${CI_COMMIT_TAG##v} + MAVEN_URL="https://repo1.maven.org/maven2/com/datadoghq/dd-java-agent/${VERSION}/dd-java-agent-${VERSION}.jar" + echo "Checking URL: $MAVEN_URL" + # Wait 30 min for the release to be available + TRY=0 + MAX_TRIES=60 + DELAY=30 + while [ $TRY -lt $MAX_TRIES ]; do + if curl -s -I "$MAVEN_URL" | grep -q "^HTTP/.* 200"; then + break + fi + sleep $DELAY + TRY=$((TRY + 1)) + if [ $TRY -eq $MAX_TRIES ]; then + echo "The release is not available after 30 mins. Manually re-run the job to try again." + exit 1 + fi + done + +publishing-gate: + needs: [ verify_maven_central_deployment ] + rules: + - if: '$POPULATE_CACHE' + when: never + - if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/' + when: on_success + - when: manual + allow_failure: true configure_system_tests: variables: From ccab9101520bf89be30adc3a2704867fba6ac0c8 Mon Sep 17 00:00:00 2001 From: Sarah Chen Date: Mon, 28 Jul 2025 10:58:28 -0400 Subject: [PATCH 05/20] Test verify_maven_central_deployment job by temporarily removing dependency --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 786986628da..55508c8f9e7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -884,12 +884,12 @@ package-oci: verify_maven_central_deployment: image: curlimages/curl:8.15.0 # minimum docker image for curling: https://hub.docker.com/r/curlimages/curl stage: publish - needs: [ deploy_to_maven_central ] + # needs: [ deploy_to_maven_central ] rules: - if: '$POPULATE_CACHE' when: never - - if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/' - when: on_success + # - if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/' + # when: on_success - when: manual allow_failure: true script: From 7bc84218248d0032b91cba8ec7788a508fd3dd6a Mon Sep 17 00:00:00 2001 From: Sarah Chen Date: Mon, 28 Jul 2025 12:43:57 -0400 Subject: [PATCH 06/20] Change to registry.ddbuild image --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 55508c8f9e7..b2c0bb01b9b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -882,7 +882,7 @@ package-oci: # Verify Maven Central deployment is publicly available before publishing OCI images verify_maven_central_deployment: - image: curlimages/curl:8.15.0 # minimum docker image for curling: https://hub.docker.com/r/curlimages/curl + image: registry.ddbuild.io/images/mirror/amazon/aws-cli:2.4.29 stage: publish # needs: [ deploy_to_maven_central ] rules: From ac1e92aac424b0ab3824d1b05d2185c4ade90c70 Mon Sep 17 00:00:00 2001 From: Sarah Chen Date: Mon, 28 Jul 2025 12:59:52 -0400 Subject: [PATCH 07/20] Test failing version --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b2c0bb01b9b..ad667054b47 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -894,13 +894,13 @@ verify_maven_central_deployment: allow_failure: true script: - | - export VERSION=1.51.2 # hardcoded VERSION for testing + export VERSION=1.51.3 # hardcoded VERSION for testing (should fail) # export VERSION=${CI_COMMIT_TAG##v} MAVEN_URL="https://repo1.maven.org/maven2/com/datadoghq/dd-java-agent/${VERSION}/dd-java-agent-${VERSION}.jar" echo "Checking URL: $MAVEN_URL" # Wait 30 min for the release to be available TRY=0 - MAX_TRIES=60 + MAX_TRIES=2 DELAY=30 while [ $TRY -lt $MAX_TRIES ]; do if curl -s -I "$MAVEN_URL" | grep -q "^HTTP/.* 200"; then From 57efae3d7f9bca21fe221ba6facf1238d2b077a7 Mon Sep 17 00:00:00 2001 From: Sarah Chen Date: Mon, 28 Jul 2025 13:52:57 -0400 Subject: [PATCH 08/20] Clean --- .gitlab-ci.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ad667054b47..c236084139a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -884,18 +884,15 @@ package-oci: verify_maven_central_deployment: image: registry.ddbuild.io/images/mirror/amazon/aws-cli:2.4.29 stage: publish - # needs: [ deploy_to_maven_central ] + needs: [ deploy_to_maven_central ] rules: - if: '$POPULATE_CACHE' when: never - # - if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/' - # when: on_success - - when: manual - allow_failure: true + - if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/' + when: on_success script: - | - export VERSION=1.51.3 # hardcoded VERSION for testing (should fail) - # export VERSION=${CI_COMMIT_TAG##v} + export VERSION=${CI_COMMIT_TAG##v} MAVEN_URL="https://repo1.maven.org/maven2/com/datadoghq/dd-java-agent/${VERSION}/dd-java-agent-${VERSION}.jar" echo "Checking URL: $MAVEN_URL" # Wait 30 min for the release to be available @@ -909,13 +906,15 @@ verify_maven_central_deployment: sleep $DELAY TRY=$((TRY + 1)) if [ $TRY -eq $MAX_TRIES ]; then - echo "The release is not available after 30 mins. Manually re-run the job to try again." + echo "The release was not available after 30 mins. Manually re-run the job to try again." exit 1 fi done publishing-gate: - needs: [ verify_maven_central_deployment ] + needs: + - job: verify_maven_central_deployment + optional: true rules: - if: '$POPULATE_CACHE' when: never From 1641dcca1aff3ddd614a6d9fe301a707d49f90cd Mon Sep 17 00:00:00 2001 From: Sarah Chen Date: Tue, 29 Jul 2025 13:55:38 -0400 Subject: [PATCH 09/20] Change image for verify_maven_central_deployment job --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c236084139a..c4b0d7297b3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -882,7 +882,7 @@ package-oci: # Verify Maven Central deployment is publicly available before publishing OCI images verify_maven_central_deployment: - image: registry.ddbuild.io/images/mirror/amazon/aws-cli:2.4.29 + image: registry.ddbuild.io/images/base/gbi-ubuntu_2204:release stage: publish needs: [ deploy_to_maven_central ] rules: From f87c2128d93cd3173079c0d7fe294f5d62c52722 Mon Sep 17 00:00:00 2001 From: Sarah Chen Date: Tue, 29 Jul 2025 14:17:10 -0400 Subject: [PATCH 10/20] Fix verify_maven_central_deployment script --- .gitlab-ci.yml | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c4b0d7297b3..62767c1800d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -893,23 +893,31 @@ verify_maven_central_deployment: script: - | export VERSION=${CI_COMMIT_TAG##v} - MAVEN_URL="https://repo1.maven.org/maven2/com/datadoghq/dd-java-agent/${VERSION}/dd-java-agent-${VERSION}.jar" - echo "Checking URL: $MAVEN_URL" - # Wait 30 min for the release to be available + ARTIFACT_URLS=( + "https://repo1.maven.org/maven2/com/datadoghq/dd-java-agent/${VERSION}/dd-java-agent-${VERSION}.jar" + "https://repo1.maven.org/maven2/com/datadoghq/dd-trace-api/${VERSION}/dd-trace-api-${VERSION}.jar" + "https://repo1.maven.org/maven2/com/datadoghq/dd-trace-ot/${VERSION}/dd-trace-ot-${VERSION}.jar" + ) + # Try every min for 30 mins to see if the release artifacts are available TRY=0 - MAX_TRIES=2 - DELAY=30 + MAX_TRIES=30 + DELAY=60 while [ $TRY -lt $MAX_TRIES ]; do - if curl -s -I "$MAVEN_URL" | grep -q "^HTTP/.* 200"; then + ARTIFACTS_AVAILABLE=true + for URL in "${ARTIFACT_URLS[@]}"; do + if ! curl --location --fail --silent --show-error -I "$URL"; then + ARTIFACTS_AVAILABLE=false + break + fi + done + if [ "$ARTIFACTS_AVAILABLE" = true ]; then break fi sleep $DELAY TRY=$((TRY + 1)) - if [ $TRY -eq $MAX_TRIES ]; then - echo "The release was not available after 30 mins. Manually re-run the job to try again." - exit 1 - fi done + echo "The release was not available after 30 mins. Manually re-run the job to try again." + exit 1 publishing-gate: needs: From 357a0908c034cd9a778aca5d0c9e1e97a1e8ac9b Mon Sep 17 00:00:00 2001 From: Sarah Chen Date: Tue, 29 Jul 2025 14:17:54 -0400 Subject: [PATCH 11/20] Remove publishing-gate rules --- .gitlab-ci.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 62767c1800d..9895449d2a8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -923,13 +923,6 @@ publishing-gate: needs: - job: verify_maven_central_deployment optional: true - rules: - - if: '$POPULATE_CACHE' - when: never - - if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/' - when: on_success - - when: manual - allow_failure: true configure_system_tests: variables: From 74ad6d7d835c98fa5306931176678608ab97af4c Mon Sep 17 00:00:00 2001 From: Sarah Chen Date: Tue, 29 Jul 2025 14:20:11 -0400 Subject: [PATCH 12/20] Test verify job --- .gitlab-ci.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9895449d2a8..7e34b4d6161 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -884,15 +884,16 @@ package-oci: verify_maven_central_deployment: image: registry.ddbuild.io/images/base/gbi-ubuntu_2204:release stage: publish - needs: [ deploy_to_maven_central ] + # needs: [ deploy_to_maven_central ] rules: - if: '$POPULATE_CACHE' when: never - - if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/' - when: on_success + # - if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/' + # when: on_success script: - | - export VERSION=${CI_COMMIT_TAG##v} + export VERSION=1.51.2 + # export VERSION=${CI_COMMIT_TAG##v} ARTIFACT_URLS=( "https://repo1.maven.org/maven2/com/datadoghq/dd-java-agent/${VERSION}/dd-java-agent-${VERSION}.jar" "https://repo1.maven.org/maven2/com/datadoghq/dd-trace-api/${VERSION}/dd-trace-api-${VERSION}.jar" @@ -919,10 +920,10 @@ verify_maven_central_deployment: echo "The release was not available after 30 mins. Manually re-run the job to try again." exit 1 -publishing-gate: - needs: - - job: verify_maven_central_deployment - optional: true +# publishing-gate: +# needs: +# - job: verify_maven_central_deployment +# optional: true configure_system_tests: variables: From 3eb381f40a251d059227adbee9e647bd6c14dfc0 Mon Sep 17 00:00:00 2001 From: Sarah Chen Date: Tue, 29 Jul 2025 14:44:05 -0400 Subject: [PATCH 13/20] Add manual trigger --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7e34b4d6161..17b0e0fcd2d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -888,6 +888,8 @@ verify_maven_central_deployment: rules: - if: '$POPULATE_CACHE' when: never + - when: manual + allow_failure: true # - if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/' # when: on_success script: From 14d512544f40ba6f1cccee7dddba27927db6eb33 Mon Sep 17 00:00:00 2001 From: Sarah Chen Date: Tue, 29 Jul 2025 15:23:15 -0400 Subject: [PATCH 14/20] Fix verify script --- .gitlab-ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 17b0e0fcd2d..0a716da569a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -918,9 +918,11 @@ verify_maven_central_deployment: fi sleep $DELAY TRY=$((TRY + 1)) + if [ $TRY -eq $MAX_TRIES ]; then + echo "The release was not available after 30 mins. Manually re-run the job to try again." + exit 1 + fi done - echo "The release was not available after 30 mins. Manually re-run the job to try again." - exit 1 # publishing-gate: # needs: From 37f96ab9229547647b776bf59b231600dba6353a Mon Sep 17 00:00:00 2001 From: Sarah Chen Date: Tue, 29 Jul 2025 15:26:31 -0400 Subject: [PATCH 15/20] Add test-job to see what happens when verify job fails --- .gitlab-ci.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0a716da569a..c4dba5a7f0e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -923,6 +923,17 @@ verify_maven_central_deployment: exit 1 fi done + # TODO: remove this + echo "The job was successful, but what does test-job do if this job fails?" + exit 1 + +test-job: + stage: publish + needs: + - job: verify_maven_central_deployment + optional: true + script: + - echo "Hello, world!" # publishing-gate: # needs: From 0896be2f705293b759633ce4a49fec2a054caa01 Mon Sep 17 00:00:00 2001 From: Sarah Chen Date: Tue, 29 Jul 2025 18:33:39 -0400 Subject: [PATCH 16/20] Clean test code --- .gitlab-ci.yml | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c4dba5a7f0e..10eed4f7d76 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -884,18 +884,15 @@ package-oci: verify_maven_central_deployment: image: registry.ddbuild.io/images/base/gbi-ubuntu_2204:release stage: publish - # needs: [ deploy_to_maven_central ] + needs: [ deploy_to_maven_central ] rules: - if: '$POPULATE_CACHE' when: never - - when: manual - allow_failure: true - # - if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/' - # when: on_success + - if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/' + when: on_success script: - | - export VERSION=1.51.2 - # export VERSION=${CI_COMMIT_TAG##v} + export VERSION=${CI_COMMIT_TAG##v} ARTIFACT_URLS=( "https://repo1.maven.org/maven2/com/datadoghq/dd-java-agent/${VERSION}/dd-java-agent-${VERSION}.jar" "https://repo1.maven.org/maven2/com/datadoghq/dd-trace-api/${VERSION}/dd-trace-api-${VERSION}.jar" @@ -923,22 +920,11 @@ verify_maven_central_deployment: exit 1 fi done - # TODO: remove this - echo "The job was successful, but what does test-job do if this job fails?" - exit 1 -test-job: - stage: publish +publishing-gate: needs: - job: verify_maven_central_deployment - optional: true - script: - - echo "Hello, world!" - -# publishing-gate: -# needs: -# - job: verify_maven_central_deployment -# optional: true + optional: true # Allow job to run even if the verify_maven_central_deployment job fails configure_system_tests: variables: From 2f8e4e0c57dfaeef6c56c5e345398514090a1f8a Mon Sep 17 00:00:00 2001 From: Sarah Chen Date: Tue, 29 Jul 2025 18:43:29 -0400 Subject: [PATCH 17/20] Change retry rate --- .gitlab-ci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 10eed4f7d76..d70ab727d78 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -898,9 +898,10 @@ verify_maven_central_deployment: "https://repo1.maven.org/maven2/com/datadoghq/dd-trace-api/${VERSION}/dd-trace-api-${VERSION}.jar" "https://repo1.maven.org/maven2/com/datadoghq/dd-trace-ot/${VERSION}/dd-trace-ot-${VERSION}.jar" ) - # Try every min for 30 mins to see if the release artifacts are available + # Wait 5 mins initially, then try 5 times with a minute delay between each retry to see if the release artifacts are available + sleep 300 TRY=0 - MAX_TRIES=30 + MAX_TRIES=5 DELAY=60 while [ $TRY -lt $MAX_TRIES ]; do ARTIFACTS_AVAILABLE=true @@ -913,12 +914,12 @@ verify_maven_central_deployment: if [ "$ARTIFACTS_AVAILABLE" = true ]; then break fi - sleep $DELAY TRY=$((TRY + 1)) if [ $TRY -eq $MAX_TRIES ]; then - echo "The release was not available after 30 mins. Manually re-run the job to try again." + echo "The release was not available after 10 mins. Manually re-run the job to try again." exit 1 fi + sleep $DELAY done publishing-gate: From f2408c79abb37d46949b68aaa7353467b3e0d512 Mon Sep 17 00:00:00 2001 From: Sarah Chen Date: Tue, 29 Jul 2025 18:55:14 -0400 Subject: [PATCH 18/20] Try test-job again --- .gitlab-ci.yml | 40 ++++++++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d70ab727d78..73c074b523c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -884,15 +884,18 @@ package-oci: verify_maven_central_deployment: image: registry.ddbuild.io/images/base/gbi-ubuntu_2204:release stage: publish - needs: [ deploy_to_maven_central ] + # needs: [ deploy_to_maven_central ] rules: - if: '$POPULATE_CACHE' when: never - - if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/' - when: on_success + # - if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/' + # when: on_success + - when: manual + allow_failure: true script: - | - export VERSION=${CI_COMMIT_TAG##v} + export VERSION=1.51.2 + # export VERSION=${CI_COMMIT_TAG##v} ARTIFACT_URLS=( "https://repo1.maven.org/maven2/com/datadoghq/dd-java-agent/${VERSION}/dd-java-agent-${VERSION}.jar" "https://repo1.maven.org/maven2/com/datadoghq/dd-trace-api/${VERSION}/dd-trace-api-${VERSION}.jar" @@ -921,11 +924,36 @@ verify_maven_central_deployment: fi sleep $DELAY done + # TODO: remove this + echo "The job was successful, but what does test-job do if this job fails?" + exit 1 -publishing-gate: +test-job: + stage: publish needs: - job: verify_maven_central_deployment - optional: true # Allow job to run even if the verify_maven_central_deployment job fails + optional: true + rules: + - if: '$POPULATE_CACHE' + when: never + - if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/' + when: on_success + - when: manual + allow_failure: true + script: + - echo "Hello, world!" + +# publishing-gate: +# needs: +# - job: verify_maven_central_deployment +# optional: true +# rules: +# - if: '$POPULATE_CACHE' +# when: never +# - if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/' +# when: on_success +# - when: manual +# allow_failure: true configure_system_tests: variables: From 38f98ef2e447501656c387474ac84768529776df Mon Sep 17 00:00:00 2001 From: Sarah Chen Date: Tue, 29 Jul 2025 20:32:28 -0400 Subject: [PATCH 19/20] Clean again --- .gitlab-ci.yml | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 73c074b523c..7cbf32211b8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -884,18 +884,17 @@ package-oci: verify_maven_central_deployment: image: registry.ddbuild.io/images/base/gbi-ubuntu_2204:release stage: publish - # needs: [ deploy_to_maven_central ] + needs: [ deploy_to_maven_central ] rules: - if: '$POPULATE_CACHE' when: never - # - if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/' - # when: on_success + - if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/' + when: on_success - when: manual allow_failure: true script: - | - export VERSION=1.51.2 - # export VERSION=${CI_COMMIT_TAG##v} + export VERSION=${CI_COMMIT_TAG##v} ARTIFACT_URLS=( "https://repo1.maven.org/maven2/com/datadoghq/dd-java-agent/${VERSION}/dd-java-agent-${VERSION}.jar" "https://repo1.maven.org/maven2/com/datadoghq/dd-trace-api/${VERSION}/dd-trace-api-${VERSION}.jar" @@ -924,12 +923,8 @@ verify_maven_central_deployment: fi sleep $DELAY done - # TODO: remove this - echo "The job was successful, but what does test-job do if this job fails?" - exit 1 -test-job: - stage: publish +publishing-gate: needs: - job: verify_maven_central_deployment optional: true @@ -940,20 +935,6 @@ test-job: when: on_success - when: manual allow_failure: true - script: - - echo "Hello, world!" - -# publishing-gate: -# needs: -# - job: verify_maven_central_deployment -# optional: true -# rules: -# - if: '$POPULATE_CACHE' -# when: never -# - if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/' -# when: on_success -# - when: manual -# allow_failure: true configure_system_tests: variables: From f9652e7ab8add9bd85507b406492eda9a38d7526 Mon Sep 17 00:00:00 2001 From: Laplie Anderson Date: Wed, 13 Aug 2025 13:33:41 -0400 Subject: [PATCH 20/20] Create a separate job to skip the verify maven job --- .gitlab-ci.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7cbf32211b8..bfaee7604f8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -880,6 +880,24 @@ requirements_json_test: package-oci: needs: [ build ] +override_verify_maven_central: + image: registry.ddbuild.io/images/base/gbi-ubuntu_2204:release + stage: publish + needs: [ ] + rules: + - if: '$POPULATE_CACHE' + when: never + - when: manual + allow_failure: true + script: + - touch OVERRIDE_MAVEN_VERIFY + cache: # Cache is used to signal between the override_verify_maven_central and verify_maven_central_deployment jobs + - key: $CI_PIPELINE_ID-OVERRIDE_SIGNAL + paths: + - OVERRIDE_MAVEN_VERIFY + policy: push + unprotect: true + # Verify Maven Central deployment is publicly available before publishing OCI images verify_maven_central_deployment: image: registry.ddbuild.io/images/base/gbi-ubuntu_2204:release @@ -892,7 +910,14 @@ verify_maven_central_deployment: when: on_success - when: manual allow_failure: true + cache: # Cache is used to signal between the override_verify_maven_central and verify_maven_central_deployment jobs + - key: $CI_PIPELINE_ID-OVERRIDE_SIGNAL + paths: + - OVERRIDE_MAVEN_VERIFY + policy: pull + unprotect: true script: + - if [ -f OVERRIDE_MAVEN_VERIFY ]; then echo "SKIPPING MAVEN VERIFICATION"; exit 0; fi - | export VERSION=${CI_COMMIT_TAG##v} ARTIFACT_URLS=(