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

Merged PRs not being removed from multibranch

    Details

    • Similar Issues:

      Description

      We are using Github Organization Folder (via github-branch-source-plugin) + basic-branch-build-strategies.

       

      When a PR gets merged in, it is still active in Jenkins. Merged in PRs or deleted PRs/branches should be removed. This might be an issue with the basic-branch-build-strategies plugin?

       

      Our current "Orphaned Item Strategy" looks like this:

      Re-scanning the organization has no effect unfortunately.

        Attachments

          Activity

          Hide
          stephenconnolly Stephen Connolly added a comment -

          The most likely reason is somebody is requesting that the build logs be kept: https://github.com/jenkinsci/cloudbees-folder-plugin/blob/f313065f5fb613c4fedf78627a9cddee7a600388/src/main/java/com/cloudbees/hudson/plugins/folder/computed/DefaultOrphanedItemStrategy.java#L252-L271 and if you request the build logs be kept then we'll honour that request

          Show
          stephenconnolly Stephen Connolly added a comment - The most likely reason is somebody is requesting that the build logs be kept: https://github.com/jenkinsci/cloudbees-folder-plugin/blob/f313065f5fb613c4fedf78627a9cddee7a600388/src/main/java/com/cloudbees/hudson/plugins/folder/computed/DefaultOrphanedItemStrategy.java#L252-L271 and if you request the build logs be kept then we'll honour that request
          Hide
          stephenconnolly Stephen Connolly added a comment -

          Marking as incomplete until more info is provided... likely this is build logs being requested to be kept in which case functioning as designed

          Show
          stephenconnolly Stephen Connolly added a comment - Marking as incomplete until more info is provided... likely this is build logs being requested to be kept in which case functioning as designed
          Hide
          lifeofguenter Gunter Grodotzki added a comment -

          Aaaah, thanks so much for this. Actually it never gets to that, because it is crashing earlier: https://issues.jenkins-ci.org/browse/JENKINS-52397?focusedCommentId=353950&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-353950

           

          I am not quite sure though if this is happening from the github-branch plugin (discovering tags) or build-strategies.

           

          On another installation where I am not having above issue, but the same issue that PRs/Branches/Tags are not being removed, however I do not see any mention of "Evaluating orphaned..." in the logs:

          Branch indexing
          [Fri Nov 16 09:46:02 UTC 2018] Starting branch indexing...
          Connecting to https://api.github.com using lifeofguenter/****** (github-lifeofguenter-jenkins_sudo)
          Examining lifeofguenter/jenkinsfile-test
          
            Checking branches...
          
            Getting remote branches...
          
              Checking branch master
          
            Getting remote pull requests...
                ‘Jenkinsfile’ found
              Met criteria
          No changes detected: master (still at 4c0116442a6e632994ccf58c9af2fde9b6f01049)
          
              Checking branch foobarb
          
              Checking branch test-shared-lib
          
              Checking branch test-tag
          
            4 branches were processed
          
            Checking pull-requests...
          
              Checking pull request #13
                ‘Jenkinsfile’ found
              Met criteria
          No changes detected: PR-13 (still at e7990d4573285eff2e0c0bdb2b94e82214b59386)
          
            1 pull requests were processed
          
            Checking tags...
          
            Getting remote tags...
          
              Checking tag 0.0.1
                ‘Jenkinsfile’ found
              Met criteria
          Changes detected: 0.0.1 (null → 8254b3af7e2278babc999943dfcc414810ab4121)
          No automatic builds for 0.0.1
          
              Checking tag 0.0.2
                ‘Jenkinsfile’ found
              Met criteria
          Changes detected: 0.0.2 (null → 8254b3af7e2278babc999943dfcc414810ab4121)
          No automatic builds for 0.0.2
          
              Checking tag 0.0.3
                ‘Jenkinsfile’ found
              Met criteria
          Changes detected: 0.0.3 (null → 8254b3af7e2278babc999943dfcc414810ab4121)
          No automatic builds for 0.0.3
          
              Checking tag 0.0.4
                ‘Jenkinsfile’ found
              Met criteria
          No changes detected: 0.0.4 (still at 4c0116442a6e632994ccf58c9af2fde9b6f01049)
          
            4 tags were processed
          
          Finished examining lifeofguenter/jenkinsfile-test
          
          [Fri Nov 16 09:46:05 UTC 2018] Finished branch indexing. Indexing took 2.9 sec
          Finished: SUCCESS

           

          Show
          lifeofguenter Gunter Grodotzki added a comment - Aaaah, thanks so much for this. Actually it never gets to that, because it is crashing earlier: https://issues.jenkins-ci.org/browse/JENKINS-52397?focusedCommentId=353950&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-353950   I am not quite sure though if this is happening from the github-branch plugin (discovering tags) or build-strategies.   On another installation where I am not having above issue, but the same issue that PRs/Branches/Tags are not being removed, however I do not see any mention of "Evaluating orphaned..." in the logs: Branch indexing [Fri Nov 16 09:46:02 UTC 2018] Starting branch indexing... Connecting to https://api.github.com using lifeofguenter/****** (github-lifeofguenter-jenkins_sudo) Examining lifeofguenter/jenkinsfile-test Checking branches... Getting remote branches... Checking branch master Getting remote pull requests... ‘Jenkinsfile’ found Met criteria No changes detected: master (still at 4c0116442a6e632994ccf58c9af2fde9b6f01049) Checking branch foobarb Checking branch test-shared-lib Checking branch test-tag 4 branches were processed Checking pull-requests... Checking pull request #13 ‘Jenkinsfile’ found Met criteria No changes detected: PR-13 (still at e7990d4573285eff2e0c0bdb2b94e82214b59386) 1 pull requests were processed Checking tags... Getting remote tags... Checking tag 0.0.1 ‘Jenkinsfile’ found Met criteria Changes detected: 0.0.1 (null → 8254b3af7e2278babc999943dfcc414810ab4121) No automatic builds for 0.0.1 Checking tag 0.0.2 ‘Jenkinsfile’ found Met criteria Changes detected: 0.0.2 (null → 8254b3af7e2278babc999943dfcc414810ab4121) No automatic builds for 0.0.2 Checking tag 0.0.3 ‘Jenkinsfile’ found Met criteria Changes detected: 0.0.3 (null → 8254b3af7e2278babc999943dfcc414810ab4121) No automatic builds for 0.0.3 Checking tag 0.0.4 ‘Jenkinsfile’ found Met criteria No changes detected: 0.0.4 (still at 4c0116442a6e632994ccf58c9af2fde9b6f01049) 4 tags were processed Finished examining lifeofguenter/jenkinsfile-test [Fri Nov 16 09:46:05 UTC 2018] Finished branch indexing. Indexing took 2.9 sec Finished: SUCCESS  
          Hide
          stephenconnolly Stephen Connolly added a comment -

          Does the other one have an orphaned strategy configured?

          Show
          stephenconnolly Stephen Connolly added a comment - Does the other one have an orphaned strategy configured?
          Hide
          lifeofguenter Gunter Grodotzki added a comment -

          Yes it does. Same settings - e.g. "1 day"

          Show
          lifeofguenter Gunter Grodotzki added a comment - Yes it does. Same settings - e.g. "1 day"

            People

            • Assignee:
              Unassigned
              Reporter:
              lifeofguenter Gunter Grodotzki
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: