From 4cd7d59662962e0369f4e206d52d05d2c22499bb Mon Sep 17 00:00:00 2001 From: Severin Neumann Date: Mon, 18 Nov 2024 11:45:26 +0100 Subject: [PATCH] Add maven to registry auto update workflow (#5586) Signed-off-by: svrnm Co-authored-by: opentelemetrybot <107717825+opentelemetrybot@users.noreply.github.com> --- .github/workflows/scripts/update-registry-versions.sh | 10 ++++++++++ data/registry/instrumentation-java-finatra.yml | 3 +++ 2 files changed, 13 insertions(+) diff --git a/.github/workflows/scripts/update-registry-versions.sh b/.github/workflows/scripts/update-registry-versions.sh index b07947730b13..dd59e96f2ac1 100755 --- a/.github/workflows/scripts/update-registry-versions.sh +++ b/.github/workflows/scripts/update-registry-versions.sh @@ -3,6 +3,7 @@ UPDATE_YAML="yq eval -i" GIT=git GH=gh +NPM=npm FILES="${FILES:-./data/registry/*.yml}" @@ -16,6 +17,7 @@ elif [[ "$1" != "-f" ]]; then UPDATE_YAML="yq eval" GIT="echo > DRY RUN: git " GH="echo > DRY RUN: gh " + NPM="echo > DRY RUN: npm " else # Local execution with -f flag (force real vs. dry run) shift @@ -59,6 +61,12 @@ for yaml_file in ${FILES}; do hex) curl -s "https://hex.pm/api/packages/$package_name" | jq -r '.releases | max_by(.inserted_at) | .version' ;; + maven) + groupid=$(echo "${package_name}" | cut -d/ -f1) + artifactid=$(echo "${package_name}" | cut -d/ -f2) + #curl -s "https://search.maven.org/solrsearch/select?q=g:com.google.inject+AND+a:guice&core=gav&rows=20&wt=json" | jq -r '.response.docs[0].v' + curl -s "https://search.maven.org/solrsearch/select?q=g:${groupid}+AND+a:${artifactid}&core=gav&rows=20&wt=json" | jq -r '.response.docs[0].v' + ;; *) echo "Registry not supported." ;; @@ -110,6 +118,8 @@ if [ "$existing_pr_count" -gt 0 ]; then exit 0 fi +$NPM run fix:format + $GIT checkout -b "$branch" $GIT commit -a -m "$message" $GIT push --set-upstream origin "$branch" diff --git a/data/registry/instrumentation-java-finatra.yml b/data/registry/instrumentation-java-finatra.yml index 9b30cddd09f7..7ac01897981a 100644 --- a/data/registry/instrumentation-java-finatra.yml +++ b/data/registry/instrumentation-java-finatra.yml @@ -15,3 +15,6 @@ urls: repo: https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/finatra-2.9 createdAt: 2020-11-05 isFirstParty: false +package: + registry: maven + name: io.opentelemetry.javaagent.instrumentation/opentelemetry-javaagent-finatra-2.9