GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Missing PR number in CiVisibilityRepoServices implementation · Issue #9295 · DataDog/dd-trace-java

Missing PR number in CiVisibilityRepoServices implementation #9295

New issue
Copy link
New issue
Copy link
Closed
Closed
Missing PR number in CiVisibilityRepoServices implementation#9295
Copy link
Assignees
nikita-tkachenko-datadog
Labels
type: bug reportBug report

Description

@mlschechter
mlschechter
opened on Aug 1, 2025
Issue body actions

Tracer Version(s)

1.51.2~d5ad1fed74

Java Version(s)

11

JVM Vendor

Eclipse Adoptium / Temurin

Bug Report

In our test executions when test optimization is enabled, we see the following log output:

[dd.trace 2025-08-01 15:44:35:190 +0000] [main] INFO datadog.trace.civisibility.CiVisibilityRepoServices - PR detected: PR{baseBranch='master', baseSHA='<BASE_SHA>', commitSHA='<COMMIT_SHA>', prNumber='null'}

We are using the test optimization GitHub Action as follows in our workflow on our GitHub Enterprise Server instance:

      - name: 'Configure Datadog Test Optimization'
        uses: datadog/test-visibility-github-action@v2
        with: { languages: 'java', api_key: '<DD_API_KEY>', service: 'service-name-here' }

Expected Behavior

It is expected that when running tests against a pull request, the PR metadata will be obtained from the Git provider and populated with all available data. In this case, the PR number is available (as demonstrated in the GithubActionsInfo implementation), so our expectation is that CiVisibilityRepoServices would obtain and use the same information. It appears an instance of CIProviderInfo is available in the execution context for use.

Reproduction Code

The code in CiVisibilityRepoServices explicitly sets the prNumber field to null via the PullRequestInfo constructor.

Activity

  1. mlschechter
    added
    type: bug fixBug fix
    on Aug 1, 2025
  2. nikita-tkachenko-datadog commented on Aug 1, 2025

    @nikita-tkachenko-datadog
    nikita-tkachenko-datadog
    on Aug 1, 2025
    Contributor
    More actions

    Hi @mlschechter, thank you for reporting this issue. It is addressed in #9210 that will be released with v1.52.0 scheduled for the 4th of August

    Reacted by Michael Schechter
  3. mlschechter commented on Aug 1, 2025

    @mlschechter
    mlschechter
    on Aug 1, 2025
    Author
    More actions

    @nikita-tkachenko-datadog - Thanks for the quick response!

    I'm a bit confused as to how that PR (which was merged to master) will fix the issue, as I am seeing the explicit null assignment in the code there.

    Is there something I'm missing?

  4. nikita-tkachenko-datadog commented on Aug 1, 2025

    @nikita-tkachenko-datadog
    nikita-tkachenko-datadog
    on Aug 1, 2025
    Contributor
    More actions

    The buildUserPullRequestInfo method creates PR info from environment variables that are manually set by the users (DD_GIT_PULL_REQUEST_BASE_BRANCH and DD_GIT_PULL_REQUEST_BASE_BRACH_SHA). This is a workaround for the CI providers where PR info cannot be extracted automatically. We do not support manually providing PR number (although we probably should), hence the explicit null assignment in that method.

    The caller of this method -buildPullRequestInfo - also calls ciProviderInfo.buildPullRequestInfo() to get PR information supplied by the CI provider. The results of the two calls are merged, with the manually provided info having higher priority.

    The relevant change in the PR is done in the GithubActionsInfo class:

    Double number = (Double) pullRequest.get("number");
    if (number != null) {
      prNumber = String.valueOf(number.intValue());
    }
    
  5. nikita-tkachenko-datadog
    self-assigned this
    on Aug 1, 2025
  6. mlschechter commented on Aug 1, 2025

    @mlschechter
    mlschechter
    on Aug 1, 2025
    Author
    More actions

    Got it - thanks for the clarification!

    If I'm following correctly, that change is used here, and will overwrite the explicit null I found in the earlier generation of userInfo.

    Please let me know if I should close this issue out.

  7. nikita-tkachenko-datadog commented on Aug 4, 2025

    @nikita-tkachenko-datadog
    nikita-tkachenko-datadog
    on Aug 4, 2025
    Contributor
    More actions

    Exactly, your understanding is correct!
    I will go ahead and close the issue, feel free to reopen if the upcoming release doesn't fix it

  8. nikita-tkachenko-datadog
    closed this as completedon Aug 4, 2025
  9. PerfectSlayer
    added
    type: bug reportBug report
    and removed
    type: bug fixBug fix
    on Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @nikita-tkachenko-datadog
    nikita-tkachenko-datadog

Labels

type: bug reportBug report

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.