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

Deleting Jenkinsfile does not remove a repository from an organization folder

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: branch-api-plugin
    • Labels:
    • Environment:
      Jenkins 1.642.4 + Github Organization Folder Plugin 1.2
      GitHub Enterprise in private mode.
    • Similar Issues:

      Description

      If I remove all Jenkinsfile from a GitHub repository (all branches) then the repository is still left in the folder. The contents of the repository are empty (i.e. no branches are shown).

      The same happens if I delete or transfer a repository to a another group/owner.

      I expected the repository to disappear if there are no longer any Jenkinsfile or if the repository doesn't exist.

        Attachments

          Activity

          Hide
          allan_burdajewicz Allan BURDAJEWICZ added a comment -

          This is the expected behavior if the Discard Policy is either disabled or enabled for several days. I believe the ability to remove a repository job is an improvement to consider.

          Show
          allan_burdajewicz Allan BURDAJEWICZ added a comment - This is the expected behavior if the Discard Policy is either disabled or enabled for several days. I believe the ability to remove a repository job is an improvement to consider.
          Hide
          recena Manuel Recena Soto added a comment -

          Christian Höltje What configuration are you using as Orphaned Item Strategy?

          Show
          recena Manuel Recena Soto added a comment - Christian Höltje What configuration are you using as Orphaned Item Strategy ?
          Hide
          jglick Jesse Glick added a comment -

          I expected the repository to disappear if there are no longer any Jenkinsfile or if the repository doesn't exist.

          That is what should happen, provided the organization folder is using the default orphaned item strategy (both zeros). If reproducible, probably a bug in branch-api but would need investigation.

          Show
          jglick Jesse Glick added a comment - I expected the repository to disappear if there are no longer any Jenkinsfile or if the repository doesn't exist. That is what should happen, provided the organization folder is using the default orphaned item strategy (both zeros). If reproducible, probably a bug in branch-api but would need investigation.
          Hide
          recena Manuel Recena Soto added a comment -

          Jesse Glick I'm waiting for information from Christian Höltje in order to confirm if there is a bug o not. I can not reproduce it.

          Show
          recena Manuel Recena Soto added a comment - Jesse Glick I'm waiting for information from Christian Höltje in order to confirm if there is a bug o not. I can not reproduce it.
          Hide
          docwhat Christian Höltje added a comment -

          Okay so:

          1. It looks like it doesn't schedule a re-scan or anything when a new repository is added. I'm not sure that is expected or not.
          2. On a manual Re-Scan it picked up the new repository with a Jenkinsfile.
          3. Again, it didn't schedule a re-scan on repository deletion. I'm not sure if that is expected or not.
          4. On a manual Re-Scan it removed the repository.

          So it looks like my original bug was fixed at some point. Not sure about responding to events... It'd be tricky for the adds – e.g. I could see scheduling a rescan in, say, 5 minutes (to give the user time to add a Jenkinsfile).

          Deletion can probably be scheduled immediately.

          Show
          docwhat Christian Höltje added a comment - Okay so: It looks like it doesn't schedule a re-scan or anything when a new repository is added. I'm not sure that is expected or not. On a manual Re-Scan it picked up the new repository with a Jenkinsfile. Again, it didn't schedule a re-scan on repository deletion. I'm not sure if that is expected or not. On a manual Re-Scan it removed the repository. So it looks like my original bug was fixed at some point. Not sure about responding to events... It'd be tricky for the adds – e.g. I could see scheduling a rescan in, say, 5 minutes (to give the user time to add a Jenkinsfile). Deletion can probably be scheduled immediately.
          Hide
          docwhat Christian Höltje added a comment -

          Oh, and my orphan strategy was set to "Number to keep" at 0.

          Show
          docwhat Christian Höltje added a comment - Oh, and my orphan strategy was set to "Number to keep" at 0.
          Hide
          escoem Emilio Escobar added a comment -

          Hi Manuel Recena Soto I'm facing this issue, please let me try to reproduce again and post the steps before closing this ticket. Thanks.

          Show
          escoem Emilio Escobar added a comment - Hi Manuel Recena Soto I'm facing this issue, please let me try to reproduce again and post the steps before closing this ticket. Thanks.
          Hide
          recena Manuel Recena Soto added a comment -

          Emilio Escobar I cannot reproduce it. If you are facing this issue, please provide a step by step (including your configuration) in order to try to work on it.

          Show
          recena Manuel Recena Soto added a comment - Emilio Escobar I cannot reproduce it. If you are facing this issue, please provide a step by step (including your configuration) in order to try to work on it.
          Hide
          jglick Jesse Glick added a comment -

          I think I can reproduce this in a test.

          Show
          jglick Jesse Glick added a comment - I think I can reproduce this in a test.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Jesse Glick
          Path:
          src/main/java/jenkins/branch/MultiBranchProjectFactory.java
          src/main/java/jenkins/branch/OrganizationFolder.java
          src/test/java/jenkins/branch/OrganizationFolderTest.java
          http://jenkins-ci.org/commit/branch-api-plugin/c7de701c13d515d4118bf1f2868d42b25428c7a9
          Log:
          JENKINS-34246 Fix MultiBranchProjectFactory API to allow deletion or update of existing children.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/jenkins/branch/MultiBranchProjectFactory.java src/main/java/jenkins/branch/OrganizationFolder.java src/test/java/jenkins/branch/OrganizationFolderTest.java http://jenkins-ci.org/commit/branch-api-plugin/c7de701c13d515d4118bf1f2868d42b25428c7a9 Log: JENKINS-34246 Fix MultiBranchProjectFactory API to allow deletion or update of existing children.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Jesse Glick
          Path:
          src/main/java/jenkins/branch/MultiBranchProjectFactory.java
          src/main/java/jenkins/branch/OrganizationFolder.java
          src/test/java/jenkins/branch/OrganizationFolderTest.java
          http://jenkins-ci.org/commit/branch-api-plugin/2d3afb7f41c980d848add9baa7438bc838b75e9b
          Log:
          Merge pull request #45 from jglick/MultiBranchProjectFactory-update-JENKINS-34246

          JENKINS-34246 Fix MultiBranchProjectFactory API to allow deletion or update of existing children

          Compare: https://github.com/jenkinsci/branch-api-plugin/compare/0c390a0e40dd...2d3afb7f41c9

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/jenkins/branch/MultiBranchProjectFactory.java src/main/java/jenkins/branch/OrganizationFolder.java src/test/java/jenkins/branch/OrganizationFolderTest.java http://jenkins-ci.org/commit/branch-api-plugin/2d3afb7f41c980d848add9baa7438bc838b75e9b Log: Merge pull request #45 from jglick/MultiBranchProjectFactory-update- JENKINS-34246 JENKINS-34246 Fix MultiBranchProjectFactory API to allow deletion or update of existing children Compare: https://github.com/jenkinsci/branch-api-plugin/compare/0c390a0e40dd...2d3afb7f41c9
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Jesse Glick
          Path:
          pom.xml
          src/main/java/org/jenkinsci/plugins/workflow/multibranch/AbstractWorkflowMultiBranchProjectFactory.java
          src/test/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowMultiBranchProjectFactoryTest.java
          http://jenkins-ci.org/commit/workflow-multibranch-plugin/a7d63ecf3fc97a4657514c1b0495dd039aeafbc0
          Log:
          [FIXED JENKINS-34246] Make AbstractWorkflowMultiBranchProjectFactory handle deletion or update of existing children.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: pom.xml src/main/java/org/jenkinsci/plugins/workflow/multibranch/AbstractWorkflowMultiBranchProjectFactory.java src/test/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowMultiBranchProjectFactoryTest.java http://jenkins-ci.org/commit/workflow-multibranch-plugin/a7d63ecf3fc97a4657514c1b0495dd039aeafbc0 Log: [FIXED JENKINS-34246] Make AbstractWorkflowMultiBranchProjectFactory handle deletion or update of existing children.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Jesse Glick
          Path:
          pom.xml
          src/main/java/org/jenkinsci/plugins/workflow/multibranch/AbstractWorkflowMultiBranchProjectFactory.java
          src/test/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowMultiBranchProjectFactoryTest.java
          http://jenkins-ci.org/commit/workflow-multibranch-plugin/c0d0368994973cc3d6d2d542c36304b4acd71de3
          Log:
          Merge pull request #15 from jglick/MultiBranchProjectFactory-update-JENKINS-34246

          JENKINS-34246 Make AbstractWorkflowMultiBranchProjectFactory handle deletion or update of existing children

          Compare: https://github.com/jenkinsci/workflow-multibranch-plugin/compare/04d93559028b...c0d036899497

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: pom.xml src/main/java/org/jenkinsci/plugins/workflow/multibranch/AbstractWorkflowMultiBranchProjectFactory.java src/test/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowMultiBranchProjectFactoryTest.java http://jenkins-ci.org/commit/workflow-multibranch-plugin/c0d0368994973cc3d6d2d542c36304b4acd71de3 Log: Merge pull request #15 from jglick/MultiBranchProjectFactory-update- JENKINS-34246 JENKINS-34246 Make AbstractWorkflowMultiBranchProjectFactory handle deletion or update of existing children Compare: https://github.com/jenkinsci/workflow-multibranch-plugin/compare/04d93559028b...c0d036899497

            People

            • Assignee:
              jglick Jesse Glick
              Reporter:
              docwhat Christian Höltje
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: