Skip to content
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

Merged

Conversation

jhoanmanuelms
Copy link
Contributor

  • Preserve inner directories path in order to deal with duplicates
  • Add iTest

- Preserve inner directories path in order to deal with duplicates
- Add iTest
@jhoanmanuelms jhoanmanuelms self-assigned this Sep 19, 2023
Copy link
Contributor

@Juan-EBI Juan-EBI left a 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")
Copy link
Contributor

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.

Copy link
Contributor Author

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("/")}")
Copy link
Contributor

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.

Copy link
Contributor Author

@jhoanmanuelms jhoanmanuelms Sep 27, 2023

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

Copy link
Contributor

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")

Copy link
Contributor Author

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!

@jhoanmanuelms jhoanmanuelms merged commit a2dd952 into master Sep 28, 2023
@jhoanmanuelms jhoanmanuelms deleted the bugfix/pivotal-#185756018-duplicated-directory-name branch September 28, 2023 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants