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

validate does not allow ".XML" as an extension for a label file #364

Closed
seanhardman opened this issue Jun 23, 2021 · 4 comments · Fixed by #365
Closed

validate does not allow ".XML" as an extension for a label file #364

seanhardman opened this issue Jun 23, 2021 · 4 comments · Fixed by #365
Assignees
Labels
B12.0 bug Something isn't working s.medium

Comments

@seanhardman
Copy link

🐛 Describe the bug

Validate Tool generates an error when the extension of a PDS4 label file is capitalized ".XML". After reviewing the Standards Reference and the Data Provider's Handbook, it appears that there are no restrictions on the capitalization of PDS4 label extensions. In fact, capitalized extensions are allowed on other validation target files.

📜 To Reproduce

Steps to reproduce the behavior (notice the inconsistency in the "File Filters Used" parameter:

(base) MT-202412:bin shardman$ ./validate --skip-context-validation --skip-content-validation --target ../../test/MIS000XXX_2021001T000000_DEV0_2021001T0000_RAW010.XML

PDS Validate Tool Report

Configuration:
Version 2.1.0-SNAPSHOT
Date 2021-06-23T15:28:30Z

Parameters:
Targets [file:/Users/shardman/dev/eurc/test/MIS000XXX_2021001T000000_DEV0_2021001T0000_RAW010.XML]
Severity Level WARNING
Recurse Directories true
File Filters Used [*.xml, *.XML]
Data Content Validation off
Product Level Validation on
Max Errors 100000
Registered Contexts File /Users/shardman/dev/eurc/validate-2.1.0-SNAPSHOT/resources/registered_context_products.json

Product Level Validation Results

FAIL: file:/Users/shardman/dev/eurc/test/MIS000XXX_2021001T000000_DEV0_2021001T0000_RAW010.XML
ERROR [error.label.bad_extension] Label file names must end with the extension '.xml'
1 product validation(s) completed

Summary:

1 error(s)
0 warning(s)

Product Validation Summary:
0 product(s) passed
1 product(s) failed
0 product(s) skipped

Referential Integrity Check Summary:
0 check(s) passed
0 check(s) failed
0 check(s) skipped

Message Types:
1 error.label.bad_extension

End of Report
Completed execution in 4817 ms

🕵️ Expected behavior

I expect the label to validate successfully.

📚 Version of Software Used

This behavior has been seen in versions 2.0.6 as well as 2.1.0-SNAPSHOT.

🩺 Test Data / Additional context

MIS000XXX_2021001T000000_DEV0_2021001T0000_RAW010.XML.zip

🏞Screenshots

N/A

🖥 System Info

  • OS: Mac 10.15.7
  • Browser N/A
  • Version N/A

🦄 Applicable requirements**

@seanhardman seanhardman added bug Something isn't working needs:triage labels Jun 23, 2021
@jordanpadams jordanpadams added this to the 10.Lynn.Jennings milestone Jun 24, 2021
qchaupds pushed a commit that referenced this issue Jun 29, 2021
…/LF is included in field value, modify unallowed name message to be warning instead of error

1. Add test artifact for github356 to src/test/resources.  Cucumber requires a directory for a test to exist eventhough the test uses another input directory
2. Add test artifact for github357 to src/test/resources
3. Add test artifact for github364 to src/test/resources
4. Modify from error to warning for sub_directory.unallowed_name flag in ProblemType.java
5. Add logic to check for CR/LF in field value for Table_Delimited table and add ogic to break out of loop if error is fatal to avoid reporting same error in FieldValueValidator.java
6. Add logic to allow '.XML' to be an extension for a label in LabelValidationRule.java
7. Modify message to include: "with the extension '.xml' or '.XML'" in PDS4Problems.java
8. Add debug statements and logic to report warning if read too many records to TableDataContentValidationRule.java
9. Add BAD_EXTENSION type to support new errors detected to StepDefs.java
10. Add new tests to validate.feature

Refs:

#355 Improve validate reporting when trying to read a null row
#356 validate labels error.sub_directory.unallowed_name as a warning
#357 Validate allows CRLF within a Table_Delimited field
#364 validate does not allow ".XML" as an extension for a label file
jordanpadams added a commit that referenced this issue Jun 30, 2021
jordanpadams pushed a commit that referenced this issue Jul 3, 2021
…/LF is included in field value, modify unallowed name message to be warning instead of error

1. Add test artifact for github356 to src/test/resources.  Cucumber requires a directory for a test to exist eventhough the test uses another input directory
2. Add test artifact for github357 to src/test/resources
3. Add test artifact for github364 to src/test/resources
4. Modify from error to warning for sub_directory.unallowed_name flag in ProblemType.java
5. Add logic to check for CR/LF in field value for Table_Delimited table and add ogic to break out of loop if error is fatal to avoid reporting same error in FieldValueValidator.java
6. Add logic to allow '.XML' to be an extension for a label in LabelValidationRule.java
7. Modify message to include: "with the extension '.xml' or '.XML'" in PDS4Problems.java
8. Add debug statements and logic to report warning if read too many records to TableDataContentValidationRule.java
9. Add BAD_EXTENSION type to support new errors detected to StepDefs.java
10. Add new tests to validate.feature

Refs:

#355 Improve validate reporting when trying to read a null row
#356 validate labels error.sub_directory.unallowed_name as a warning
#357 Validate allows CRLF within a Table_Delimited field
#364 validate does not allow ".XML" as an extension for a label file
@jordanpadams
Copy link
Member

@seanhardman this should be fixed in our latest release: https://github.com/NASA-PDS/validate/releases/tag/v2.0.7

@seanhardman
Copy link
Author

Looks good. Thanks.

@jpl-jengelke
Copy link
Contributor

@jordanpadams Executing the test fails with validate 2.1.0 SNAPSHOT, but it does not fail for the stated reason of ALL CAPS:
364_execution.txt
test_364-1.txt

Is this OK?

@jordanpadams
Copy link
Member

@jpl-jengelke that is fine. we should really update that test data to actually be valid though. can you create a ticket for that? https://github.com/NASA-PDS/validate/issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B12.0 bug Something isn't working s.medium
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants