-
Notifications
You must be signed in to change notification settings - Fork 7
Second fix to filepaths outside the folder root with the XAR system, plus testing #7267
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
Second fix to filepaths outside the folder root with the XAR system, plus testing #7267
Conversation
|
@labkey-jeckels and/or @XingY: this fully fixes the problem we're encountering, plus has a standalone test case if you want to reproduce it yourself. Would one of you be able to copy this FB to the LabKey side of the fork so TeamCity will run it? You could run the XarTestPipelineJob integration test without the changes related to generatePathStringRelativeToRootIfUnderRoot() if you want to repro this. As noted in the main issue, I think XarTestPipelineJob is a platform we could use in the future to formally test file access situations, if you end up tightening permissions more. |
|
I mirrored the FB. https://github.com/LabKey/platform/tree/25.11_fb_relPathsWithTest I haven't reviewed yet. I may have time later today, or will definitely have time tomorrow. |
|
Thank you, and I don't expect anyone at labkey to review over the weekend. I appreciate the mirroring to at least get test data. |
|
Good morning - it seems like this is passing BVTs now: https://teamcity.labkey.org/buildConfiguration/LabKey_2511Release_Community_BvtAPostgres?branch=relPathsWithTest&buildTypeTab=overview. That includes the integration test I added, which provides direct coverage over this relative path LSID issue. I think we can treat this as separate from the platform PR; however, I have some expanded coverage over cross-workbook pipeline jobs going here: BimberLab/DiscvrLabKeyModules#365. Are there other test suites you'd like to see run? |
|
Note, the unrelated changes to sequence tests that exercise the cross-folder scenarios are now passing in this PR: https://teamcity.labkey.org/buildConfiguration/LabKey_2511Release_External_Discvr_ExternalModulesTestPostgres/3771811. I am happy to make changes, but have no other plans to do anything further unless changes are requested. |
Minor cleanup
|
I reviewed the changes and I'm comfortable with the relative path handling. I pushed changes into the FB that streamline the use of The new test passes locally for me. The commit should trigger the BVTs to rerun the new test. I queued the Sequence tests manually: Questions for you, Ben:
|
|
Hi @labkey-jeckels, see below:
Yes, I see what you mean. XarTestPipelineJob was a quick fork from a different pipeline test class that needed to run on different locations. I'll remove this
All of those cases are from real scenarios as far as one container interacting with another. The specific scenarios are outlined in more detail here: https://www.labkey.org/ONPRC/Support%20Tickets/issues-details.view?issueId=54301 (search for 'Use Case 1'). Like I wrote there, this conceptually following Query/ContainerFilter rules.
I dont ever import/export XAR. I barely do much with that piece of the pipeline codepath at all. |
|
@bbimber OK, thanks. Assuming TeamCity is happy with these changes, we can merge this tomorrow and separately consider the other scenarios to ensure compatibility with the additional changes already in develop. |
|
@labkey-jeckels, the bbimber<->labkey fork situation complicates this. I pushed a change, in addition to your FileLike change, that should be here: https://github.com/LabKey/platform/pull/7273/commits. Because TeamCity is running against the labkey form, we should really move to this PR, #7273 which is what's actually going to be committed. That branch is ahead of bbimber:25.11_fb_relPathsWithTest |
|
Closing in favor of #7273, which is now merged. |
|
excellent, thank you |
This is related to: #7261.
More background is listed on that issue. In 25.11, additional checks were added to disallow relative filepaths. The problem is that the XAR/Experiment system creates relative filepaths on data import. PR #7261 addressed one problem. After fixing this, I hit the following. This error happens a few lines after the original error. The gist is that LabKey writes out a XAR file for the run, and this file still contains forced relative URLs, even if not under the container's file root.
My proposal here is to make the DataFileURL behavior consistent between ExperimentRun creation and XAR writing. The method "generatePathStringRelativeToRootIfUnderRoot" could certainly get a better name. I can add some code comments if you think this is a viable pathway.
If you dont like this, there's a second more involved option. The ExpDatas being written to XML store their original non-relative DataFileURL. The XAR code could read that and preferentially swap in that original URI. This is less invasive, but also raises the question of what's the point of writing a relative URI to that XML if we're just going to reverse it.
In addition to this fix, I created a contained test case that exercises the XarGenerator codepath. This can be used to illustrate this problem, and should be very easy to extend in the future as permissions are tightened. At the moment it exercises the situation of filepaths outside of the LK root; however, all the cross-folder situations I mentioned on #7261 would be easy to include.
Here is a stacktrace, from: https://prime-seq.ohsu.edu/Labs/Bimber/1976/pipeline-status-details.view?rowId=602940.