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

Jobs for branches with PRs are removed although they still exist

      For a multibranch pipeline job, we see that branches in the git repo where there is a PR created will be removed when "discard old items" is enabled. This is surprising as the text states:

      Jobs for removed SCM heads (i.e. deleted branches) can be removed immediately or kept based on a desired retention strategy.

      Also, probably related, we have "Exclude branches that are also files as PRs" selected as Discover branches strategy.

      So for a scenario where a PR has been created from branch A, I guess what is happening is that the discover strategy creates a new job for the PR and disables the job for branch A. Then it looks like the discard logic removes the job for branch A. EVen though branch A very much still exists and that is not correct according to the text. Only jobs for branches that have been deleted should be discarded/removed.

      I don't know if the problem is in bitbucket-branch-source-plugin or in branch-api.

          [JENKINS-65275] Jobs for branches with PRs are removed although they still exist

          Anders Hammar created issue -

          Anders Hammar added a comment -

          This behavior is a problem when GitFlow or similar is used as jobs for branches like 'candidate' are removed when changes are "moved" to the next branch (via a PR).

          Anders Hammar added a comment - This behavior is a problem when GitFlow or similar is used as jobs for branches like 'candidate' are removed when changes are "moved" to the next branch (via a PR).
          Anders Hammar made changes -
          Summary Original: Branches with PRs are removed although they still exist New: Jobs for branches with PRs are removed although they still exist

          Anders Hammar added a comment -

          This is a duplicate of JENKINS-52406.

          Anders Hammar added a comment - This is a duplicate of JENKINS-52406 .
          Anders Hammar made changes -
          Link New: This issue duplicates JENKINS-52406 [ JENKINS-52406 ]
          Anders Hammar made changes -
          Environment Original: Jenkins LTS 2.263.4 on RHEL7 with Red Hat OpenJDK 8
          branch-api-plugin 2.6.2
          bitbucket-branch-source-plugin 2.9.7
          New: Jenkins LTS 2.263.4 on RHEL7 with Red Hat OpenJDK 8
          branch-api-plugin 2.6.2
          bitbucket-branch-source-plugin 2.9.7
          scm-api 2.6.4
          Anders Hammar made changes -
          Environment Original: Jenkins LTS 2.263.4 on RHEL7 with Red Hat OpenJDK 8
          branch-api-plugin 2.6.2
          bitbucket-branch-source-plugin 2.9.7
          scm-api 2.6.4
          New: Jenkins LTS 2.263.4 on RHEL7 with Red Hat OpenJDK 8
          branch-api-plugin 2.6.2
          bitbucket-branch-source-plugin 2.9.7
          scm-api-plugin 2.6.4
          Anders Hammar made changes -
          Component/s New: scm-api-plugin [ 18054 ]

            Unassigned Unassigned
            ahammar Anders Hammar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: