Enable Version-Based File Type Validation for Analysis Submission #866
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements changes to support file type validation based on the analysis version provided during submission. Key updates include:
File Type Validation by Version:
When submitting an analysis, the file types will now be validated according to the version specified in the payload.
If no version is specified, the latest version is used by default.
Handling File Types Across Versions:
If no file types are provided for a particular version, the system retrieves file types from previous versions.
If it is the first version and no file types are specified, all file types are allowed (null value or empty array).
If file types are explicitly provided, those will be used regardless of the version.
An empty
fileTypes
array is treated the same as a null value, meaning all file types are allowed.Repository Changes:
In AnalysisSchemaRepository, updated method signatures:
Validation Logic:
Updated in
ValidationService
to fetch and validate file types from the correct version:options.fileType
is provided, it looks for the latest schema version and re-use the file typesoptions.fileType
is an empty array, set no value for file types, indicates any file type is allowedoptions.fileType
is an array with values, set this as the value for file typesThese changes ensure that the file types are consistently validated based on the correct version, improving flexibility for versioned analysis types.