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

Provide an option whether or not fail the build on artifact archiving not finding any artifacts

    • Icon: Improvement Improvement
    • Resolution: Duplicate
    • Icon: Major Major
    • core
    • None

      Several issues in the past asked to fail the build on archiving failure because of downstream effect:

      All of them could be marked as Resolved now, because that's what Jenkins 1.464 does:

      BUILD SUCCESSFUL
      
      Total time: 6 mins 47.224 secs
      Build step 'Invoke Gradle script' changed build result to SUCCESS
      Archiving artifacts
      ERROR: No artifacts found that match the file pattern "build/test-results/SpecFlow/**/*.png". Configuration error?
      ERROR: 'build/test-results/SpecFlow/**/*.png' doesn't match anything, but '**/*.png' does. Perhaps that's what you mean?
      Build step 'Archive the artifacts' changed build result to FAILURE
      

      However, in my case, I need to have the exact opposite: not to fail the build on archiving failure. I don't integrate via Jenkins jobs. In fact, I'd argue this is not what "Archive the artifacts" action was designed to do. Per its help: "Archives the build artifacts (for example, distribution zip files or jar files) so that they can be downloaded later. Archived files will be accessible from the Jenkins webpage."

      That's precisely what I need. We are taking browser's screenshots of failed SpecFlow tests (the same approach is often used in Cucumber tests). So, if a test fails, a nice .PNG appears, which helps a lot with troubleshooting. Now, naturally, I need to archive *.PNG to troubleshoot failed builds. The archived .PNG-s appear on a corresponding build page. So far, so good. However, when a build passes it does not produce any .PNGs. Artifact archiving does not find anything to archive and fails the successful build. See the output above.

      Now, people who use archiving for downstream integration can use some of 24 Artifact Uploader plug-ins, Copy Artifact plugin, etc. to copy artifacts where they need them. I, on the other hand, could only find one way to achieve what I needed: hack the "Files to archive" pattern to include a file which I don't actually need, but is always available in the workspace. Here is hacked pattern:

      build/test-results/**/*.png, test/SpecFlow/NETEAVSpecFlow/bin/Debug/*.config

      What I suggest is to provide a checkbox under Archive the artifacts to either fail the build or not on not found artifacts.

          [JENKINS-13920] Provide an option whether or not fail the build on artifact archiving not finding any artifacts

          Daniel Beck added a comment - - edited

          Try to actually reproduce the issue as described, instead of something that looks vaguely similar. If you actually have build output, but cannot successfully archvie it because the disk fills up, or the connection aborts for some reason, the build should fail. There's no output, after all. Not everyone has the luxury of using an artifact repository, or of having only artifacts of a few MB, so archiving using Jenkins is vital for some users. The issues you link to are still unfixed and your "example" is completely unrelated.

          Daniel Beck added a comment - - edited Try to actually reproduce the issue as described, instead of something that looks vaguely similar. If you actually have build output, but cannot successfully archvie it because the disk fills up, or the connection aborts for some reason, the build should fail. There's no output, after all. Not everyone has the luxury of using an artifact repository, or of having only artifacts of a few MB, so archiving using Jenkins is vital for some users. The issues you link to are still unfixed and your "example" is completely unrelated.

          bap added a comment -

          Install the flexible publish plugin and use the file exists or the files match run condition

          bap added a comment - Install the flexible publish plugin and use the file exists or the files match run condition

          Harry G. added a comment -

          This issue exactly duplicates 10502, therefore it could be closed.
          It is NOT related to the others given as "related to", as these are real errors during archiving (like disk full or I/O-Error).
          Therefore these others are also NOT resolved as opposed to above statement!

          Harry G. added a comment - This issue exactly duplicates 10502, therefore it could be closed. It is NOT related to the others given as "related to", as these are real errors during archiving (like disk full or I/O-Error). Therefore these others are also NOT resolved as opposed to above statement!

          bap added a comment -

          duplicate

          bap added a comment - duplicate

            Unassigned Unassigned
            dk Dima Korobskiy
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: