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

INCOMPLETE FCREPO-3931 #209

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

Surfrdan
Copy link
Contributor

@Surfrdan Surfrdan commented Dec 6, 2024

This PR is INCOMPLETE - Fixes for file extensions not being added to binaries when the -x arg is used


**JIRA Ticket https://fedora-repository.atlassian.net/jira/software/c/projects/FCREPO/issues/FCREPO-3931?jql=project%20%3D%20%22FCREPO%22%20ORDER%20BY%20created%20DESC **:

What does this Pull Request do?

This PR attempts to fix an issue where file extensions were not being added to binary filenames within the dcfl-root when the user used the -x argument which is supposed to enable this feature. Whilst The PR does appear to fix this initial issue, I have struggled to get the tests to pass. This is mainly down to a lack of understanding of what some tests were trying to achieve.

Currently ArchiveGroupHandlerTest.filenameRemovedFromRelsInt is failing and I have made some changes to ArchiveGroupHandlerTest which may not be correct.

I need some clarity on the following questions:

What is filenameRemovedFromRelsInt trying to test? In what use-case would a filename be removed from RELS-INT?

What is the relationship between contentPath and filename within the fedora header?

How should this be tested?

  • Read the changes to contentPath and filename handling within the fedora header to check whether they are being handled correctly
  • Possibly, rebase ArchiveGroupHandlerTest to remove unwarranted modifications made by this PR
  • Perform a migration with binaries in the following formats (logic from ArchiveGroupHandler:resolveFilename:405)
405     /**
 406      * Resolves the filename of the datastream based on the following precedence:
 407      *
 408      * 1. info:fedora/fedora-system:def/model#downloadFilename from RELS-INT
 409      * 2. LABEL from datastream meta
 410      * 3. Name of the datastream
 411      *
 412      * If extensions should be added, then an extension is picked based on the mime type. If the filename already
 413      * includes a `.` then no extension is added.
 414      *

Interested parties

Tag (@ mention) interested parties or, if unsure, @fcrepo/committers

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.

1 participant