Skip to content

Removing IOException when using ZIP with "overwrite: true", and the ZIP doesn't currently exist #82

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

timothy-long
Copy link
Contributor

Hello,

Currently, when running a pipeline creating a ZIP and specifying "overwrite: true", if the destination file doesn't exist, it will throw an IOException. I've run into this issue often when running a pipeline for the first time, or after clearing a workspace.

The original pull request (#76) checked if the ZIP existed prior to attempting to delete, however this was lost after feedback encouraging converting to NIO2 file APIs, where it now throws an IOException. This pull request changes the functionality to be more like the original.

Return value of Files.deleteIfExists is ignored, as it indicates if the file existed or not, and for overwriting I don't believe we mind either way.

Thanks

Switched overwrite logic in ZipStepExecution to no longer throw a IOException if the destination file doesn't exist yet. Motivation being this fixes pipelines failing on a fresh workspace where this file may not exist yet.

Not handling IOExceptions from the deletion itself, to try and follow existing functionality (as previous implementation didn't either) so these will still bubble up.
@timothy-long timothy-long changed the title Fixing IOException when using ZIP with "overwrite: true", where the ZIP doesn't already exist Removing IOException when using ZIP with "overwrite: true", and the ZIP doesn't currently exist Aug 8, 2020
@timothy-long timothy-long requested a review from rsandell August 22, 2020 19:47
@rsandell rsandell added the bug label Oct 9, 2020
@rsandell rsandell merged commit 035fdda into jenkinsci:master Oct 9, 2020
@stefandrissen
Copy link

Sorry if I'm asking this in the wrong place.

After running into this issue, I updated my Jenkins environment including all plugins to their latest versions only to discover that this PR has not yet been included in a release.

The latest release is 2.6.1 from 26th June 2020, when can a new release be expected?

@espguitarist33
Copy link

How soon can this be released? this is a pretty glaring issue that makes the new 'overwrite' feature useless

@rsandell
Copy link
Member

@espguitarist33 Sorry, I had missed making the release. It was released in 2.7.0 last week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants