-
Notifications
You must be signed in to change notification settings - Fork 12
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
Validate tool does not PASS a bundle with a single-character filename #299
Comments
@c-suh per comment above 😆 |
The pattern for filename is defined in src/main/java/gov/nasa/pds/tools/validate/content/table/FieldValueValidator.java private static final Pattern asciiFileNamePattern = Pattern.compile( A better pattern may be: "[A-Za-z0-9] a star should be here [A-Za-z0-9-_\.]*[A-Za-z0-9]\.[A-Za-z0-9]+") to accept file name with just one character. |
With the better name pattern in place, a run of valid label provided by user accepts the single-character filename: % validate -R pds4.label -r report_github299_label_valid.json -s json -t src/test/resources/github299/valid/gbo_ast_fieber-beyer_spectra % egrep "status|label" report_github299_label_valid.json Running against a label that points to 'bad' file names, resulted in correct error messages: % validate -R pds4.label -r report_github299_label_invalid.json -s json -t src/test/resources/github299/invalid/gbo_ast_fieber-beyer_spect File names should not end with '_' before the dot. % grep message report_github299_label_invalid.json | grep ASCII_File_Specification_Name |
…orrect file separator for non-linux machine 1. Add test resources for github297 to src/test/resources 2. Add test resources for github299 to src/test/resources 3. Modify name pattern to allow one-character file name and correct leading zero values in FieldValueValidator.java 4. Modify hard-coded file separator to be machine-dependent in ValidateLauncher.java 5. Add 2 new tests for github297 to validate.feature 6. Add 2 new tests for github299 to validate.feature Refs #297 #297 Content validation of ASCII_Integer field does not accept value with leading zeroes #299 #299 Validate tool does not PASS a bundle with a single-character filename #300 #300 validate -u flag reports an error on Windows
…orrect file separator for non-linux machine 1. Add test resources for github297 to src/test/resources 2. Add test resources for github299 to src/test/resources 3. Modify name pattern to allow one-character file name and correct leading zero values in FieldValueValidator.java 4. Modify hard-coded file separator to be machine-dependent in ValidateLauncher.java 5. Add 2 new tests for github297 to validate.feature 6. Add 2 new tests for github299 to validate.feature Refs #297 #297 Content validation of ASCII_Integer field does not accept value with leading zeroes #299 #299 Validate tool does not PASS a bundle with a single-character filename #300 #300 validate -u flag reports an error on Windows
closed per #306 |
Describe the bug
Validator is failing a bundle which has a file whose name is one character long. Node POC believes this is a side effect of the regular expression enforcing that the filename not begin or end with a dash, underscore, or period.
To Reproduce
Steps to reproduce the behavior:
gbo_ast_fieber-beyer_spectra_v2.0_20210211.zip
Expected behavior
1 product will fail with the following:
Version of Software Used
Version 1.23.1
Test Data / Additional context
Bug discovered while attempting to validate one of multiple bundles submitted in NASA-PDS/operations#61. List of filename rules was provided in NASA-PDS/operations#61 (comment).
ScreenshotsIf applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Not on local desktop; run on pds-gamma.
Applicable requirements
? but I like the unicorns, so I'm leaving them
: unicorn: # 1
: unicorn: # 2
The text was updated successfully, but these errors were encountered: