Skip to content

Commit a7da99d

Browse files
authored
Merge branch 'master' into smola/check-no-spotless
2 parents 80745c3 + 0767e3c commit a7da99d

89 files changed

Lines changed: 3374 additions & 473 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/workflows/README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,6 @@ _Action:_ Check the pull request complies with [the contribution guidelines](htt
2828

2929
_Recovery:_ Manually verify the guideline compliance.
3030

31-
### create-next-milestone [🔗](create-next-milestone.yaml)
32-
33-
_Trigger:_ When closing a milestone.
34-
35-
_Action:_ Create a new milestone by incrementing minor version.
36-
37-
_Comment:_ Disabled as also covered by increment-milestone-on-tag.
38-
This will be removed after some testing.
39-
4031
### draft-release-notes-on-tag [🔗](draft-release-notes-on-tag.yaml)
4132

4233
_Trigger:_ When creating a tag, or manually (providing a tag)
@@ -62,6 +53,16 @@ _Recovery:_ Manually [close the related milestone and create a new one](https://
6253

6354
_Notes:_ This action will not apply to release candidate versions using `-RC` tags.
6455

56+
### update-docker-build-image [🔗](update-docker-build-image.yaml)
57+
58+
_Trigger:_ Quarterly released, loosely [a day after the new image tag is created](https://github.com/DataDog/dd-trace-java-docker-build/blob/master/.github/workflows/docker-tag.yml).
59+
60+
_Action:_ Update the Docker build image used in CircleCI and GitLab CI with the latest tag.
61+
62+
_Recovery:_ Download artifacts and upload them manually to the related _download release_.
63+
64+
_Notes:_ Manually trigger the action again given the desired image tag as input.
65+
6566
### update-download-releases [🔗](update-download-releases.yaml)
6667

6768
_Trigger:_ When a release is published.
@@ -103,7 +104,7 @@ _Recovery:_ Manually trigger the action again.
103104

104105
## Code Quality and Security
105106

106-
### analyze-changes [🔗](analyze-changes-with-github-codeql.yaml)
107+
### analyze-changes [🔗](analyze-changes.yaml)
107108

108109
_Trigger:_ When pushing commits to `master` or any pull request targeting `master`.
109110

@@ -121,7 +122,7 @@ _Trigger:_ When creating a PR commits to `master` or a `release/*` branch with a
121122

122123
_Action:_ Notify the PR author through comments that about the Git Submodule update.
123124

124-
### update-gradle-dependencies [🔗](update-gradle-dependencies.yml)
125+
### update-gradle-dependencies [🔗](update-gradle-dependencies.yaml)
125126

126127
_Trigger:_ Every week or manually.
127128

.github/workflows/create-next-milestone.yaml

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Update Docker Build Image
2+
3+
on:
4+
schedule:
5+
# A day after creating the tag from https://github.com/DataDog/dd-trace-java-docker-build/blob/master/.github/workflows/docker-tag.yml
6+
- cron: '0 0 1 2,5,8,11 *'
7+
workflow_dispatch:
8+
inputs:
9+
tag:
10+
description: 'The tag to use for the Docker build image'
11+
required: true
12+
default: 'vYY.MM-base'
13+
14+
jobs:
15+
update-docker-build-image:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: write # Required to commit and push changes to a new branch
19+
pull-requests: write # Required to create a pull request
20+
steps:
21+
- name: Checkout the repository
22+
uses: actions/checkout@v2
23+
- name: Download ghcommit CLI
24+
run: |
25+
curl https://github.com/planetscale/ghcommit/releases/download/v0.1.48/ghcommit_linux_amd64 -o /usr/local/bin/ghcommit -L
26+
chmod +x /usr/local/bin/ghcommit
27+
- name: Pick a branch name
28+
id: define-branch
29+
run: echo "branch=ci/update-docker-build-image-$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
30+
- name: Create branch
31+
run: |
32+
git checkout -b ${{ steps.define-branch.outputs.branch }}
33+
git push -u origin ${{ steps.define-branch.outputs.branch }} --force
34+
- name: Define the Docker build image tage to use
35+
id: define-tag
36+
run: |
37+
if [ -n "${{ github.event.inputs.tag }}" ]; then
38+
TAG=${{ github.event.inputs.tag }}
39+
else
40+
CURRENT_MONTH=$(date +%m)
41+
CURRENT_YEAR=$(date +%y)
42+
case $CURRENT_MONTH in
43+
01) TAG_DATE="$(($CURRENT_YEAR - 1)).10" ;;
44+
02|03|04) TAG_DATE="${CURRENT_YEAR}.01" ;;
45+
05|06|07) TAG_DATE="${CURRENT_YEAR}.04" ;;
46+
08|09|10) TAG_DATE="${CURRENT_YEAR}.07" ;;
47+
11|12) TAG_DATE="${CURRENT_YEAR}.10" ;;
48+
esac
49+
TAG="v${TAG_DATE}-base"
50+
fi
51+
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
52+
echo "::notice::Using Docker build image tag: ${TAG}"
53+
- name: Update the Docker build image in CircleCI config
54+
run: |
55+
sed -i 's|DOCKER_IMAGE_VERSION=.*|DOCKER_IMAGE_VERSION="${{ steps.define-tag.outputs.tag }}"|' .circleci/render_config.py
56+
- name: Update the Docker build image in GitLab CI config
57+
run: |
58+
sed -i 's|image: ghcr.io/datadog/dd-trace-java-docker-build:.*|image: ghcr.io/datadog/dd-trace-java-docker-build:${{ steps.define-tag.outputs.tag }}|' .gitlab-ci.yml
59+
- name: Commit and push changes
60+
env:
61+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
62+
run: |
63+
ghcommit --repository ${{ github.repository }} --branch ${{ steps.define-branch.outputs.branch }} --add .circleci/render_config.py --add .gitlab-ci.yml --message "feat(ci): Update Docker build image"
64+
- name: Create pull request
65+
env:
66+
GH_TOKEN: ${{ github.token }}
67+
run: |
68+
gh pr create --title "Update Docker build image" \
69+
--base master \
70+
--head ${{ steps.define-branch.outputs.branch }} \
71+
--label "comp: tooling" \
72+
--label "type: enhancement" \
73+
--label "tag: no release notes" \
74+
--body "This PR updates the Docker build image to ${{ steps.define-tag.outputs.tag }}."

communication/src/test/groovy/datadog/communication/ddagent/SharedCommunicationsObjectsSpecification.groovy

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import datadog.trace.test.util.DDSpecification
66
import okhttp3.HttpUrl
77
import okhttp3.OkHttpClient
88

9+
import static datadog.trace.api.config.TracerConfig.AGENT_HOST
10+
911
class SharedCommunicationsObjectsSpecification extends DDSpecification {
1012
SharedCommunicationObjects sco = new SharedCommunicationObjects()
1113

@@ -90,4 +92,36 @@ class SharedCommunicationsObjectsSpecification extends DDSpecification {
9092
sco.monitoring.is(monitoring)
9193
sco.featuresDiscovery.is(agentFeaturesDiscovery)
9294
}
95+
96+
void 'supports ipv6 agent host w/o brackets'() {
97+
given:
98+
injectSysConfig(AGENT_HOST, "2600:1f18:19c0:bd07:d55b::17")
99+
Config config = Mock()
100+
101+
when:
102+
sco.createRemaining(config)
103+
104+
then:
105+
1 * config.getAgentUrl() >> 'http://[2600:1f18:19c0:bd07:d55b::17]:8126'
106+
1 * config.agentNamedPipe >> null
107+
1 * config.agentTimeout >> 1
108+
1 * config.agentUnixDomainSocket >> null
109+
sco.agentUrl as String == 'http://[2600:1f18:19c0:bd07:d55b::17]:8126/'
110+
}
111+
112+
void 'supports ipv6 agent host w/ brackets'() {
113+
given:
114+
injectSysConfig(AGENT_HOST, "[2600:1f18:19c0:bd07:d55b::17]")
115+
Config config = Mock()
116+
117+
when:
118+
sco.createRemaining(config)
119+
120+
then:
121+
1 * config.getAgentUrl() >> 'http://[2600:1f18:19c0:bd07:d55b::17]:8126'
122+
1 * config.agentNamedPipe >> null
123+
1 * config.agentTimeout >> 1
124+
1 * config.agentUnixDomainSocket >> null
125+
sco.agentUrl as String == 'http://[2600:1f18:19c0:bd07:d55b::17]:8126/'
126+
}
93127
}

dd-java-agent/agent-crashtracking/src/main/java/com/datadog/crashtracking/ScriptInitializer.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.datadog.crashtracking;
22

3+
import static datadog.trace.util.AgentThreadFactory.AGENT_THREAD_GROUP;
34
import static java.util.Comparator.reverseOrder;
45
import static java.util.Locale.ROOT;
56

@@ -92,6 +93,7 @@ static void writeConfig(Path scriptPath, String... entries) {
9293
Runtime.getRuntime()
9394
.addShutdownHook(
9495
new Thread(
96+
AGENT_THREAD_GROUP,
9597
() -> {
9698
try {
9799
LOG.debug("Deleting config file: {}", cfgPath);

dd-java-agent/agent-debugger/debugger-bootstrap/src/main/java/datadog/trace/bootstrap/debugger/DebuggerContext.java

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,26 @@ public class DebuggerContext {
2121
private static final ThreadLocal<Boolean> IN_PROBE = ThreadLocal.withInitial(() -> Boolean.FALSE);
2222

2323
public enum SkipCause {
24-
RATE,
25-
CONDITION
24+
RATE {
25+
@Override
26+
public String tag() {
27+
return "cause:rate";
28+
}
29+
},
30+
CONDITION {
31+
@Override
32+
public String tag() {
33+
return "cause:condition";
34+
}
35+
},
36+
DEBUG_SESSION_DISABLED {
37+
@Override
38+
public String tag() {
39+
return "cause:debug session disabled";
40+
}
41+
};
42+
43+
public abstract String tag();
2644
}
2745

2846
public interface ProbeResolver {
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package com.datadog.debugger.probe;
2+
3+
public enum DebugSessionStatus {
4+
NONE,
5+
ACTIVE,
6+
DISABLED;
7+
8+
public boolean isDisabled() {
9+
return this == DISABLED;
10+
}
11+
}

0 commit comments

Comments
 (0)