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

As a user, I want validate to raise a WARNING when differing versions of IM are used within a bundle #210

Closed
Tracked by #710
jordanpadams opened this issue Apr 4, 2020 · 6 comments · Fixed by #312
Assignees

Comments

@jordanpadams
Copy link
Member

Is your feature request related to a problem? Please describe.
Per https://pds-jira.jpl.nasa.gov/projects/SW/issues/SW-28:

The Validate software should return a warning if, when validating a bundle against a particular version of the IM, any label should contain a different version of the IM (whether older or newer version).


Triage Response
This should be an optional flag that a user can enable if they would prefer all dictionaries follow the same IM version. Many bundles no longer follow this paradigm, but a warning may be useful here as it throws our software through a loop when we have differing versions ingested all at once.

@jordanpadams jordanpadams added enhancement New feature or request triage-needed and removed triage-needed labels Apr 4, 2020
@jordanpadams jordanpadams changed the title Update validate to warn when differing versions of IM are used within a bundle As a user, I want validate to raise a WARNING when differing versions of IM are used within a bundle Mar 14, 2021
@jordanpadams
Copy link
Member Author

May be something we can raise as part of #188

@qchaupds
Copy link
Contributor

@jordanpadams Jordan, would you clarify if the versions referring to are the versions from the label only or from the schemas and the schematrons as well? Would validate keep a track of all versions from all labels and at the end report that there are more than one versions? What if the user really is OK with it (as they are now)?

@jordanpadams
Copy link
Member Author

@qchaupds let's warn for just the version of the labels. i know we read in the "stack" of dictionaries that each of the LDDs use, but let's not include those in this warning check.

@qchaupds
Copy link
Contributor

The following flag:

--prefer-all-labels-same-information-model-version

will be added to allow the user to see a warning in the report if not all versions of the (IM) are the same.

Without the flag, there will be no warning. This flag should work for pds4.bundle and multiple targets with the -t parameter.

An example WARNING message:

  "status": "PASS",
  "label": "file:/home/qchau/sandbox/validate/src/test/resources/github210/bundle_cassini-huygens-coradar.xml",
  "messages": [
    {
      "severity": "WARNING",
      "type": "info.validation.general",
      "message": "Multiple versions (2) of Information Model (IM) found in this run:  1.12.0.0 1.10.0.0"
    }
  ],
  "fragments": [],
  "dataContents": []
}

These two labels have different IM versions.

% grep information_model_version src/test/resources/github210/*.xml | egrep "bundle_cassini|Missing_Area_tag.xml"
src/test/resources/github210/BILQH07S314_D065_T008S02_V02_without_Missing_Area_tag.xml: <information_model_version>1.12.0.0</information_model_version>
src/test/resources/github210/bundle_cassini-huygens-coradar.xml: <information_model_version>1.10.0.0</information_model_version>

qchaupds pushed a commit that referenced this issue Mar 24, 2021
…d in the same run and optionally report a warning in the report

1.  Added resource github188 to src/test/resources
2.  Added resource github210 to src/test/resources
3.  Add new class to keep a list of unique IMs processed in LabelUtil.java
4.  Add logic to register IM version for each label to LocationUtil.java and many debugs to find the bug in LabelValidator.java
5.  Fix bug by setting schemaLocation for each label to allow multiple versions of the IM to be processed in LabelValidationRule.java
6.  Consolidate long functions into shorter functions for readability in LabelValidationRule.java
7.  Add debug logging to SchemaValidator.java
8.  Add logic to report warning if requested for labels processed if multiple versions of IM processed in ValidateLauncher.java
9.  Add new parameter PREFER_ALL_LABELS_SAME_INFORMATION_MODEL_VERSION to ConfigKey.java
10. Add new parameter PREFER_ALL_LABELS_SAME_INFORMATION_MODEL_VERSION to Flag.java
11. Add new parameter PREFER_ALL_LABELS_SAME_INFORMATION_MODEL_VERSION to FlagOptions.java
12. Add github188 and github210 tests to feature file validate.feature

Refs:

#188 As a user, I want to validate a bundle that uses multiple versions of the Information Model / Discipline LDDs
#210 As a user, I want validate to raise a WARNING when differing versions of IM are used within a bundle
qchaupds pushed a commit that referenced this issue Mar 24, 2021
…back because report of WARNING is now default

1.  Remove references to optional flag to report WARNING for multiple IM version in ConfigKey.java
2.  Remove references to optional flag to report WARNING for multiple IM version in Flag.java
3.  Remove references to optional flag to report WARNING for multiple IM version in FlagOptions.java
4.  Modify failed test cases due to the WARNING messages are now automatic from feature file validate.feature
5.  Remove some tests that are not as useful from feature file validate.feature

Refs:

#188 As a user, I want to validate a bundle that uses multiple versions of the Information Model / Discipline LDDs
#210 As a user, I want validate to raise a WARNING when differing versions of IM are used within a bundle
@gxtchen
Copy link

gxtchen commented May 17, 2021

@jordanpadams @qchaupds
Is --prefer-all-labels-same-information-model-version the flag is should be testing? I couldn't find it in the document nor with the -h flag.

@jordanpadams
Copy link
Member Author

@gxtchen sorry for hte confusion. that was the original design, but we made this a WARNING all the time. no flag is necessary. see PR at #312 for a couple example runs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants