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

External artifacts are not deleted when the build is deleted

    XMLWordPrintable

Details

    Description

      When you delete a build from the UI the Artifacts are not deleted from S3. The rotation of the build works, after digging a little, I found that when you deleted a build from the UI the method called is hudson.model.Run.delete this method does not call jenkins.model.delete(), it calls all the onDeleted method from the RunListener registered, thus I suppose that we have to implement a RunListener that implements the onDeleted method.

      Attachments

        Activity

          ifernandezcalvo Ivan Fernandez Calvo created issue -

          I have setted the parameters to enable the delete feature `-Dio.jenkins.plugins.artifact_manager_s3.S3BlobStoreConfig.deleteArtifacts=true -Dio.jenkins.plugins.artifact_manager_s3.S3BlobStoreConfig.deleteStashes=true`

          ifernandezcalvo Ivan Fernandez Calvo added a comment - I have setted the parameters to enable the delete feature `-Dio.jenkins.plugins.artifact_manager_s3.S3BlobStoreConfig.deleteArtifacts=true -Dio.jenkins.plugins.artifact_manager_s3.S3BlobStoreConfig.deleteStashes=true`
          jglick Jesse Glick added a comment -

          The suggested fix is incorrect—this looks like a bug in core.

          jglick Jesse Glick added a comment - The suggested fix is incorrect—this looks like a bug in core.
          jglick Jesse Glick made changes -
          Field Original Value New Value
          Component/s core [ 15593 ]
          Component/s artifact-manager-s3-plugin [ 23538 ]
          Assignee Jesse Glick [ jglick ]
          Summary Artifacts are not deleted when you deleted the build External artifacts are not deleted when the build is deleted
          jglick Jesse Glick made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          jglick Jesse Glick made changes -
          Labels lts-candidate
          jglick Jesse Glick made changes -
          Remote Link This issue links to "core PR 3484 (Web Link)" [ 20824 ]
          jglick Jesse Glick made changes -
          Status In Progress [ 3 ] In Review [ 10005 ]

          Code changed in jenkins
          User: Jesse Glick
          Path:
          core/src/main/java/hudson/model/Run.java
          test/src/test/java/hudson/model/RunTest.java
          http://jenkins-ci.org/commit/jenkins/9b0a0e71b8a6b92227e6af80ec7202aa0bf44b5b
          Log:
          JENKINS-51819 When using a custom ArtifactManager, Run.delete must call ArtifactManager.delete.

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/src/main/java/hudson/model/Run.java test/src/test/java/hudson/model/RunTest.java http://jenkins-ci.org/commit/jenkins/9b0a0e71b8a6b92227e6af80ec7202aa0bf44b5b Log: JENKINS-51819 When using a custom ArtifactManager, Run.delete must call ArtifactManager.delete.

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          core/src/main/java/hudson/model/Run.java
          test/src/test/java/hudson/model/RunTest.java
          http://jenkins-ci.org/commit/jenkins/ee384ba34c4f886b0585e64231e5e713e3893d6f
          Log:
          Merge pull request #3484 from jglick/Run.deleteArtifacts-JENKINS-51819

          JENKINS-51819 When using a custom ArtifactManager, Run.delete must call ArtifactManager.delete

          Compare: https://github.com/jenkinsci/jenkins/compare/01b1f1ddbcad...ee384ba34c4f
          *NOTE:* This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

          Functionality will be removed from GitHub.com on January 31st, 2019.

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/model/Run.java test/src/test/java/hudson/model/RunTest.java http://jenkins-ci.org/commit/jenkins/ee384ba34c4f886b0585e64231e5e713e3893d6f Log: Merge pull request #3484 from jglick/Run.deleteArtifacts- JENKINS-51819 JENKINS-51819 When using a custom ArtifactManager, Run.delete must call ArtifactManager.delete Compare: https://github.com/jenkinsci/jenkins/compare/01b1f1ddbcad...ee384ba34c4f * NOTE: * This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/ Functionality will be removed from GitHub.com on January 31st, 2019.
          jglick Jesse Glick made changes -
          Resolution Fixed [ 1 ]
          Status In Review [ 10005 ] Resolved [ 5 ]
          oleg_nenashev Oleg Nenashev added a comment -

          Fixed in Jenkins 2.127

          oleg_nenashev Oleg Nenashev added a comment - Fixed in Jenkins 2.127
          cloudbees CloudBees Inc. made changes -
          Remote Link This issue links to "CloudBees Internal ARC-378 (Web Link)" [ 20833 ]
          olivergondza Oliver Gondža made changes -
          Labels lts-candidate 2.121.2-fixed

          People

            jglick Jesse Glick
            ifernandezcalvo Ivan Fernandez Calvo
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: