Skip to content

Commit 90125af

Browse files
Don't update jmxfetch integrations submodule during build (#9150)
* Remove submodule update as part of build * add GH action to update submodule * fetch submodules * updates with better understanding of submodule issues
1 parent 766af68 commit 90125af

File tree

4 files changed

+54
-1
lines changed

4 files changed

+54
-1
lines changed

.github/workflows/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,14 @@ _Action:_ Build the Java Client Library and runs [the system tests](https://gith
130130

131131
_Recovery:_ Manually trigger the action on the desired branch.
132132

133+
### update-jmxfetch-submodule [🔗](update-jmxfetch-submodule.yaml)
134+
135+
_Trigger:_ Monthly or manually
136+
137+
_Action:_ Creates a PR updating the git submodule at dd-java-agent/agent-jmxfetch/integrations-core
138+
139+
_Recovery:_ Manually trigger the action again.
140+
133141
## Maintenance
134142

135143
GitHub actions should be part of the [repository allowed actions to run](https://github.com/DataDog/dd-trace-java/settings/actions).
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Update jmxfetch integrations submodule
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 1 * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
14+
15+
- name: Update Submodule
16+
run: |
17+
git submodule update --remote -- dd-java-agent/agent-jmxfetch/integrations-core
18+
- name: Download ghcommit CLI
19+
run: |
20+
curl https://github.com/planetscale/ghcommit/releases/download/v0.1.48/ghcommit_linux_amd64 -o /usr/local/bin/ghcommit -L
21+
chmod +x /usr/local/bin/ghcommit
22+
- name: Pick a branch name
23+
id: define-branch
24+
run: echo "branch=ci/update-jmxfetch-submodule-$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
25+
- name: Create branch
26+
run: |
27+
git checkout -b ${{ steps.define-branch.outputs.branch }}
28+
git push -u origin ${{ steps.define-branch.outputs.branch }} --force
29+
- name: Commit and push changes
30+
env:
31+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
32+
run: |
33+
ghcommit --repository ${{ github.repository }} --branch ${{ steps.define-branch.outputs.branch }} --add dd-java-agent/agent-jmxfetch/integrations-core --message "Update agent-jmxfetch submodule"
34+
- name: Create pull request
35+
env:
36+
GH_TOKEN: ${{ github.token }}
37+
run: |
38+
gh pr create --title "Update agent-jmxfetch submodule" \
39+
--base master \
40+
--head ${{ steps.define-branch.outputs.branch }} \
41+
--label "comp: tooling" \
42+
--label "type: enhancement" \
43+
--label "tag: no release notes" \
44+
--body "This PR updates the agent-jmxfetch submodule."

.gitlab-ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ default:
141141
CACHE_COMPRESSION_LEVEL: "slowest"
142142

143143
RUNTIME_AVAILABLE_PROCESSORS_OVERRIDE: 4 # Runtime.getRuntime().availableProcessors() returns incorrect or very high values in Kubernetes
144+
GIT_SUBMODULE_STRATEGY: normal
145+
GIT_SUBMODULE_DEPTH: 1
144146
cache:
145147
- key: dependency-$CACHE_TYPE # Dependencies cache
146148
paths:

dd-java-agent/agent-jmxfetch/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ tasks.register('copyMetricConfigs', CopyMetricConfigsTask) {
9797
description 'Copy metrics.yaml files from integrations-core into resources'
9898
inputDirectory = file("$projectDir/integrations-core")
9999
outputDirectory = file("$buildDir/integrations-core-resources")
100-
dependsOn 'submodulesUpdate'
101100
}
102101

103102
processResources {

0 commit comments

Comments
 (0)