-
Notifications
You must be signed in to change notification settings - Fork 11
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
Fix regression where unlabeled files are not being identified #836
Conversation
Which 7 files do we expect to be unlabeled? |
@al-niessner not positive if these are referenced in a label or not, but I don't have time to look through of the labels to verify. Here is my guess (it may only be 6...):
|
@jordanpadams I am going to move away from this test to #597 and PR #615 because it is much cleaner and potentially related. Long post coming in near future saying no, but still cleaner for testing. |
The code responsible for throwing this error is in one place and one place only: validate/src/main/java/gov/nasa/pds/tools/validate/rule/pds4/FindUnreferencedFiles.java Lines 86 to 110 in 918da20
Blames says that the only change was a year ago in #615. It is possible that we now have false negatives but need to be very careful. One, it is looking only for targets (labels) that it found but are not used by aggregates. It will not find any random extra file because of the loop: validate/src/main/java/gov/nasa/pds/tools/validate/rule/pds4/FindUnreferencedFiles.java Line 97 in 918da20
The loop function in question is here: and has not changed significantly in 5 years (did code reformat 2 years ago). My next guess is that some code block that used to use that problem type was axed. Therefore I rolled back to v3.3.0 which the user reported as working. Still just the one location (FindUnreferencedFiles). Interestingly, v3.3.0 contains #615. It means that either it never detected any random file or what we stuffed in as a target could have been regular files if not referenced by a label. Preparing an approach for this testing but it will not be simple. |
@@ -48,6 +49,9 @@ public void registerTargets() { | |||
try { | |||
Crawler crawler = getContext().getCrawler(); | |||
WildcardOSFilter fileFilter = getContext().getFileFilters(); | |||
if (!"PDS4 Directory".equalsIgnoreCase(getContext().getRule().getCaption())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This got removed in #734. Not sure why and did not leave myself a good comment. Without it, the filter is looking for just XML files.
🗒️ Summary
Put some code back in that got lost during the saxon upgrade #734. Probably removed in an attempt to make something work but it was not the cause and then left it out since none of the regression tests failed.
⚙️ Test Data and/or Report
See automated tests of this PR as they should pass
♻️ Related Issues
Closes #822