Skip to content

Add scenario duplicates for dd-trace-java with forced v1 protocol - #7439

Open
AlexeyKuznetsov-DD wants to merge 17 commits into
mainfrom
alexeyk/default-v1-protocol-tests
Open

Add scenario duplicates for dd-trace-java with forced v1 protocol#7439
AlexeyKuznetsov-DD wants to merge 17 commits into
mainfrom
alexeyk/default-v1-protocol-tests

Conversation

@AlexeyKuznetsov-DD

@AlexeyKuznetsov-DD AlexeyKuznetsov-DD commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Motivation

Validate the v1 trace intake protocol in dd-trace-java before it becomes the tracer default, while retaining the existing v0.x jobs as a baseline. The coverage should exercise the complete scenario set for a selected weblog instead.

Changes

  • Add a generic _duplicate_jobs utility that selects weblogs by name and duplicates every generated job/shard for them, preserving each job's complete scenario list.
  • Configure Java prod to duplicate only spring-boot-jetty jobs, suffix their instances with _v1, and set DD_TRACE_AGENT_PROTOCOL_VERSION=1.0 on the weblog container.
  • Keep the original spring-boot-jetty jobs unchanged so the same coverage continues to run with v0.x.
  • Pass generic per-job weblog environment overrides through the reusable end-to-end workflow and apply them to the library container.
  • Make the duplication mechanism reusable for other tracers, weblogs, or protocol versions, including future legacy-protocol coverage.
  • Remove the obsolete DD_APM_ENABLE_V1_TRACE_ENDPOINT setting from APM_TRACING_EFFICIENT_PAYLOAD; current Agents expose the v1 endpoint by default.

Impact

The additional v1 coverage is limited to Java prod jobs for spring-boot-jetty. Java dev, other Java weblogs, and all other tracers keep their existing matrices unchanged. Because selection happens by weblog name, every current or future spring-boot-jetty shard is duplicated automatically.

Validation

  • All GitHub Actions checks passed, including the original and _v1 Java prod spring-boot-jetty jobs.
  • All GitLab/DDCI checks passed.
  • ./run.sh TEST_THE_TEST tests/test_the_test/test_ci_orchestrator.py tests/test_the_test/test_docker_scenario.py::test_load_environment_overrides tests/test_the_test/test_build_pipeline.py tests/test_the_test/test_gitlab_pipeline_structure.py — 23 passed.
  • Focused Ruff and mypy checks passed.
  • The generated Java prod matrix was verified to pair every selected spring-boot-jetty job with an equivalent _v1 duplicate carrying the protocol override.

Workflow

  1. ⚠️ Create your PR as draft ⚠️
  2. Work on you PR until the CI passes
  3. Mark it as ready for review
    • Test logic is modified? -> Get a review from RFC owner.
    • Framework is modified, or non obvious usage of it -> get a review from R&P team

🚀 Once your PR is reviewed and the CI green, you can merge it!

🛟 #apm-shared-testing 🛟

Reviewer checklist

  • Anything but tests/ or manifests/ is modified ? I have the approval from R&P team
  • A docker base image is modified?
    • the relevant build-XXX-image label is present
  • A scenario is added, removed or renamed?

@AlexeyKuznetsov-DD AlexeyKuznetsov-DD self-assigned this Aug 3, 2026
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

CODEOWNERS have been resolved as:

.github/workflows/run-end-to-end.yml                                    @DataDog/system-tests-core
.github/workflows/system-tests.yml                                      @DataDog/system-tests-core
tests/test_the_test/test_ci_orchestrator.py                             @DataDog/system-tests-core
tests/test_the_test/test_docker_scenario.py                             @DataDog/system-tests-core
tests/test_the_test/test_gitlab_pipeline_structure.py                   @DataDog/system-tests-core
utils/_context/_scenarios/__init__.py                                   @DataDog/system-tests-core
utils/_context/_scenarios/endtoend.py                                   @DataDog/system-tests-core
utils/ci/gitlab/build_pipeline.py                                       @DataDog/system-tests-core
utils/ci/gitlab/system-tests.yml.j2                                     @DataDog/system-tests-core
utils/scripts/ci_orchestrators/workflow_data.py                         @DataDog/system-tests-core

@datadog-prod-us1-3

datadog-prod-us1-3 Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🔄 Datadog auto-retried 1 job - 1 passed on retry View in Datadog

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 5c7252b | Docs | Datadog PR Page | Give us feedback!

@AlexeyKuznetsov-DD AlexeyKuznetsov-DD changed the title Add DEFAULT_V1 scenario for Java and Go Add DEFAULT_V1 scenario for tracers that support v1 protocol, but not yet use it by default Aug 3, 2026
@AlexeyKuznetsov-DD
AlexeyKuznetsov-DD force-pushed the alexeyk/default-v1-protocol-tests branch from 3b4ecdc to ef40c24 Compare August 5, 2026 19:55
@AlexeyKuznetsov-DD AlexeyKuznetsov-DD changed the title Add DEFAULT_V1 scenario for tracers that support v1 protocol, but not yet use it by default Add scenarios duplicates for dd-trace-java with forced v1 protocol. Aug 5, 2026
@AlexeyKuznetsov-DD AlexeyKuznetsov-DD changed the title Add scenarios duplicates for dd-trace-java with forced v1 protocol. Add scenario duplicates for dd-trace-java with forced v1 protocol Aug 5, 2026
@AlexeyKuznetsov-DD
AlexeyKuznetsov-DD marked this pull request as ready for review August 11, 2026 21:09
@AlexeyKuznetsov-DD
AlexeyKuznetsov-DD requested a review from a team as a code owner August 11, 2026 21:09

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7381053080

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +412 to +416
_duplicate_jobs(
jobs,
weblog_names=("spring-boot-jetty",),
name_suffix="_v1",
weblog_env={"DD_TRACE_AGENT_PROTOCOL_VERSION": "1.0"},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve duplicated jobs in GitLab rendering

For any GitLab Java prod run containing spring-boot-jetty, utils/ci/gitlab/build_pipeline.py flattens these jobs to (weblog, scenario, build_required) and discards both weblog_instance and weblog_env. The original and _v1 copies therefore produce identical top-level keys in system-tests.yml.j2 (for example, system_tests_run_java_DEFAULT_spring-boot-jetty twice), while neither job receives DD_TRACE_AGENT_PROTOCOL_VERSION; the generated pipeline may reject or collapse the duplicate definitions and cannot provide the intended v1 coverage. Preserve the suffix and environment in the GitLab renderer, or avoid generating these copies for that backend.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 5c7252b

Comment thread utils/scripts/ci_orchestrators/workflow_data.py
Comment on lines +410 to +412
if library == "java" and ci_environment == "prod":
jobs.extend(
_duplicate_jobs(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reserve matrix capacity before adding v1 jobs

When splitting already consumes maximum_parallel_jobs, extending the list afterward violates that limit. With the current Java end-to-end scenarios, desired_execution_time=1 and maximum_parallel_jobs=256 return 273 serialized jobs because 17 Jetty shards are duplicated after capping; .github/workflows/system-tests.yml feeds the entire list directly into one matrix, exceeding its configured capacity. Reserve slots for duplicates before splitting or reapply the cap after duplication.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 5c7252b

@cbeauchesne cbeauchesne left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made few RC, but the biggest one is on how the duplication is performed.

For maintainability and complexity reasons, we think that the duplication should be handled inside the CI orchestrator, but directly in workflow call.

It'll be too complex to explain in the PR, let's discuss all of that tomorrow in our meeting with @nccatoni.

default: false
required: false
type: boolean
weblog_env:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename this into force_v1_traces (type boolean, default false).

This option should be populated threw different system-tests layers, and handled into WeblogInfra.configure

SYSTEM_TESTS_FORCE_EXECUTE: ${{ inputs.force_execute }}
SYSTEM_TESTS_DEV_MODE: ${{ inputs._system_tests_dev_mode }}
SYSTEM_TESTS_WEBLOG: ${{ inputs.weblog }}
SYSTEM_TESTS_WEBLOG_ENV: ${{ inputs.weblog_env }}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
SYSTEM_TESTS_WEBLOG_ENV: ${{ inputs.weblog_env }}
SYSTEM_TESTS_FORCE_v1_TRACES: ${{ inputs.force_v1_traces }}

{% endfor %}
{% for variant, scenario, build_required in scenario_pairs %}
system_tests_run_{{library}}_{{scenario}}_{{variant}}:
{% for job in scenario_jobs %}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove any gitlab stuff, we'll handle it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants