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

Different behavior depending on how validate is invoked #932

Closed
rgdeen opened this issue Jun 11, 2024 · 5 comments
Closed

Different behavior depending on how validate is invoked #932

rgdeen opened this issue Jun 11, 2024 · 5 comments
Assignees
Labels
bug Something isn't working duplicate This issue or pull request already exists needs:triage

Comments

@rgdeen
Copy link

rgdeen commented Jun 11, 2024

Checked for duplicates

No - I haven't checked

🐛 Describe the bug

When I provide a directory as -target, my labels pass. However, if I specify the actual label file as -target, I get additional warnings. The warnings are probably legitimate (although I'll ignore them in this case), but the disturbing part is that the behavior is different based on how the program is invoked.

First, invoking as a directory, there are no warnings:

(aws) [rgd@pdsimg-int1 msam2]$ /mnt/pdsdata/scratch/rgd/msam2/validate-3.5.1/bin/validate -target /tmp/xx/ --skip-content-validation    
PDS Validate Tool Report

Configuration:
   Version     3.5.1
   Date        2024-06-11T17:28:37Z

Parameters:
   Targets                      [file:/tmp/xx/]
   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     /mnt/pdsdata/scratch/rgd/msam2/validate-3.5.1/resources/registered_context_products.json



Product Level Validation Results

  PASS: file:/tmp/xx/MR0_669431333EDR_S0870792MCAM16002D1.xml
        1 product validation(s) completed

Summary:

  1 product(s)
  0 error(s)
  0 warning(s)

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

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


End of Report
Completed execution in 23568 ms

(aws) [rgd@pdsimg-int1 msam2]$ 

Now, invoking with the specific file instead of the directory creates some warnings:

(aws) [rgd@pdsimg-int1 msam2]$ /mnt/pdsdata/scratch/rgd/msam2/validate-3.5.1/bin/validate -target /tmp/xx/MR0_669431333EDR_S0870792MCAM16002D1.xml --skip-content-validation

PDS Validate Tool Report

Configuration:
   Version     3.5.1
   Date        2024-06-11T17:29:36Z

Parameters:
   Targets                      [file:/tmp/xx/MR0_669431333EDR_S0870792MCAM16002D1.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     /mnt/pdsdata/scratch/rgd/msam2/validate-3.5.1/resources/registered_context_products.json



Product Level Validation Results

  PASS: file:/tmp/xx/MR0_669431333EDR_S0870792MCAM16002D1.xml
      WARNING  [warning.label.context_ref_mismatch]   line 62: Context reference name mismatch. Value: 'MSAM' Expected one of: '[MARS SCIENCE LABORATORY]'
      WARNING  [warning.label.context_ref_mismatch]   line 62: Context reference type mismatch. Value: 'Individual Investigation' Expected one of: '[Mission]'
        1 product validation(s) completed

Summary:

  1 product(s)
  0 error(s)
  2 warning(s)

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

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

  Message Types:
    2            warning.label.context_ref_mismatch

End of Report
Completed execution in 22945 ms

(aws) [rgd@pdsimg-int1 msam2]$ 

That label is the only thing in the directory:

(aws) [rgd@pdsimg-int1 msam2]$ ls /tmp/xx
MR0_669431333EDR_S0870792MCAM16002D1.xml
(aws) [rgd@pdsimg-int1 msam2]$ 

Label file is provided below,

🕵️ Expected behavior

Expect the same behavior regardless of how it's invoked, of course.

📜 To Reproduce

see writeup above

🖥 Environment Info

(aws) [rgd@pdsimg-int1 msam2]$ uname -a
Linux pdsimg-int1 3.10.0-1160.76.1.el7.x86_64 #1 SMP Tue Jul 26 14:15:37 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
(aws) [rgd@pdsimg-int1 msam2]$ java --version
java 17.0.11 2024-04-16 LTS
Java(TM) SE Runtime Environment (build 17.0.11+7-LTS-207)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.11+7-LTS-207, mixed mode, sharing)
(aws) [rgd@pdsimg-int1 msam2]$

📚 Version of Software Used

(aws) [rgd@pdsimg-int1 msam2]$ /mnt/pdsdata/scratch/rgd/msam2/validate-3.5.1/bin/validate -version

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

Copyright 2019, by the California Institute of Technology ("Caltech").
All rights reserved.

(aws) [rgd@pdsimg-int1 msam2]$

🩺 Test Data / Additional context

MR0_669431333EDR_S0870792MCAM16002D1.xml.txt

(renamed to .xml.txt so githup would upload It (??!))

🦄 Related requirements

No response

⚙️ Engineering Details

No response

🎉 Integration & Test

No response

@rgdeen
Copy link
Author

rgdeen commented Jun 11, 2024

Actually there's some question about the legitimacy of the warning... in a big discussion between Myche, Trent, Kate, Richard Chen, and myself a year ago for MSAM 1 we decided to reference the mission here... we didn't want to have to make specific context products for II's for PDARTs because the definition of individual investigation didn't exactly fit.

Can that warning be disabled?

But that's a separate issue... the fact that we get different answers based on dir vs file is certainly a bug... whether the warning is legit or not.

@rgdeen
Copy link
Author

rgdeen commented Jun 11, 2024

the irony of the above is that I'm actually fine with the status quo, as I don't want that warning in my logs. But it's still a bug, and makes me wonder what other things are different based on invocation method...

@al-niessner
Copy link
Contributor

Already noted and fixed via #915

@al-niessner
Copy link
Contributor

Yes, with --disable-context-mismatch-warnings

@jordanpadams
Copy link
Member

jordanpadams commented Jun 11, 2024

closing as duplicate for #915

@jordanpadams jordanpadams added the duplicate This issue or pull request already exists label Jun 11, 2024
@github-project-automation github-project-automation bot moved this from ToDo to 🏁 Done in EN Portfolio Backlog Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists needs:triage
Projects
Status: 🏁 Done
Development

No branches or pull requests

3 participants