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

jenkins.branch.Branch is not updated on child projects when corresponding jenkins.branch.BranchSource configuration is changed

      At https://github.com/jenkinsci/branch-api-plugin/blob/branch-api-1.6/src/main/java/jenkins/branch/MultiBranchProject.java#L308 you can see jenkins.branch.Branch#equals(Object) is used to determine whether the Branch needs saved on a project, however it only compares the sourceId and head. https://github.com/jenkinsci/branch-api-plugin/blob/branch-api-1.6/src/main/java/jenkins/branch/Branch.java#L167

      If an existing BranchSource is updated, neither of these fields change, therefore none of the existing child projects get updated.

      For example, if I change the URL of my Git repository and perform an indexing, the URL will not change on the children and they will continue to reference the previous URL.

      Another example, if I do not have the "Discard old builds" property set on the BranchSource, then add it later to keep only 5 builds and reindex, then existing children will continue to keep all builds even after a new build is triggered on that child.

      Only newly created children will receive the new BranchSource configuration.

          [JENKINS-34304] jenkins.branch.Branch is not updated on child projects when corresponding jenkins.branch.BranchSource configuration is changed

          Matthew DeTullio created issue -
          Matthew DeTullio made changes -
          Assignee Original: Stephen Connolly [ stephenconnolly ] New: Matthew DeTullio [ mjdetullio ]
          Matthew DeTullio made changes -
          Remote Link New: This issue links to "PR (Web Link)" [ 14245 ]
          Manuel Recena Soto made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Jesse Glick made changes -
          Link New: This issue duplicates JENKINS-30206 [ JENKINS-30206 ]
          Matthew DeTullio made changes -
          Resolution New: Duplicate [ 3 ]
          Status Original: In Progress [ 3 ] New: Closed [ 6 ]
          Matthew DeTullio made changes -
          Link New: This issue is duplicated by JENKINS-33125 [ JENKINS-33125 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 170384 ] New: JNJira + In-Review [ 209954 ]

            mjdetullio Matthew DeTullio
            mjdetullio Matthew DeTullio
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: