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

Add support for archiving empty directories in TarArchiver

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • core

      Currently, the TarArchiver class does not correctly handle archiving empty directories. When an empty directory is encountered, it is skipped and not included in the resulting TAR archive. This feature request is to modify the TarArchiver class to ensure that empty directories are archived correctly.

          [JENKINS-73837] Add support for archiving empty directories in TarArchiver

          Jobin added a comment -

          Similar issue for zip

          Jobin added a comment - Similar issue for zip

          Basil Crow added a comment -

          I added automated tests in https://github.com/jenkinsci/jenkins/pull/9809 which should be a good starting point for anyone who wishes to provide a pull request to resolve this issue.

          Basil Crow added a comment - I added automated tests in https://github.com/jenkinsci/jenkins/pull/9809 which should be a good starting point for anyone who wishes to provide a pull request to resolve this issue.

          Elton Alves added a comment - - edited

          Guys, how can I test it? I mean, locally! Is it possible?

          Elton Alves added a comment - - edited Guys, how can I test it? I mean, locally! Is it possible?

          tonho, dersimeon
          Sorry, colleagues, I didn't see that you started working on this task. I suggest reviewing my solution for participation in this task: https://github.com/jenkinsci/jenkins/pull/9871.

          In turn, I worked on this task for several days. I did not put the "Asignee" field on myself, since I think that this is a bad practice in open source products - my "Assignee" can scare off other participants, and I can miscalculate my strength and not finish the task - thus the task will forever remain with the "Assignee" label on me and will be unlikely to be done by me or other participants.

          Ilya Pyatizbyantsev added a comment - tonho , dersimeon Sorry, colleagues, I didn't see that you started working on this task. I suggest reviewing my solution for participation in this task: https://github.com/jenkinsci/jenkins/pull/9871 . In turn, I worked on this task for several days. I did not put the "Asignee" field on myself, since I think that this is a bad practice in open source products - my "Assignee" can scare off other participants, and I can miscalculate my strength and not finish the task - thus the task will forever remain with the "Assignee" label on me and will be unlikely to be done by me or other participants.

          tonho, Dear colleague, if you are interested in how I set up local testing on my site - leave me your email - I can write you a short guide on how I set up and ran tests on my site =)

          Ilya Pyatizbyantsev added a comment - tonho , Dear colleague, if you are interested in how I set up local testing on my site - leave me your email - I can write you a short guide on how I set up and ran tests on my site =)

          Daniel Beck added a comment -

          josejobin45 Could you explain what problem you're encountering that this change solves?

          Daniel Beck added a comment - josejobin45 Could you explain what problem you're encountering that this change solves?

          Jobin added a comment -

          Hi Daniel,

          Thank you for your pull request regarding the bug! The problem arose from the tar step in the Pipeline Utility Steps plugin, which I was using to create a tar archive of several files, including some empty directories.

          I discovered that the tar step does not include empty directories in the archive. Upon further investigation, I traced the root cause to the TarArchiver class in Jenkins core. Currently, I’m using a workaround by running the tar command in Git Bash, but I believe the ideal long-term solution would be to fully leverage the tar step.

          I hope answers the question! Please reach out if you need more clarification.

           

          Jobin added a comment - Hi Daniel, Thank you for your pull request regarding the bug! The problem arose from the tar step in the Pipeline Utility Steps plugin, which I was using to create a tar archive of several files, including some empty directories. I discovered that the tar step does not include empty directories in the archive. Upon further investigation, I traced the root cause to the TarArchiver class in Jenkins core. Currently, I’m using a workaround by running the tar command in Git Bash, but I believe the ideal long-term solution would be to fully leverage the tar step. I hope answers the question! Please reach out if you need more clarification.  

          Daniel Beck added a comment -

          Thank you for your pull request regarding the bug!

          I'm just reviewing it (and failing at it, evidently ).

          Thanks for the clarification. So the actual problem that would be addressed is JENKINS-49296, and this is essentially giving an implementation hint.

          Daniel Beck added a comment - Thank you for your pull request regarding the bug! I'm just reviewing it (and failing at it, evidently ). Thanks for the clarification. So the actual problem that would be addressed is JENKINS-49296 , and this is essentially giving an implementation hint.

          Neeraj added a comment -

          Has the issue been solved?

          Neeraj added a comment - Has the issue been solved?

          Mark Waite added a comment -

          neergasm no, it has not been solved. The work is ongoing in https://github.com/jenkinsci/jenkins/pull/9836

          Mark Waite added a comment - neergasm no, it has not been solved. The work is ongoing in https://github.com/jenkinsci/jenkins/pull/9836

            Unassigned Unassigned
            josejobin45 Jobin
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: