Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into vandonr/dsm
Browse files Browse the repository at this point in the history
  • Loading branch information
vandonr committed Jul 31, 2024
2 parents d6e679f + 0bbb077 commit 8b67249
Show file tree
Hide file tree
Showing 188 changed files with 3,561 additions and 1,604 deletions.
9 changes: 9 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@

# Additional Notes

# Contributor Checklist

- [ ] Format the title [according the contribution guidelines](https://github.com/DataDog/dd-trace-java/blob/master/CONTRIBUTING.md#title-format)
- [ ] 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)
- [ ] 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)
- [ ] 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.
Use `solves` instead, and assign the PR [milestone](https://github.com/DataDog/dd-trace-java/milestones) to the issue
- [ ] Update the [public documentation](https://docs.datadoghq.com/tracing/trace_collection/library_config/java/) in case of new configuration flag or behavior

Jira ticket: [PROJ-IDENT]

<!--
Expand Down
14 changes: 0 additions & 14 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,20 +116,6 @@ _Comment:_ To delete?

## Lib Injection

### lib-injection [🔗](lib-injection.yaml)

_Trigger:_ When pushing commits to `master`, release branches or any PR targetting `master`, and when creating tags.

_Actions:_
* Build and publish to GHCR a Docker image with the Java tracer agent,
* Build lib-injection and run its system tests with the build Java agent.

### lib-injection-manual-release [🔗](lib-injection-manual-release.yaml)

_Trigger:_ When manually triggered.

_Action:_ Build and publish to GHCR a Docker image with the given Java tracer version.

### lib-injection-prune-registry [🔗](lib-injection-prune-registry.yaml)

_Trigger:_ Every week or manually.
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/add-milestone-to-pull-requests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@ jobs:
// Pick the milestone with the highest version as title using semver
milestoneNumber = response.data
.map(milestone => {
const versionNumbers = milestone.title.match(/^\d+\.\d+\.\d+$/)
// Parse version title as semver "<major>.<minor>.<patch>"
const versionNumbers = milestone.title.match(/^(\d+)\.(\d+)\.(\d+)$/)
if (versionNumbers == null) {
return null
}
milestone.version = {
majonr: parseInt(versionNumbers[0]),
minor: parseInt(versionNumbers[1]),
patch: parseInt(versionNumbers[2])
major: parseInt(versionNumbers[1]),
minor: parseInt(versionNumbers[2]),
patch: parseInt(versionNumbers[3])
}
return milestone
})
Expand Down
44 changes: 30 additions & 14 deletions .github/workflows/add-release-to-cloudfoundry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,35 @@ jobs:
env:
TAG_NAME: ${{ github.event.release.tag_name }}
run: echo "VERSION=$(echo ${TAG_NAME/#v/})" >> $GITHUB_OUTPUT
- name: Get release URL
id: get-release-url
run: |
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
- name: Wait for the release to be available
run: |
TRY=0
MAX_TRIES=60 # Wait up to 30 minutes
DELAY=30
while [ $TRY -lt $MAX_TRIES ]; do
if curl -s -I ${{ steps.get-release-url.outputs.URL }} | grep -q "200 OK"; then
break
fi
echo "Waiting for the release to be available..."
sleep $DELAY
TRY=$((TRY+1))
if [ $TRY -eq $MAX_TRIES ]; then
echo "The release is not available after 30 mins. Aborting..."
exit 1
fi
done
- name: Append release to Cloud Foundry repository
env:
VERSION: ${{ steps.get-release-version.outputs.VERSION }}
GH_TOKEN: ${{ github.token }}
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git checkout -b ci/cloudfoundry
echo "${VERSION}: https://repo1.maven.org/maven2/com/datadoghq/dd-java-agent/${VERSION}/dd-java-agent-${VERSION}.jar" >> index.yml
git add index.yml
git commit -m "chore: Add version ${VERSION} to Cloud Foundry"
git push -u origin ci/cloudfoundry --force
gh pr create \
--title "Add version ${VERSION} to Cloud Foundry" \
--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." \
--base cloudfoundry
echo "${{ steps.get-release-version.outputs.VERSION }}: ${{ steps.get-release-url.outputs.URL }}" >> index.yml
- name: Commit and push changes
uses: planetscale/ghcommit-action@b68767a2e130a71926b365322e62b583404a5e09 # v0.1.43
with:
commit_message: "chore: Add version ${{ steps.get-release-version.outputs.VERSION }} to Cloud Foundry"
repo: ${{ github.repository }}
branch: cloudfoundry
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
56 changes: 0 additions & 56 deletions .github/workflows/lib-injection-manual-release.yaml

This file was deleted.

96 changes: 0 additions & 96 deletions .github/workflows/lib-injection.yaml

This file was deleted.

46 changes: 40 additions & 6 deletions .github/workflows/update-gradle-dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,26 @@ jobs:
update-gradle-dependencies:
runs-on: ubuntu-latest
name: Update Gradle dependencies
permissions:
# Commit and push changes to a new branch
contents: write
# Create a pull request
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # 4.1.6
with:
submodules: 'recursive'
- 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
run: echo "BRANCH_NAME=ci/update-gradle-dependencies-$(date +'%Y%m%d')" >> $GITHUB_ENV
- name: Create branch
run: |
git checkout -b $BRANCH_NAME
git push -u origin $BRANCH_NAME --force
- name: Update Gradle dependencies
run: |
GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xmx2G -Xms2G'" \
Expand All @@ -27,17 +37,41 @@ jobs:
JAVA_17_HOME=$JAVA_HOME_17_X64 \
JAVA_21_HOME=$JAVA_HOME_21_X64 \
./gradlew resolveAndLockAll --write-locks --parallel --stacktrace --no-daemon --max-workers=4
- name: Commit changes
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
GH_ADD_ARGS=""
COUNT=0
BRANCH_HEAD=$(git rev-parse HEAD)
for lockfile in $(git status --porcelain=v1 | awk '{ print $NF }'); do
echo "Found lockfile: $lockfile"
GH_ADD_ARGS="$GH_ADD_ARGS --add $lockfile"
COUNT=$((COUNT+1))
if [ $COUNT -eq 10 ]; then
echo "Creating a commit to $BRANCH_NAME@$BRANCH_HEAD with $GH_ADD_ARGS"
OUTPUT=$(ghcommit --repository ${{ github.repository }} --branch $BRANCH_NAME --sha $BRANCH_HEAD $GH_ADD_ARGS --message "chore: Update Gradle dependencies" 2>&1)
echo $OUTPUT
if [[ $OUTPUT != *"Success. New commit"* ]]; then
exit 1
fi
BRANCH_HEAD=${OUTPUT##*/}
echo "ghcommit output: $OUTPUT"
GH_ADD_ARGS=""
COUNT=0
fi
done
if [ $COUNT -gt 0 ]; then
echo "Creating a commit to $BRANCH_NAME@$BRANCH_HEAD with $GH_ADD_ARGS"
ghcommit --repository ${{ github.repository }} --branch $BRANCH_NAME --sha $BRANCH_HEAD $GH_ADD_ARGS --message "chore: Update Gradle dependencies"
fi
- name: Create pull request
env:
GH_TOKEN: ${{ github.token }}
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add "**/gradle.lockfile"
git commit -m "chore: Update Gradle dependencies"
git push -u origin $BRANCH_NAME
gh pr create --title "Update Gradle dependencies" \
--body "This PR updates the Gradle dependencies" \
--body "This PR updates the Gradle dependencies. \n:warning: Don't forget to squash commits before merging :warning:" \
--base master \
--head $BRANCH_NAME \
--label "tag: dependencies" \
--label "tag: no release notes"
Loading

0 comments on commit 8b67249

Please sign in to comment.