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

CHANGE_BRANCH no longer reporting branch name, but instead PR

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Labels:
      None
    • Environment:
      Jenkins 2.90 on CentOS 7
      bitbucket-branch-source-plugin 2.2.7
      bitbucket server 5.4.1
      git 2.9.5
    • Similar Issues:
    • Released As:
      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

            Hide
            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.

            Show
            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.
            Hide
            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.

             

            Show
            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.  
            Hide
            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} 

            Show
            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} 
            Hide
            helias_criouet Helias Criouet added a comment - - edited

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

            Show
            helias_criouet Helias Criouet added a comment - - edited Any update on that still existing blocker issue? Rein Achten seems to have done some useful investigation work in his comment. Does it seem reasonable to you Stephen Connolly ?
            Hide
            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

            Show
            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

              • Assignee:
                casz Joseph Petersen
                Reporter:
                therealwaldo Will Freeman
              • Votes:
                27 Vote for this issue
                Watchers:
                29 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: