Skip to content

Commit 8b67249

Browse files
committed
Merge remote-tracking branch 'origin/master' into vandonr/dsm
2 parents d6e679f + 0bbb077 commit 8b67249

188 files changed

Lines changed: 3561 additions & 1604 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/pull_request_template.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44

55
# Additional Notes
66

7+
# Contributor Checklist
8+
9+
- [ ] Format the title [according the contribution guidelines](https://github.com/DataDog/dd-trace-java/blob/master/CONTRIBUTING.md#title-format)
10+
- [ ] Assign the `type:` and (`comp:` or `inst:`) labels in addition to [any usefull labels](https://github.com/DataDog/dd-trace-java/blob/master/CONTRIBUTING.md#labels)
11+
- [ ] Squash your commits prior merging or merge using GitHub's [Squash and merge](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/about-pull-request-merges#squash-and-merge-your-commits)
12+
- [ ] Don't use `close`, `fix` or any [linking keywords](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword) when referencing an issue.
13+
Use `solves` instead, and assign the PR [milestone](https://github.com/DataDog/dd-trace-java/milestones) to the issue
14+
- [ ] Update the [public documentation](https://docs.datadoghq.com/tracing/trace_collection/library_config/java/) in case of new configuration flag or behavior
15+
716
Jira ticket: [PROJ-IDENT]
817

918
<!--

.github/workflows/README.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -116,20 +116,6 @@ _Comment:_ To delete?
116116

117117
## Lib Injection
118118

119-
### lib-injection [🔗](lib-injection.yaml)
120-
121-
_Trigger:_ When pushing commits to `master`, release branches or any PR targetting `master`, and when creating tags.
122-
123-
_Actions:_
124-
* Build and publish to GHCR a Docker image with the Java tracer agent,
125-
* Build lib-injection and run its system tests with the build Java agent.
126-
127-
### lib-injection-manual-release [🔗](lib-injection-manual-release.yaml)
128-
129-
_Trigger:_ When manually triggered.
130-
131-
_Action:_ Build and publish to GHCR a Docker image with the given Java tracer version.
132-
133119
### lib-injection-prune-registry [🔗](lib-injection-prune-registry.yaml)
134120

135121
_Trigger:_ Every week or manually.

.github/workflows/add-milestone-to-pull-requests.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,15 @@ jobs:
3434
// Pick the milestone with the highest version as title using semver
3535
milestoneNumber = response.data
3636
.map(milestone => {
37-
const versionNumbers = milestone.title.match(/^\d+\.\d+\.\d+$/)
37+
// Parse version title as semver "<major>.<minor>.<patch>"
38+
const versionNumbers = milestone.title.match(/^(\d+)\.(\d+)\.(\d+)$/)
3839
if (versionNumbers == null) {
3940
return null
4041
}
4142
milestone.version = {
42-
majonr: parseInt(versionNumbers[0]),
43-
minor: parseInt(versionNumbers[1]),
44-
patch: parseInt(versionNumbers[2])
43+
major: parseInt(versionNumbers[1]),
44+
minor: parseInt(versionNumbers[2]),
45+
patch: parseInt(versionNumbers[3])
4546
}
4647
return milestone
4748
})

.github/workflows/add-release-to-cloudfoundry.yaml

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,35 @@ jobs:
1616
env:
1717
TAG_NAME: ${{ github.event.release.tag_name }}
1818
run: echo "VERSION=$(echo ${TAG_NAME/#v/})" >> $GITHUB_OUTPUT
19+
- name: Get release URL
20+
id: get-release-url
21+
run: |
22+
echo "URL=https://repo1.maven.org/maven2/com/datadoghq/dd-java-agent/${{ steps.get-release-version.outputs.VERSION }}/dd-java-agent-${{ steps.get-release-version.outputs.VERSION }}.jar" >> $GITHUB_OUTPUT
23+
- name: Wait for the release to be available
24+
run: |
25+
TRY=0
26+
MAX_TRIES=60 # Wait up to 30 minutes
27+
DELAY=30
28+
while [ $TRY -lt $MAX_TRIES ]; do
29+
if curl -s -I ${{ steps.get-release-url.outputs.URL }} | grep -q "200 OK"; then
30+
break
31+
fi
32+
echo "Waiting for the release to be available..."
33+
sleep $DELAY
34+
TRY=$((TRY+1))
35+
if [ $TRY -eq $MAX_TRIES ]; then
36+
echo "The release is not available after 30 mins. Aborting..."
37+
exit 1
38+
fi
39+
done
1940
- name: Append release to Cloud Foundry repository
20-
env:
21-
VERSION: ${{ steps.get-release-version.outputs.VERSION }}
22-
GH_TOKEN: ${{ github.token }}
2341
run: |
24-
git config user.name "github-actions[bot]"
25-
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
26-
git checkout -b ci/cloudfoundry
27-
echo "${VERSION}: https://repo1.maven.org/maven2/com/datadoghq/dd-java-agent/${VERSION}/dd-java-agent-${VERSION}.jar" >> index.yml
28-
git add index.yml
29-
git commit -m "chore: Add version ${VERSION} to Cloud Foundry"
30-
git push -u origin ci/cloudfoundry --force
31-
gh pr create \
32-
--title "Add version ${VERSION} to Cloud Foundry" \
33-
--body "This PR add the version ${VERSION} to Cloud Foundry. Make sure [the JAR is online](https://repo1.maven.org/maven2/com/datadoghq/dd-java-agent/${VERSION}/dd-java-agent-${VERSION}.jar) before merging." \
34-
--base cloudfoundry
42+
echo "${{ steps.get-release-version.outputs.VERSION }}: ${{ steps.get-release-url.outputs.URL }}" >> index.yml
43+
- name: Commit and push changes
44+
uses: planetscale/ghcommit-action@b68767a2e130a71926b365322e62b583404a5e09 # v0.1.43
45+
with:
46+
commit_message: "chore: Add version ${{ steps.get-release-version.outputs.VERSION }} to Cloud Foundry"
47+
repo: ${{ github.repository }}
48+
branch: cloudfoundry
49+
env:
50+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/lib-injection-manual-release.yaml

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

.github/workflows/lib-injection.yaml

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

.github/workflows/update-gradle-dependencies.yaml

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,26 @@ jobs:
88
update-gradle-dependencies:
99
runs-on: ubuntu-latest
1010
name: Update Gradle dependencies
11+
permissions:
12+
# Commit and push changes to a new branch
13+
contents: write
14+
# Create a pull request
15+
pull-requests: write
1116
steps:
1217
- name: Checkout repository
1318
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # 4.1.6
1419
with:
1520
submodules: 'recursive'
21+
- name: Download ghcommit CLI
22+
run: |
23+
curl https://github.com/planetscale/ghcommit/releases/download/v0.1.48/ghcommit_linux_amd64 -o /usr/local/bin/ghcommit -L
24+
chmod +x /usr/local/bin/ghcommit
1625
- name: Pick a branch name
1726
run: echo "BRANCH_NAME=ci/update-gradle-dependencies-$(date +'%Y%m%d')" >> $GITHUB_ENV
1827
- name: Create branch
1928
run: |
2029
git checkout -b $BRANCH_NAME
30+
git push -u origin $BRANCH_NAME --force
2131
- name: Update Gradle dependencies
2232
run: |
2333
GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xmx2G -Xms2G'" \
@@ -27,17 +37,41 @@ jobs:
2737
JAVA_17_HOME=$JAVA_HOME_17_X64 \
2838
JAVA_21_HOME=$JAVA_HOME_21_X64 \
2939
./gradlew resolveAndLockAll --write-locks --parallel --stacktrace --no-daemon --max-workers=4
40+
- name: Commit changes
41+
env:
42+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
43+
run: |
44+
GH_ADD_ARGS=""
45+
COUNT=0
46+
BRANCH_HEAD=$(git rev-parse HEAD)
47+
for lockfile in $(git status --porcelain=v1 | awk '{ print $NF }'); do
48+
echo "Found lockfile: $lockfile"
49+
GH_ADD_ARGS="$GH_ADD_ARGS --add $lockfile"
50+
COUNT=$((COUNT+1))
51+
if [ $COUNT -eq 10 ]; then
52+
echo "Creating a commit to $BRANCH_NAME@$BRANCH_HEAD with $GH_ADD_ARGS"
53+
OUTPUT=$(ghcommit --repository ${{ github.repository }} --branch $BRANCH_NAME --sha $BRANCH_HEAD $GH_ADD_ARGS --message "chore: Update Gradle dependencies" 2>&1)
54+
echo $OUTPUT
55+
if [[ $OUTPUT != *"Success. New commit"* ]]; then
56+
exit 1
57+
fi
58+
BRANCH_HEAD=${OUTPUT##*/}
59+
echo "ghcommit output: $OUTPUT"
60+
GH_ADD_ARGS=""
61+
COUNT=0
62+
fi
63+
done
64+
if [ $COUNT -gt 0 ]; then
65+
echo "Creating a commit to $BRANCH_NAME@$BRANCH_HEAD with $GH_ADD_ARGS"
66+
ghcommit --repository ${{ github.repository }} --branch $BRANCH_NAME --sha $BRANCH_HEAD $GH_ADD_ARGS --message "chore: Update Gradle dependencies"
67+
fi
3068
- name: Create pull request
3169
env:
3270
GH_TOKEN: ${{ github.token }}
3371
run: |
34-
git config user.name "github-actions[bot]"
35-
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
36-
git add "**/gradle.lockfile"
37-
git commit -m "chore: Update Gradle dependencies"
38-
git push -u origin $BRANCH_NAME
3972
gh pr create --title "Update Gradle dependencies" \
40-
--body "This PR updates the Gradle dependencies" \
73+
--body "This PR updates the Gradle dependencies. \n:warning: Don't forget to squash commits before merging :warning:" \
4174
--base master \
75+
--head $BRANCH_NAME \
4276
--label "tag: dependencies" \
4377
--label "tag: no release notes"

0 commit comments

Comments
 (0)