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

Allow archiving of empty directories to be enabled/disabled

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • core
    • None

      From time to time I have found it would be handy to be able to add an empty directory to the archive. eg. directory for log files.

      I have noticed that this was deliberately disabled in JENKINS-3227 however it would be great if there was a configurable option to enable/disable archiving empty directories.

          [JENKINS-9146] Allow archiving of empty directories to be enabled/disabled

          René Schwarz added a comment -

          I also strongly support this request. There should be no alteration of the build artifacts at all, unless the user explicitly chooses to enable this "feature".

          René Schwarz added a comment - I also strongly support this request. There should be no alteration of the build artifacts at all, unless the user explicitly chooses to enable this "feature".

          Another example where archiving empty directories is crucial: I have set up jobs that split a large Git repository into several smaller ones. I want to archive the results. However, empty folders such as "branches" or "refs" and not archive resulting in a broken Git repository (git commands simply don't recognize it as such any more).

          Thorsten Meinl added a comment - Another example where archiving empty directories is crucial: I have set up jobs that split a large Git repository into several smaller ones. I want to archive the results. However, empty folders such as "branches" or "refs" and not archive resulting in a broken Git repository (git commands simply don't recognize it as such any more).

          Michael M. added a comment -

          I also would be very happy, if empty directories could be part of an artefact. The most flexible way in my oppinion would be to add as extra option in the advanced section. Then every user is free to enable / disable this functionality.

          Michael M. added a comment - I also would be very happy, if empty directories could be part of an artefact. The most flexible way in my oppinion would be to add as extra option in the advanced section. Then every user is free to enable / disable this functionality.

          Ryan D. added a comment -

          Any idea if this bug will ever be fixed?  Quite annoying I need to create dummy files so (now not) empty directories will be properly archived.

          Ryan D. added a comment - Any idea if this bug will ever be fixed?  Quite annoying I need to create dummy files so (now not) empty directories will be properly archived.

          Brock Jones added a comment -

          I can't believe that this issue hasn't been addressed. If I tell Jenkins to archive a directory hierarchy, then I expect exactly the same structure to appear in the archive as did in the source. I can understand creating an option to exclude empty directories, but making that behavior the default is flat-out wrong.

          Brock Jones added a comment - I can't believe that this issue hasn't been addressed. If I tell Jenkins to archive a directory hierarchy, then I expect exactly the same structure to appear in the archive as did in the source. I can understand creating an option to exclude empty directories, but making that behavior the default is flat-out wrong.

          Ryan D. added a comment -

          Honestly, this seems like it should be flagged a bug, and not an improvement.

          Ryan D. added a comment - Honestly, this seems like it should be flagged a bug, and not an improvement.

          Alois Hartl added a comment -

          It es a bug created by the following issue: https://issues.jenkins-ci.org/browse/JENKINS-3227 

          Before the issue was resolved empty directories were archived.

          Alois Hartl added a comment - It es a bug created by the following issue:  https://issues.jenkins-ci.org/browse/JENKINS-3227   Before the issue was resolved empty directories were archived.

          It's surely a bug introduced by inadequate "fix". Directory structure is the same kind of artifact as anything else, you should be able to archive whatever you want. In my case I have specific directory structure which is filled up based on several other jobs artifacts. After all automatic processes prepare delivery content we just fill up a few documents and HW test measurements done by hand and should be able to release that. The problem is that we either have to create a few empty directories (delivery won't pass with missing directories in structure) or remove placeholders created to let Jenkins archive those empty directories. You have powerful automation and yet you can't automate creating a few empty directories.

          So yes, it's a bug. It does not behave as you would expect it to do and it took me too much time to discover that those directories are properly moved but not archived. Not even a log message telling that this thing won't be archived. I thought I messed up something and removed empty directories during delivery preparations. Great way of wasting time.

          Maciej Załucki added a comment - It's surely a bug introduced by inadequate "fix". Directory structure is the same kind of artifact as anything else, you should be able to archive whatever you want. In my case I have specific directory structure which is filled up based on several other jobs artifacts. After all automatic processes prepare delivery content we just fill up a few documents and HW test measurements done by hand and should be able to release that. The problem is that we either have to create a few empty directories (delivery won't pass with missing directories in structure) or remove placeholders created to let Jenkins archive those empty directories. You have powerful automation and yet you can't automate creating a few empty directories. So yes, it's a bug. It does not behave as you would expect it to do and it took me too much time to discover that those directories are properly moved but not archived. Not even a log message telling that this thing won't be archived. I thought I messed up something and removed empty directories during delivery preparations. Great way of wasting time.

          I'd like to emphasize that fix for JENKINS-3227 changed default behavior without any notiece, it should be added as an option back then. Now this ticket lays down for 7 years and default behavior is not what you would usually expect, on the other hand you can't just change current default which was used for 7 years since that feral fix. Currently most reasonable option is to add visible checkbox to let is archive empty directories. Don't move it to advanced, make it visible so new user knows right away that it does not archive everything.

          Maciej Załucki added a comment - I'd like to emphasize that fix for  JENKINS-3227  changed default behavior without any notiece, it should be added as an option back then. Now this ticket lays down for 7 years and default behavior is not what you would usually expect, on the other hand you can't just change current default which was used for 7 years since that feral fix. Currently most reasonable option is to add visible checkbox to let is archive empty directories. Don't move it to advanced, make it visible so new user knows right away that it does not archive everything.

          Bram Mertens added a comment -

          Another year passed.
          Please add this option.

          Bram Mertens added a comment - Another year passed. Please add this option.

            Unassigned Unassigned
            michaelford Michael Ford
            Votes:
            19 Vote for this issue
            Watchers:
            21 Start watching this issue

              Created:
              Updated: