Skip to content

Support multiple lang-branch overrides in PR title#6468

Open
bm1549 wants to merge 4 commits intomainfrom
brian.marks/multi-branch-override
Open

Support multiple lang-branch overrides in PR title#6468
bm1549 wants to merge 4 commits intomainfrom
brian.marks/multi-branch-override

Conversation

@bm1549
Copy link
Contributor

@bm1549 bm1549 commented Mar 11, 2026

Motivation

The system-tests CI supports specifying a tracer branch override in the PR title like [java@my-branch], but it only supported one branch override at a time. This made it impossible to test PRs that need changes from multiple tracer libraries simultaneously (e.g. [java@branch1][dotnet@branch2]).

Changes

  • get_target_branch action: Rewrote in Python (shell: python) with setup-python action. Captures all [lang@branch] pairs from the PR title and outputs them as a JSON map (e.g. {"java":"branch1","dotnet":"branch2"}). Added a has-target-branch boolean output. Renamed output from target-branch to target-branch-map.
  • compute-workflow-parameters.yml: Rewrote the extract step in Python. Extracts the specific library's branch from the JSON map before passing it to load-binary.sh. Also extracts the agent branch separately for proper AGENT_TARGET_BRANCH env var support. Renamed input from _system_tests_library_target_branch to _system_tests_library_target_branch_map. Removed legacy plain-string backward compatibility (not needed since this is a private _system_tests parameter).
  • compute_libraries_and_scenarios.yml: Exposed the new target-branch-map and has-target-branch outputs.
  • system-tests.yml: Renamed input from _system_tests_library_target_branch to _system_tests_library_target_branch_map.
  • ci.yml: Updated the "Fail if target branch is specified" check to use the new has-target-branch output. Updated to use renamed target-branch-map output and _system_tests_library_target_branch_map input.
  • docs/CI/github-actions.md: Updated parameter documentation.

Examples

PR Title Parsed Output
My PR [java@branch1] {"java":"branch1"}
My PR [java@b1][dotnet@b2] {"java":"b1","dotnet":"b2"}
My PR [java@b1][golang@b2][ruby@b3] {"java":"b1","golang":"b2","ruby":"b3"}
My PR (no override) empty

Proven in CI

This logic has been validated in PR #6466, which uses 7 simultaneous branch overrides:
[java@brian.marks/add-ksr-tag][dotnet@brian.marks/add-ksr-tag][ruby@brian.marks/add-ksr-tag][nodejs@brian.marks/add-ksr-tag][cpp@brian.marks/fix-ksr-formatting][rust@brian.marks/add-ksr-tag][golang@brian.marks/fix-ksr-default]

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?

🤖 Generated with Claude Code

Previously, specifying a tracer branch override in the PR title (e.g.
[java@my-branch]) only supported a single override at a time. This
change allows multiple overrides like [java@branch1][dotnet@branch2]
so that different libraries can each use their own dev branch.

The get_target_branch action now outputs a JSON map of library to
branch, and the compute-workflow-parameters workflow extracts the
correct branch for each library before passing it to load-binary.sh.
Backward compatibility with plain branch strings is preserved.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@bm1549 bm1549 added the ai-generated The pull request includes a significant amount of AI-generated code label Mar 11, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 11, 2026

CODEOWNERS have been resolved as:

.github/actions/get_target_branch/action.yaml                           @DataDog/system-tests-core
.github/workflows/ci.yml                                                @DataDog/system-tests-core
.github/workflows/compute-workflow-parameters.yml                       @DataDog/system-tests-core
.github/workflows/compute_libraries_and_scenarios.yml                   @DataDog/system-tests-core
.github/workflows/system-tests.yml                                      @DataDog/system-tests-core
docs/CI/github-actions.md                                               @DataDog/system-tests-core
docs/CI/system-tests-ci.md                                              @DataDog/system-tests-core

@bm1549 bm1549 changed the title Support multiple [lang@branch] overrides in PR title Support multiple lang-branch overrides in PR title Mar 11, 2026
Update target branch selection docs to reflect that multiple
[lang@branch] pairs can now be specified simultaneously in the PR
title. Update the workflow parameter description to note JSON map
support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@bm1549 bm1549 marked this pull request as ready for review March 13, 2026 18:04
@bm1549 bm1549 requested a review from a team as a code owner March 13, 2026 18:04
Copy link

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

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: c04ec34d65

ℹ️ 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".

Copy link
Collaborator

@cbeauchesne cbeauchesne left a comment

Choose a reason for hiding this comment

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

Few small request changes.

Side note, do you have a run proving that both a single and a multiple title lamrker works as expected ?

@bm1549
Copy link
Contributor Author

bm1549 commented Mar 19, 2026

Side note, do you have a run proving that both a single and a multiple title lamrker works as expected ?

@cbeauchesne yep! You can check the runs on #6466 where I used this to iterate across several languages

- Rewrite bash scripts to Python (shell: python) in get_target_branch
  and compute-workflow-parameters extract step
- Rename target-branch -> target-branch-map across all workflows
- Rename _system_tests_library_target_branch -> _system_tests_library_target_branch_map
- Remove legacy plain-string backward compatibility path
- Add setup-python action for get_target_branch
- Update docs accordingly

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bm1549 bm1549 requested a review from cbeauchesne March 19, 2026 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated The pull request includes a significant amount of AI-generated code changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants