diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 69f9e9a6bb9..d215dfd58fc 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -130,6 +130,14 @@ _Action:_ Build the Java Client Library and runs [the system tests](https://gith _Recovery:_ Manually trigger the action on the desired branch. +### update-jmxfetch-submodule [🔗](update-jmxfetch-submodule.yaml) + +_Trigger:_ Monthly or manually + +_Action:_ Creates a PR updating the git submodule at dd-java-agent/agent-jmxfetch/integrations-core + +_Recovery:_ Manually trigger the action again. + ## Maintenance GitHub actions should be part of the [repository allowed actions to run](https://github.com/DataDog/dd-trace-java/settings/actions). diff --git a/.github/workflows/update-jmxfetch-submodule.yaml b/.github/workflows/update-jmxfetch-submodule.yaml new file mode 100644 index 00000000000..9cd38cf906c --- /dev/null +++ b/.github/workflows/update-jmxfetch-submodule.yaml @@ -0,0 +1,44 @@ +name: Update jmxfetch integrations submodule + +on: + schedule: + - cron: '0 0 1 * *' + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2 + + - name: Update Submodule + run: | + git submodule update --remote -- dd-java-agent/agent-jmxfetch/integrations-core + - name: Download ghcommit CLI + run: | + curl https://github.com/planetscale/ghcommit/releases/download/v0.1.48/ghcommit_linux_amd64 -o /usr/local/bin/ghcommit -L + chmod +x /usr/local/bin/ghcommit + - name: Pick a branch name + id: define-branch + run: echo "branch=ci/update-jmxfetch-submodule-$(date +'%Y%m%d')" >> $GITHUB_OUTPUT + - name: Create branch + run: | + git checkout -b ${{ steps.define-branch.outputs.branch }} + git push -u origin ${{ steps.define-branch.outputs.branch }} --force + - name: Commit and push changes + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + run: | + ghcommit --repository ${{ github.repository }} --branch ${{ steps.define-branch.outputs.branch }} --add dd-java-agent/agent-jmxfetch/integrations-core --message "Update agent-jmxfetch submodule" + - name: Create pull request + env: + GH_TOKEN: ${{ github.token }} + run: | + gh pr create --title "Update agent-jmxfetch submodule" \ + --base master \ + --head ${{ steps.define-branch.outputs.branch }} \ + --label "comp: tooling" \ + --label "type: enhancement" \ + --label "tag: no release notes" \ + --body "This PR updates the agent-jmxfetch submodule." diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b4f0e0ca785..ef27135cc58 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -138,6 +138,8 @@ default: KUBERNETES_MEMORY_LIMIT: 8Gi CACHE_TYPE: lib #default RUNTIME_AVAILABLE_PROCESSORS_OVERRIDE: 4 # Runtime.getRuntime().availableProcessors() returns incorrect or very high values in Kubernetes + GIT_SUBMODULE_STRATEGY: normal + GIT_SUBMODULE_DEPTH: 1 cache: - key: '$CI_SERVER_VERSION-$CACHE_TYPE' # Dependencies cache. Reset the cache every time gitlab is upgraded. ~Every couple months paths: diff --git a/dd-java-agent/agent-jmxfetch/build.gradle b/dd-java-agent/agent-jmxfetch/build.gradle index 1f3ae4adb9b..d1805237afe 100644 --- a/dd-java-agent/agent-jmxfetch/build.gradle +++ b/dd-java-agent/agent-jmxfetch/build.gradle @@ -97,7 +97,6 @@ tasks.register('copyMetricConfigs', CopyMetricConfigsTask) { description 'Copy metrics.yaml files from integrations-core into resources' inputDirectory = file("$projectDir/integrations-core") outputDirectory = file("$buildDir/integrations-core-resources") - dependsOn 'submodulesUpdate' } processResources {