Missing referential integrity checks from browse products to others i…#440
Merged
jordanpadams merged 2 commits intomainfrom Nov 12, 2021
Merged
Missing referential integrity checks from browse products to others i…#440jordanpadams merged 2 commits intomainfrom
jordanpadams merged 2 commits intomainfrom
Conversation
…n the bundle 1. Add test resources : src/test/resources/github432 2. Add debug statements : src/main/java/gov/nasa/pds/tools/util/ReferentialIntegrityUtil.java 3. Modify uppercase 'ERROR' to lowercase 'error' so as not to confuse the log file : src/main/java/gov/nasa/pds/tools/validate/rule/pds4/LabelValidationRule.java 4. Add debug statements and printing of warning message when the exceptions.get(location) call returns null : src/main/java/gov/nasa/pds/validate/ValidateLauncher.java 5. Add debug statements and checking for null-ness before calling toString() to avoid NullPointerException : src/main/java/gov/nasa/pds/validate/report/Report.java Refs: #432 Missing referential integrity checks from browse products to others in the bundle
jordanpadams
requested changes
Nov 10, 2021
Member
jordanpadams
left a comment
There was a problem hiding this comment.
@qchaupds this unfortunately does not fix the issue identified here: #308 (comment)
This reference:
<Reference_List>
<Internal_Reference>
<lid_reference>urn:nasa:pds:vg1-pls-sat:data-ion-moments-96sec:nonexistentxxx</lid_reference> <!-- val308 should catch this -->
<reference_type>browse_to_data</reference_type>
</Internal_Reference>
</Reference_List>
Per your #308 and PR #347, this should raise a warning.integrity.unreferenced_member error because the product urn:nasa:pds:vg1-pls-sat:data-ion-moments-96sec:nonexistentxxx is not a part of the urn:nasa:pds:vg1-pls-sat:data-ion-moments-96sec collection.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
…n the bundle
Refs:
#432 Missing referential integrity checks from browse products to others in the bundle
Closes #432 Missing referential integrity checks from browse products to others in the bundle
It is important to use the rule "-R pds4.bundle" when validating a bundle. The rule gives guidance of what things are being required to run, including referential checks.
If the correct rule is not being used, only label or directory rules are applied based on the name of the target.
Note that the checking is done for references within a bundle only. As Jordan had indicated, this is another ticket to check for references outside of the bundle beyond the scope of this ticket.
Tested in DEV:
Test 1: Specify rule "-R pds4.bundle"
There should be 3 WARN messages:
Test 2: Specify rule "-R pds4.label" when validating bundle-voyager1-pls-sat-1.0.xml as a label.
There should be no warning messages.
Test 3: Specify no rule. The default rule used by validate will be "PDS4 Directory"
There should be no warning messages.