-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
feat: JENKINS-73837 - Adjusted DirScanner to allow empty directories in the TarArchiver #9836
base: master
Are you sure you want to change the base?
feat: JENKINS-73837 - Adjusted DirScanner to allow empty directories in the TarArchiver #9836
Conversation
…in the TarArchiver
Yay, your first pull request towards Jenkins core was created successfully! Thank you so much! |
dbfc3eb
to
fff2bae
Compare
fff2bae
to
4f3652e
Compare
It seems that a lot of Tests fail when presented with empty directories. |
Thanks for proposing the pull request. One of the expectations is that the automated tests must pass before a change is merged. We usually rely on the pull request submitter to make the necessary changes so that the existing automated tests are passing and are correctly expressing what is expected from the change in the pull request. Are you willing to make those changes? |
Yes absolutely, I am already working on the VirtualFileTests. |
@MarkEWaite could you take a look at my proposed fix? |
I think that test failure is another indication that your change is working as desired. Before your change, the contents of that file were:
After your change, an entry is written to the tar archive for the directory
I think it is correct to change the |
@MarkEWaite hey! I have fixed all except one test. However with that last one I am going to need some support. |
Please take a moment and address the merge conflicts of your pull request. Thanks! |
Also closes JENKINS-49296 |
/reviewer @jenkinsci/core-pr-reviewers |
re-triggered |
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.
The new behavior has required a number of tests in core to be updated, so it is likely additional tests will need to be updated (ATH and/or plugins). Please run tests in jenkinsci/bom
and jenkinsci/acceptance-test-harness
with these bits to confirm no additional tests need adjustment.
I am also asking for security review of this PR, as it changes the expected behavior of a number of tests for past security fixes. The new expected behavior looks good to me, but I wanted the security team to confirm.
@@ -685,7 +685,7 @@ public void symlink_outsideWorkspace_areNotAllowed() throws Exception { | |||
assertThat(zipPage.getWebResponse().getStatusCode(), equalTo(HttpURLConnection.HTTP_OK)); | |||
|
|||
List<String> entryNames = getListOfEntriesInDownloadedZip((UnexpectedPage) zipPage); | |||
assertThat(entryNames, containsInAnyOrder( | |||
assertThat(entryNames, hasItems( |
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.
As in commit 14cf0bf, please strengthen the assertion by maintaining the original containsInAnyOrder
and adding any newly expected entries to the test.
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.
Will do today!
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.
@basil my latest commit should've fixed that. Could you double check?
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.
The code looks good to me. From my perspective, this PR is now ready for ATH/PCT testing and security review.
@@ -987,7 +993,7 @@ public void directSymlink_forTestingZip() throws Exception { | |||
assertThat(zipPage.getWebResponse().getStatusCode(), equalTo(HttpURLConnection.HTTP_OK)); | |||
|
|||
List<String> entryNames = getListOfEntriesInDownloadedZip((UnexpectedPage) zipPage); | |||
assertThat(entryNames, hasSize(0)); | |||
assertThat(entryNames, hasSize(6)); |
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.
Should add a containsInAnyOrder
assertion after this to match the expected 6 entries, like the others in this file.
Can you tell me how to run the ATH? do I just run |
so make a pull request and change the jenkins.version property if so, where do I get the value from? |
When #9836 (comment) has been addressed and you have a passing CI build, the Checks tab will provide a section with the incremental build version number, which you can then consume in |
What would be your proposal? So far nobody has mentioned that, and from my tests the stated behaviour could not be verified. I will retry later when I have more time. |
Thanks for challenging me on this, I checked again and I am unable to reproduce the behavior 🤦 No clue what I did, or thought I saw. |
However, I also don't see the intended behavior for JENKINS-49296, at least for the build-in "Archive the artifacts" freestyle post-build step: Downloading artifacts does not result in archives containing empty directories. Looking on the controller file system, empty directories are also not being archived there. |
Maybe empty directories are being additionally filtered somewhere? |
That would be my guess. I would appreciate if you could reproduce my findings independently first though, to ensure I didn't misinterpret something I was seeing again :) If we don't have it yet (and didn't just fail for the above reason), the addition of a test going from |
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.
Noting this doesn't seem to work as expected per #9836 (comment).
Hey @daniel-beck I am currently on vacation so it might take a bit for me to be able to investigate. If you can point me into the right direction and tell me where I have to implement I fix, I could do it on my laptop. |
No idea, sorry. Would need to step through it to see what's wrong, and I doubt I have the time for that soon. |
See JENKINS-73837 .
Testing done
Proposed changelog entries
Proposed upgrade guidelines
N/A
Submitter checklist
Desired reviewers
@mention
Before the changes are marked as
ready-for-merge
:Maintainer checklist