Git Product home page Git Product logo

Comments (4)

adjshort avatar adjshort commented on September 6, 2024

I've noticed the same thing.

For us, it looks like pipelines using multibranch pipelines don't pick up the branch name, where the few that do have a branch tag set are just using the Git plugin to check out a repository.

If I've followed the flow correctly,

public static String resolveGitBranch(Map<String, String> envVars, BuildData buildData) {
if(StringUtils.isNotEmpty(envVars.get(DD_GIT_BRANCH))){
return envVars.get(DD_GIT_BRANCH);
} else if (StringUtils.isNotEmpty(envVars.get(GIT_BRANCH))){
return envVars.get(GIT_BRANCH);
} else if(buildData != null){
return buildData.getBranch("");
} else {
return null;
}
}
is using the environment variables DD_GIT_BRANCH and GIT_BRANCH, but not the one the multibranch pipeline plugin sets, BRANCH_NAME

from datadog-plugin.

kivagant-ba avatar kivagant-ba commented on September 6, 2024

If the DD_GIT_BRANCH is specified in a Jenkinsfile environment variable equal to BRANCH_NAME, will the plugin pick it up?

from datadog-plugin.

chill389cc avatar chill389cc commented on September 6, 2024

Did you ever figure out this issue?

from datadog-plugin.

drmaciej avatar drmaciej commented on September 6, 2024

I actually cannot remember how I fixed it, but I do see the branch tag on both metrics and events, running the latest Jenkins version and the latest DD plugin version.

iirc one of the plugin versions had a fix for this issue and it just started working without any other intervention.

from datadog-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.