Skip to content

Commit

Permalink
Merge branch 'master' into cecile/json-logs
Browse files Browse the repository at this point in the history
  • Loading branch information
cecile75 authored Dec 12, 2024
2 parents 4f4a1b0 + fd1f40f commit 8b60eee
Show file tree
Hide file tree
Showing 128 changed files with 3,402 additions and 711 deletions.
16 changes: 13 additions & 3 deletions .circleci/config.continue.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -953,13 +953,23 @@ jobs:
no_output_timeout: 5m
command: |
cd system-tests
DD_SITE=datadoghq.com DD_API_KEY=$SYSTEM_TESTS_E2E_DD_API_KEY DD_APPLICATION_KEY=$SYSTEM_TESTS_E2E_DD_APP_KEY ./run.sh DEBUGGER_SCENARIOS
export DD_API_KEY=$SYSTEM_TESTS_E2E_DD_API_KEY
./run.sh DEBUGGER_SCENARIOS
- run:
name: Collect log files
no_output_timeout: 5m
command: |
mkdir -p logs_debugger
for dir in system-tests/logs*/; do
cp -r "$dir" logs_debugger
done
- store_test_results:
path: system-tests/logs_debugger*
path: logs_debugger
- store_artifacts:
path: system-tests/logs_debugger*
path: logs_debugger
parametric-tests:
machine:
Expand Down
9 changes: 4 additions & 5 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@

# 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.
- 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)
- 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
- 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
12 changes: 10 additions & 2 deletions .github/workflows/check-pull-requests.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Check pull requests
on:
pull_request:
types: [opened, edited, labeled, unlabeled]
types: [opened, edited, ready_for_review, labeled, unlabeled]
branches:
- master
- release/v*
Expand Down Expand Up @@ -38,14 +38,22 @@ jobs:
if (titleCheckFailed) {
core.setFailed('Please remove the tag from the pull request title.')
}
// Check body does
const linkingKeywords = ['closes', 'closed', 'fix', 'fixes', 'fixed', 'resolve', 'resolves', 'resolved']
const body = context.payload.pull_request.body
const bodyCheckFailed = linkingKeywords.some(keyword => body.search(new RegExp(`${keyword}\\s\\d+`, "im")) !== -1)
if (bodyCheckFailed) {
core.setFailed('Please remove the issue linking keyword from the pull request body.')
}
// Add comment to the pull request
if (labelsCheckFailed || titleCheckFailed) {
if (labelsCheckFailed || titleCheckFailed || bodyCheckFailed) {
// Define comment body
const commentMarker = '<!-- dd-trace-java-check-pull-requests-workflow -->'
const commentBody = 'Hi! 👋 Thanks for your pull request! 🎉\n\n' +
'To help us review it, please make sure to:\n\n' +
(labelsCheckFailed ? '* Add at least one type, and one component or instrumentation label to the pull request\n' : '') +
(titleCheckFailed ? '* Remove the tag from the pull request title\n' : '') +
(bodyCheckFailed ? '* Remove the issue linking keyword\n' : '') +
'\nIf you need help, please check our [contributing guidelines](https://github.com/DataDog/dd-trace-java/blob/master/CONTRIBUTING.md).' +
'\n\n' + commentMarker
// Look for previous comment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"number": 7884,
"draft": true,
"labels": [],
"title": "Adding some new features"
"title": "Adding some new features",
"body": "# What Does This Do\n\nThis PR introduces a workflow that checks PRs contributing guidelines."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"name": "type: bug"
}
],
"title": "Adding some new features"
"title": "Adding some new features",
"body": "# What Does This Do\n\nThis PR introduces a workflow that checks PRs contributing guidelines."
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"pull_request": {
"number": 7884,
"draft": false,
"labels": [
{
"name": "comp: api"
},
{
"name": "type: enhancement"
}
],
"title": "Adding some new features",
"body": "# What Does This Do\n\nThis PR introduces a workflow to check that PRs labels and title match the contributing guidelines.\nIt fixes #1234 amoung other issues."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"name": "comp: api"
}
],
"title": "Adding some new features"
"title": "Adding some new features",
"body": "# What Does This Do\n\nThis PR introduces a workflow that checks PRs contributing guidelines."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"name": "tag: no release notes"
}
],
"title": "Adding some new features"
"title": "Adding some new features",
"body": "# What Does This Do\n\nThis PR introduces a workflow that checks PRs contributing guidelines."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"name": "type: enhancement"
}
],
"title": "[API] Adding some new features"
"title": "[API] Adding some new features",
"body": "# What Does This Do\n\nThis PR introduces a workflow that checks PRs contributing guidelines."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"name": "type: enhancement"
}
],
"title": "Adding some new features"
"title": "Adding some new features",
"body": "# What Does This Do\n\nThis PR introduces a workflow that checks PRs contributing guidelines."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ testworkflow pull_request instrumentation && \
testworkflow pull_request draft && \
testworkflow pull_request no-release-notes && \
! testworkflow pull_request missing-label && \
! testworkflow pull_request title-tag
! testworkflow pull_request title-tag && \
! testworkflow pull_request linking-issue
118 changes: 118 additions & 0 deletions components/json/gradle.lockfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# This is a Gradle generated file for dependency locking.
# Manual edits can break the build and are not advised.
# This file is expected to be part of source control.
ch.qos.logback:logback-classic:1.2.3=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
ch.qos.logback:logback-core:1.2.3=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
com.beust:jcommander:1.78=jmhRuntimeClasspath,testRuntimeClasspath
com.github.javaparser:javaparser-core:3.25.1=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
com.github.spotbugs:spotbugs-annotations:4.2.0=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
com.github.spotbugs:spotbugs-annotations:4.7.3=spotbugs
com.github.spotbugs:spotbugs:4.7.3=spotbugs
com.google.code.findbugs:jsr305:3.0.2=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath
com.google.code.gson:gson:2.9.1=spotbugs
com.thoughtworks.qdox:qdox:1.12.1=jmhRuntimeClasspath,testRuntimeClasspath
commons-codec:commons-codec:1.15=spotbugs
de.thetaphi:forbiddenapis:3.1=compileClasspath,jmhCompileClasspath
info.picocli:picocli:4.6.3=jmhRuntimeClasspath,testRuntimeClasspath
jaxen:jaxen:1.2.0=spotbugs
jline:jline:2.14.6=jmhRuntimeClasspath,testRuntimeClasspath
junit:junit:4.13.2=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
net.jcip:jcip-annotations:1.0=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath
net.sf.jopt-simple:jopt-simple:5.0.4=jmh,jmhCompileClasspath,jmhRuntimeClasspath
net.sf.saxon:Saxon-HE:11.4=spotbugs
org.apache.ant:ant-antlr:1.10.12=jmhRuntimeClasspath,testRuntimeClasspath
org.apache.ant:ant-antlr:1.9.15=codenarc
org.apache.ant:ant-junit:1.10.12=jmhRuntimeClasspath,testRuntimeClasspath
org.apache.ant:ant-junit:1.9.15=codenarc
org.apache.ant:ant-launcher:1.10.12=jmhRuntimeClasspath,testRuntimeClasspath
org.apache.ant:ant:1.10.12=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.apache.bcel:bcel:6.5.0=spotbugs
org.apache.commons:commons-lang3:3.12.0=pitest,spotbugs
org.apache.commons:commons-math3:3.2=jmh,jmhCompileClasspath,jmhRuntimeClasspath
org.apache.commons:commons-text:1.10.0=pitest,spotbugs
org.apache.httpcomponents.client5:httpclient5:5.1.3=spotbugs
org.apache.httpcomponents.core5:httpcore5-h2:5.1.3=spotbugs
org.apache.httpcomponents.core5:httpcore5:5.1.3=spotbugs
org.apache.logging.log4j:log4j-api:2.19.0=spotbugs
org.apache.logging.log4j:log4j-core:2.19.0=spotbugs
org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath
org.codehaus.groovy:groovy-all:3.0.17=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.codehaus.groovy:groovy-ant:2.5.14=codenarc
org.codehaus.groovy:groovy-ant:3.0.17=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.codehaus.groovy:groovy-astbuilder:3.0.17=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.codehaus.groovy:groovy-cli-picocli:3.0.17=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.codehaus.groovy:groovy-console:3.0.17=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.codehaus.groovy:groovy-datetime:3.0.17=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.codehaus.groovy:groovy-docgenerator:3.0.17=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.codehaus.groovy:groovy-groovydoc:2.5.14=codenarc
org.codehaus.groovy:groovy-groovydoc:3.0.17=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.codehaus.groovy:groovy-groovysh:3.0.17=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.codehaus.groovy:groovy-jmx:3.0.17=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.codehaus.groovy:groovy-json:2.5.14=codenarc
org.codehaus.groovy:groovy-json:3.0.17=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.codehaus.groovy:groovy-jsr223:3.0.17=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.codehaus.groovy:groovy-macro:3.0.17=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.codehaus.groovy:groovy-nio:3.0.17=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.codehaus.groovy:groovy-servlet:3.0.17=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.codehaus.groovy:groovy-sql:3.0.17=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.codehaus.groovy:groovy-swing:3.0.17=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.codehaus.groovy:groovy-templates:2.5.14=codenarc
org.codehaus.groovy:groovy-templates:3.0.17=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.codehaus.groovy:groovy-test-junit5:3.0.17=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.codehaus.groovy:groovy-test:3.0.17=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.codehaus.groovy:groovy-testng:3.0.17=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.codehaus.groovy:groovy-xml:2.5.14=codenarc
org.codehaus.groovy:groovy-xml:3.0.17=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.codehaus.groovy:groovy:2.5.14=codenarc
org.codehaus.groovy:groovy:3.0.17=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.codenarc:CodeNarc:2.2.0=codenarc
org.dom4j:dom4j:2.1.3=spotbugs
org.gmetrics:GMetrics:1.1=codenarc
org.hamcrest:hamcrest-core:1.3=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.hamcrest:hamcrest:2.2=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.jacoco:org.jacoco.agent:0.8.5=jacocoAgent,jacocoAnt
org.jacoco:org.jacoco.ant:0.8.5=jacocoAnt
org.jacoco:org.jacoco.core:0.8.5=jacocoAnt
org.jacoco:org.jacoco.report:0.8.5=jacocoAnt
org.junit.jupiter:junit-jupiter-api:5.9.2=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.junit.jupiter:junit-jupiter-engine:5.9.2=jmhRuntimeClasspath,testRuntimeClasspath
org.junit.jupiter:junit-jupiter-params:5.9.2=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.junit.jupiter:junit-jupiter:5.9.2=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.junit.platform:junit-platform-commons:1.9.2=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.junit.platform:junit-platform-engine:1.9.2=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.junit.platform:junit-platform-launcher:1.9.2=jmhRuntimeClasspath,testRuntimeClasspath
org.junit:junit-bom:5.9.1=spotbugs
org.junit:junit-bom:5.9.2=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.objenesis:objenesis:3.3=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.openjdk.jmh:jmh-core:1.36=jmh,jmhCompileClasspath,jmhRuntimeClasspath
org.openjdk.jmh:jmh-generator-asm:1.36=jmh,jmhCompileClasspath,jmhRuntimeClasspath
org.openjdk.jmh:jmh-generator-bytecode:1.36=jmh,jmhCompileClasspath,jmhRuntimeClasspath
org.openjdk.jmh:jmh-generator-reflection:1.36=jmh,jmhCompileClasspath,jmhRuntimeClasspath
org.opentest4j:opentest4j:1.2.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.ow2.asm:asm-analysis:7.2=jacocoAnt
org.ow2.asm:asm-analysis:9.4=spotbugs
org.ow2.asm:asm-commons:7.2=jacocoAnt
org.ow2.asm:asm-commons:9.4=spotbugs
org.ow2.asm:asm-tree:7.2=jacocoAnt
org.ow2.asm:asm-tree:9.4=spotbugs
org.ow2.asm:asm-util:9.4=spotbugs
org.ow2.asm:asm:7.2=jacocoAnt
org.ow2.asm:asm:9.0=jmh,jmhCompileClasspath,jmhRuntimeClasspath
org.ow2.asm:asm:9.4=spotbugs
org.pitest:pitest-command-line:1.9.11=pitest
org.pitest:pitest-entry:1.9.11=pitest
org.pitest:pitest:1.9.11=pitest
org.slf4j:jcl-over-slf4j:1.7.30=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.slf4j:jul-to-slf4j:1.7.30=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.slf4j:log4j-over-slf4j:1.7.30=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.slf4j:slf4j-api:1.7.30=testCompileClasspath
org.slf4j:slf4j-api:1.7.32=jmhRuntimeClasspath,testRuntimeClasspath
org.slf4j:slf4j-api:2.0.0=spotbugs,spotbugsSlf4j
org.slf4j:slf4j-simple:2.0.0=spotbugsSlf4j
org.spockframework:spock-core:2.2-groovy-3.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.spockframework:spock-junit4:2.2-groovy-3.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.testng:testng:7.5=jmhRuntimeClasspath,testRuntimeClasspath
org.webjars:jquery:3.5.1=jmhRuntimeClasspath,testRuntimeClasspath
org.xmlresolver:xmlresolver:4.4.3=spotbugs
xml-apis:xml-apis:1.4.01=spotbugs
empty=annotationProcessor,jmhAnnotationProcessor,runtimeClasspath,spotbugsPlugins,testAnnotationProcessor
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ public SkippableTests getSkippableTests(TracerEnvironment tracerEnvironment) thr
for (DataDto<TestIdentifierJson> dataDto : response.data) {
TestIdentifierJson testIdentifierJson = dataDto.getAttributes();
Configurations conf = testIdentifierJson.getConfigurations();
String moduleName = (conf != null ? conf : requestConf).getTestBundle();
String moduleName =
(conf != null && conf.getTestBundle() != null ? conf : requestConf).getTestBundle();
testIdentifiersByModule
.computeIfAbsent(moduleName, k -> new HashMap<>())
.put(testIdentifierJson.toTestIdentifier(), testIdentifierJson.toTestMetadata());
Expand Down Expand Up @@ -211,12 +212,15 @@ public Map<String, Collection<TestIdentifier>> getFlakyTestsByModule(

LOGGER.debug("Received {} flaky tests in total", response.size());

Configurations requestConf = tracerEnvironment.getConfigurations();

int flakyTestsCount = 0;
Map<String, Collection<TestIdentifier>> testIdentifiers = new HashMap<>();
for (DataDto<TestIdentifierJson> dataDto : response) {
TestIdentifierJson testIdentifierJson = dataDto.getAttributes();
Configurations configurations = testIdentifierJson.getConfigurations();
String moduleName = configurations.getTestBundle();
Configurations conf = testIdentifierJson.getConfigurations();
String moduleName =
(conf != null && conf.getTestBundle() != null ? conf : requestConf).getTestBundle();
testIdentifiers
.computeIfAbsent(moduleName, k -> new HashSet<>())
.add(testIdentifierJson.toTestIdentifier());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package datadog.trace.civisibility.domain;

import static datadog.trace.api.TracePropagationStyle.NONE;
import static datadog.trace.api.civisibility.CIConstants.CI_VISIBILITY_INSTRUMENTATION_NAME;

import datadog.trace.api.Config;
Expand All @@ -17,9 +18,11 @@
import datadog.trace.api.civisibility.telemetry.tag.IsHeadless;
import datadog.trace.api.civisibility.telemetry.tag.IsUnsupportedCI;
import datadog.trace.api.civisibility.telemetry.tag.Provider;
import datadog.trace.api.sampling.PrioritySampling;
import datadog.trace.bootstrap.instrumentation.api.AgentSpan;
import datadog.trace.bootstrap.instrumentation.api.AgentTracer;
import datadog.trace.bootstrap.instrumentation.api.InternalSpanTypes;
import datadog.trace.bootstrap.instrumentation.api.TagContext;
import datadog.trace.bootstrap.instrumentation.api.Tags;
import datadog.trace.civisibility.codeowners.Codeowners;
import datadog.trace.civisibility.decorator.TestDecorator;
Expand Down Expand Up @@ -65,7 +68,16 @@ public AbstractTestSession(
// CI Test Cycle protocol requires session's trace ID and span ID to be the same
IdGenerationStrategy idGenerationStrategy = config.getIdGenerationStrategy();
DDTraceId traceId = idGenerationStrategy.generateTraceId();
AgentSpan.Context traceContext = new TraceContext(traceId);
AgentSpan.Context traceContext =
new TagContext(
CIConstants.CIAPP_TEST_ORIGIN,
Collections.emptyMap(),
null,
null,
PrioritySampling.UNSET,
null,
NONE,
traceId);

AgentTracer.SpanBuilder spanBuilder =
AgentTracer.get()
Expand Down
Loading

0 comments on commit 8b60eee

Please sign in to comment.