Skip to content

Comments

Add LIDVID to context reference mismatch messages#1511

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/add-lid-to-context-validation
Draft

Add LIDVID to context reference mismatch messages#1511
Copilot wants to merge 2 commits intomainfrom
copilot/add-lid-to-context-validation

Conversation

Copy link

Copilot AI commented Feb 18, 2026

Context reference mismatch warnings didn't include the LIDVID, forcing users to manually open label files to determine which context object was involved. This is problematic when multiple context objects share similar or identical names across different LIDs.

Changes

Updated ContextProductReferenceValidationRule.java to include LIDVID in both mismatch message types:

Before:

"Context reference name mismatch. Value: '" + name + "' Expected one of: '" + rgp.getNames() + "'"
"Context reference type mismatch. Value: '" + type + "' Expected one of: '" + rgp.getTypes() + "'"

After:

"Context reference name mismatch. LIDVID: '" + lidvid + "'. Value: '" + name + "' Expected one of: '" + rgp.getNames() + "'"
"Context reference type mismatch. LIDVID: '" + lidvid + "'. Value: '" + type + "' Expected one of: '" + rgp.getTypes() + "'"

The lidvid variable was already in scope (line 225), so no additional data retrieval needed.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • central.sonatype.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/validate/validate org.codehaus.plexus.classworlds.launcher.Launcher clean compile (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/validate/validate org.codehaus.plexus.classworlds.launcher.Launcher clean compile -DskipTests (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/validate/validate org.codehaus.plexus.classworlds.launcher.Launcher -f pom.xml -B -V -e -Dfindbugs.skip -Dcheckstyle.skip -Dpmd.skip=true -Dspotbugs.skip -Denforcer.skip -Dmaven.javadoc.skip (dns block)
  • repo.osgeo.org
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/validate/validate org.codehaus.plexus.classworlds.launcher.Launcher clean compile (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/validate/validate org.codehaus.plexus.classworlds.launcher.Launcher clean compile -DskipTests (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/validate/validate org.codehaus.plexus.classworlds.launcher.Launcher -f pom.xml -B -V -e -Dfindbugs.skip -Dcheckstyle.skip -Dpmd.skip=true -Dspotbugs.skip -Denforcer.skip -Dmaven.javadoc.skip (dns block)
  • www.oasis-open.org
    • Triggering command: /opt/hostedtoolcache/CodeQL/2.24.1/x64/codeql/tools/linux64/java/bin/java /opt/hostedtoolcache/CodeQL/2.24.1/x64/codeql/tools/linux64/java/bin/java -jar /opt/hostedtoolcache/CodeQL/2.24.1/x64/codeql/xml/tools/xml-extractor.jar --fileList=/home/REDACTED/work/validate/.codeql-scratch/dbs/java/working/files-to-index4352479359627078922.list --sourceArchiveDir=/home/REDACTED/work/validate/.codeql-scratch/dbs/java/src --outputDir=/home/REDACTED/work/validate/.codeql-scratch/dbs/java/trap/java (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>As a user, I want the validate report entry for when there is a context name mismatch to show the LID of the context object as well as the correct known values..</issue_title>
<issue_description>### Checked for duplicates

Yes - I've already checked

🧑‍🔬 User Persona(s)

Node operator and data providers.

💪 Motivation

Whenever there is context name mismatch warning reported in the validate report it shows what value the label has and what the possible acceptable values are form the context object. Sometimes the names make it unclear what context object this should be. So I always have to open up the label, go to the line specified in the validate report and see what the LID is, so I can see if label provided value may actually be correct or which value may be wanted. If I knew what the LID was quickly, I could more quickly investigate the problem. One problem with some context names is that they are the same across multiple LIDs or not very descript (yes, this is probably a problem with the context objects themselves), this can then report a similar (or exact) looking warning which are actually for multiple LIDs.

📖 Additional Details

No response

Acceptance Criteria

Given a PDS4 label containing context product references where the name or type in the label does not match the registered context product values
When I perform validation using the validate tool with context validation enabled
Then I expect the validation report warning/info message to include the LIDVID of the context object, formatted as:

  • Context reference name mismatch. LIDVID: '<lidvid>'. Value: '<label_value>' Expected one of: '<registered_values>'
  • Context reference type mismatch. LIDVID: '<lidvid>'. Value: '<label_value>' Expected one of: '<registered_values>'

⚙️ Engineering Details

File to modify: src/main/java/gov/nasa/pds/tools/validate/rule/pds4/ContextProductReferenceValidationRule.java

Changes required:

  1. Name mismatch message (lines 281-286): Update from:
"Context reference name mismatch. Value: '" + name + "'" + " Expected one of: '" + rgp.getNames() + "'"

To:

"Context reference name mismatch. LIDVID: '" + lidvid + "'. Value: '" + name + "'" + " Expected one of: '" + rgp.getNames() + "'"
  1. Type mismatch message (lines 294-298): Update from:
"Context reference type mismatch. Value: '" + type + "'" + " Expected one of: '" + rgp.getTypes() + "'"

To:

"Context reference type mismatch. LIDVID: '" + lidvid + "'. Value: '" + type + "'" + " Expected one of: '" + rgp.getTypes() + "'"

Note: The lidvid variable is already in scope at both locations (defined at line 225), so no additional data retrieval is needed.

Testing: Add test case to verify LIDVID appears in mismatch messages. Consider adding scenario to src/test/resources/features/ with expected output containing the LIDVID pattern.

🎉 I&T

No response
</issue_description>

Comments on the Issue (you are @copilot in this section)

@jordanpadams Skipping I&T. This is a simple change to log message output that does not require additional test cases.

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: jordanpadams <33492486+jordanpadams@users.noreply.github.com>
Copilot AI changed the title [WIP] Add LID display for context name mismatch in validation report Add LIDVID to context reference mismatch messages Feb 18, 2026
Copilot AI requested a review from jordanpadams February 18, 2026 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants