Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-47617

CHANGE_BRANCH no longer reporting branch name, but instead PR

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Blocker
    • Resolution: Fixed
    • None
    • Jenkins 2.90 on CentOS 7
      bitbucket-branch-source-plugin 2.2.7
      bitbucket server 5.4.1
      git 2.9.5
    • 2.2.13

    Description

      CHANGE_BRANCH, mentioned in JENKINS-41104 was working at some point in the recent past.  It has now reverted to being equal to BRANCH_NAME which in the case of a pull request is PR-n

      Expected behaviour, according to JENKINS-41104, is that when a PR is being built, CHANGE_BRANCH returns the source branch.

      CHANGE_TARGET is returning correctly (with the target branch), so it does appear the plugin is aware of builds from pull requests.

       

      Attachments

        Issue Links

          Activity

            Any update on this one? I just ran in this issue. No idea how to solve it as I am new to Jenkins.

            bastianbrodbeck Bastian Brodbeck added a comment - Any update on this one? I just ran in this issue. No idea how to solve it as I am new to Jenkins.
            amirbarkal Amir Barkal added a comment -

            +1

             

            Another problem this issue is causing happens when you open the pull requests tab, you don't see the name of the branch anymore, you only see the PR number:

             

            In blue ocean you see the PR name which is nice, but it would be nicer to also clearly see the branch name of the PR.

             

            amirbarkal Amir Barkal added a comment - +1   Another problem this issue is causing happens when you open the pull requests tab, you don't see the name of the branch anymore, you only see the PR number:   In blue ocean you see the PR name which is nice, but it would be nicer to also clearly see the branch name of the PR.  

            I think someone should at least answer this. It has little meaning to have the CHANGE_BRANCH  set to PR-{number} 

            migraintheknot Daniel Svedberg added a comment - I think someone should at least answer this. It has little meaning to have the CHANGE_BRANCH  set to PR-{number} 
            helias_criouet Helias Criouet added a comment - - edited

            Any update on that still existing blocker issue? reac seems to have done some useful investigation work in his comment. Does it seem reasonable to you stephenconnolly?

            helias_criouet Helias Criouet added a comment - - edited Any update on that still existing blocker issue? reac seems to have done some useful investigation work in his comment. Does it seem reasonable to you stephenconnolly ?
            fasmat Matthias F added a comment - - edited

            Even in version 2.2.14 this issue is still present. CHANGE_BRANCH still contains the PR-XX number instead of the name of the branch.

            EDIT: my bad, 2.2.14 breaks in our setup because of this issue: https://issues.jenkins-ci.org/browse/JENKINS-54401 with 2.2.13 it works

            fasmat Matthias F added a comment - - edited Even in version 2.2.14 this issue is still present. CHANGE_BRANCH still contains the PR-XX number instead of the name of the branch. EDIT: my bad, 2.2.14 breaks in our setup because of this issue: https://issues.jenkins-ci.org/browse/JENKINS-54401 with 2.2.13 it works

            People

              jetersen Joseph Petersen
              therealwaldo Will Freeman
              Votes:
              27 Vote for this issue
              Watchers:
              29 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: