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 labels error.sub_directory.unallowed_name as a warning #356

Closed
tbarnes4 opened this issue Jun 7, 2021 · 6 comments · Fixed by #365
Closed

validate labels error.sub_directory.unallowed_name as a warning #356

tbarnes4 opened this issue Jun 7, 2021 · 6 comments · Fixed by #365
Assignees
Labels
bug Something isn't working s.low

Comments

@tbarnes4
Copy link

tbarnes4 commented Jun 7, 2021

🐛 Describe the bug

This a very minor typographical bug. As of version 2 of the validate tool, the sub_directory_unallowed_name error was made into a warning for instances of a directory named 'data' or 'document' instead a collection. I would expect the error code "error.sub_directory.unallowed_name" should probably be "warning.sub_directory.unallowed_name" instead. It is properly reported as a WARNING in the validation results and summary sections.

In the Validation Results section of the report:

WARNING [error.sub_directory.unallowed_name] Directory name is reserved and not in the reco
mmended location in the bundle root directory

In the Summary section of the report:

Message Types:
1 error.sub_directory.unallowed_name

📜 To Reproduce

Steps to reproduce the behavior:

  1. run the tool on a collection that has a 'data' or 'document' subdirectory.
  2. Scroll down until you find the "[WARNING] [error.sub_directory.unallowed_name]" line.
  3. See error
    1. Scroll down until you get to the Summary section and can see the Message Types.
  4. See error

🕵️ Expected behavior

I would expect the error code "error.sub_directory.unallowed_name" should probably be "warning.sub_directory.unallowed_name" instead.

📚 Version of Software Used

validate 2.0.6

🩺 Test Data / Additional context

Ex: https://pdssbn.astro.umd.edu/holdings/pds4-epoxi_mri-v1.0/hartley2_photometry/SUPPORT/dataset.shtml


🦄 Applicable requirements**

@jordanpadams
Copy link
Member

@tbarnes4 apologies for the delay in triaging of this ticket. definitely agree this needs to be updated. adding to the queue and will hopefully be fixed this next sprint

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

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

@jpl-jengelke
Copy link
Contributor

@jordanpadams There are now no ERRORs nor WARNINGS. Is this still an issue that is being reported?

See:
356_execution.txt
test_356-1.txt

@jordanpadams
Copy link
Member

@jpl-jengelke I think this check only takes affect when the -R pds4.bundle rule is enabled? At least that is how @qchaupds was testing it in the PR, and that makes sense to me since we don't assume we are checking for collections unless we are specifically requested to do so with the rule enabled.

validate -R pds4.bundle --skip-product-validation --skip-context-validation --skip-content-validation -r report_github356_bundle_valid.json   -s json -t src/test/resources/github240/valid/bundle_kaguya_derived.xml

@tbarnes4
Copy link
Author

@jordanpadams It will also display if you do the -R pds4.collection rule, otherwise I have not seen sub_directory.unallowed_name warning be reported.

@jordanpadams
Copy link
Member

@tbarnes4 thanks!

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

Successfully merging a pull request may close this issue.

5 participants