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

context_ref_mismatch check only executes when -R pds4.label #915

Closed
tbarnes4 opened this issue May 31, 2024 · 4 comments · Fixed by #921
Closed

context_ref_mismatch check only executes when -R pds4.label #915

tbarnes4 opened this issue May 31, 2024 · 4 comments · Fixed by #921
Assignees
Labels
B15.0 bug Something isn't working i&t.done s.low

Comments

@tbarnes4
Copy link

Checked for duplicates

No - I haven't checked

🐛 Describe the bug

I noticed that the #890 (doing context_ref_mismatch checks) only work when the default validate rule -R pds4.label is running. The check is not made when using the rule pds4.folder, pds4.bundle, nor pds4.collection. This makes this check practically useless when checking a delivery. It only works if you specify each individual label file in the command line, not folders, label files.

🕵️ Expected behavior

I expected that the context_ref_mismatch check works for all 4 of the -R pds4.* rules.

📜 To Reproduce

Download small example collection: https://pdssbn.astro.umd.edu/holdings/pds4-nh_derived:pluto_albedo-v1.0/SUPPORT/dataset.shtml

Run the command: validate -R pds4.collection -t collection.xml

🖥 Environment Info

  • Operating System: MacOSX 12.7.4 and Red Hat Enterprise Linux 9.3

📚 Version of Software Used

gov.nasa.pds:validate
Version 3.5.1
Release Date: 2024-05-25 17:45:47

🩺 Test Data / Additional context

https://pdssbn.astro.umd.edu/holdings/pds4-nh_derived:pluto_albedo-v1.0/SUPPORT/dataset.shtml

🦄 Related requirements

#890

⚙️ Engineering Details

No response

🎉 Integration & Test

No response

@al-niessner
Copy link
Contributor

@jordanpadams

These are the lines that matter:

@Override
public boolean isApplicable(String location) {
// issue_42: Add capability to ignore product-level validation
if (Utility.isDir(location) || !Utility.canRead(location)
|| !getContext().containsKey(PDS4Context.LABEL_DOCUMENT)
|| getContext().getSkipProductValidation()) {
return false;
}
return true;
}

It references a fix to #42 and blame says that the check for !aLabel was there prior to the fix. The obvious solution is to remove the !aLabel check. For some reason validate thought it should only do this reference check for labels. Ringing any historical bells or just make the change and see what happens?

@jordanpadams
Copy link
Member

@al-niessner not sure if I am understanding entirely correctly, but we want this check to apply for any rule used in execution. but we also want it only to apply to PDS4 XML labels. we don't want to perform this check on other files.

@jordanpadams
Copy link
Member

@tbarnes4 the latest SNAPSHOT should have this fix, let me know if you run into any issues

@tbarnes4
Copy link
Author

tbarnes4 commented Jun 7, 2024

@jordanpadams I did the quick check to see if the immediate problem is resolved, and it appears to be. Now if there were any cascading affects of this, I'll have to see as time goes by (if I notice). Thanks!

@jordanpadams jordanpadams changed the title context_ref_mismatch does not run except when -R pds4.label context_ref_mismatch check only executes when -R pds4.label Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B15.0 bug Something isn't working i&t.done s.low
Projects
No open projects
Status: 🏁 Done
Development

Successfully merging a pull request may close this issue.

3 participants