-
Notifications
You must be signed in to change notification settings - Fork 163
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
[JENKINS-34122] Exclude output file from itself #19
Conversation
This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation. |
this looks ok, except for all the println |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 mostly OK, as I don't know if using System.out.println
might be something specific here with unavailable/unusable loggers or something.
@@ -120,12 +120,23 @@ public ZipItFileCallable(FilePath zipFile, String glob) { | |||
|
|||
@Override | |||
public Integer invoke(File dir, VirtualChannel channel) throws IOException, InterruptedException { | |||
String canonicalZip = new File(zipFile.getRemote()).getCanonicalPath(); | |||
System.out.println("zipFileRemote is: " + zipFile.getRemote()); | |||
System.out.println("canonicalZip is: " + canonicalZip); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this normal to sysout
instead of logging?
archiver.visit(new File(dir, path), path); | ||
File toArchive = new File(dir, path).getCanonicalFile(); | ||
if (toArchive.getPath().equals(canonicalZip)) { | ||
System.out.println("Not archiving " + toArchive + " as this is the output zip itself"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
System.out.println("Not archiving " + toArchive + " as this is the output zip itself"); | ||
} | ||
else { | ||
System.out.println("archiving " + toArchive + " as this is not excluded"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
ZipInputStream zip = new ZipInputStream(file.open()); | ||
ZipEntry entry = zip.getNextEntry(); | ||
while (entry != null && !entry.getName().equals("output.zip")) { | ||
System.out.println("zip entry name is: " + entry.getName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can live with it in a test, though I don't like it much.
Created #21 fixing merge conflicts and removed debug prints |
JENKINS-34122 Using configured value from the step, rather than the
FilePath
to exclude is from theFileSet
This also fixes the unit tests so that they pass when run on windows.
@reviewbybees
obsoletes #18, and satisfies my commitment to a better fix without introducing the regression I identified.