-
Notifications
You must be signed in to change notification settings - Fork 1
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
Pivotal ID # 185649200: FIRE Duplicated Folder Name #748
Pivotal ID # 185649200: FIRE Duplicated Folder Name #748
Conversation
jhoanmanuelms
commented
Sep 19, 2023
- Preserve inner directories path in order to deal with duplicates
- Add iTest
- Preserve inner directories path in order to deal with duplicates - Add iTest
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.
please consider changes before merge
line("File", "folder/inner") | ||
line("Type", "inner folder") | ||
line("File", "folder/inner/directory") | ||
line("Type", "inner directory") |
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.
I think this is really specialized scenario and can be easily miss in a refactor. IMO we should have specialized test "6-3-2 submission with directories with the same name on FIRE". In that way is super clear what is that that we are testing.
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.
Done
@@ -73,7 +73,7 @@ class SubmissionRequestLoader( | |||
|
|||
private fun asCompressedFile(accNo: String, version: Int, directory: NfsFile): NfsFile { | |||
fun compress(file: File): File { | |||
val tempFolder = fireTempDirPath.resolve("$accNo/$version") | |||
val tempFolder = fireTempDirPath.resolve("$accNo/$version/${directory.filePath.substringBeforeLast("/")}") |
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.
really subjective but I think the problem is not in this line but rather tempFolder.resolve("${file.name}.zip")
the problem with that code is that we are using fixed file path rather than do that we should use Files.createTempFile
which will atuomatically garantee to us that same name is not used.
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.
I see your point and it actually solves the problem but, this method uses the VM's temp folder which is only 10 GB currently which I think won't be enough for the imaging people's requirements
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.
what I mean is use the same method over the same folder fireTempDirPath.createTempFile("$accNo/$version")
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.
Got it, makes sense. Done!
- Use temporary file names - Improve testing structure