Skip to content

Fix set-archive-status bare LID resolution and silent bundle cascade failure - #57

Draft
jordanpadams with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-cascade-archive-status-update
Draft

Fix set-archive-status bare LID resolution and silent bundle cascade failure#57
jordanpadams with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-cascade-archive-status-update

Conversation

Copilot AI commented Mar 28, 2026

Copy link
Copy Markdown

set-archive-status -lidvid <bare-LID> silently did nothing because getProductClass() performs a direct document ID lookup (stored as LIDVIDs), so a bare LID 404s and is swallowed. Additionally, bundle→collection cascade silently skipped all collections when ref_lid_collection/ref_lidvid_collection fields were absent.

Changes

ProductService.updateArchiveStatus(String, String)

  • Bare LID resolution: on getProductClass() returning null, if input has no ::, attempt getLatestLidVids() to resolve to latest LIDVID and retry. On continued failure, throw a descriptive Exception instead of silently returning.
  • Empty cascade warning: after resolving bundle collection references, emit WARN if the resulting set is empty, pointing to the missing fields.
// Before: silent warn + return
if(pClass == null) {
    log.warn("Unknown LIDVID: " + lidvid);
    return;
}

// After: auto-resolve bare LID, then fail loudly
if(!lidvid.contains("::")) {
    List<String> resolved = dao.getLatestLidVids(Collections.singletonList(lidvid));
    if(resolved != null && !resolved.isEmpty()) {
        resolvedLidvid = resolved.get(0);
        pClass = dao.getProductClass(resolvedLidvid);
    }
}
if(pClass == null) {
    throw new Exception("Unknown LID/LIDVID: " + lidvid + ". Verify ...");
}

SetArchiveStatusCmd.printHelp()

  • Documents bare LID auto-resolution and bundle→collection→product cascade behavior.

TestProductService (new)

  • 7 JUnit 5 unit tests via a ProductDao stub covering: bare LID resolution, unknown identifier error path, empty bundle cascade, cascade by LID reference, cascade by LIDVID reference, and collection inventory cascade.

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.14/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.14/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.14 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.14/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/registry-loader/registry-loader 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.14/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.14/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.14 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.14/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/registry-loader/registry-loader org.codehaus.plexus.classworlds.launcher.Launcher --quiet compile -pl common 1/REQUIREMENTS.md 0/REQUIREMENTS.md 0/REQUIREMENTS.md 0/REQUIREMENTS.md 0/REQUIREMENTS.md 1/REQUIREMENTS.md 1/REQUIREMENTS.md (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.14/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.14/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.14 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.14/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/registry-loader/registry-loader org.codehaus.plexus.classworlds.launcher.Launcher -pl common test (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.14/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.14/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.14 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.14/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/registry-loader/registry-loader org.codehaus.plexus.classworlds.launcher.Launcher --quiet package -DskipTests (dns block)

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


📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

…de, improve help text

Agent-Logs-Url: https://github.com/NASA-PDS/registry-loader/sessions/ce52854d-a13e-4593-a0c6-86051ec310eb

Co-authored-by: jordanpadams <33492486+jordanpadams@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix cascade status update for set-archive-status command Fix set-archive-status bare LID resolution and silent bundle cascade failure Mar 28, 2026
Copilot AI requested a review from jordanpadams March 28, 2026 13:56
- Move TestProductService to proper package (gov.nasa.pds.registry.common.es.service)
- Fix early return in bundle cascade that skipped final log message
- Handle null collectionIds gracefully to ensure consistent logging

These changes improve code organization and ensure the "Updated a total of X products"
message is always logged regardless of the bundle cascade outcome.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Apr 3, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@jordanpadams
jordanpadams marked this pull request as ready for review July 2, 2026 23:50
@jordanpadams
jordanpadams requested a review from a team as a code owner July 2, 2026 23:50
@jordanpadams
jordanpadams marked this pull request as draft July 2, 2026 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

set-archive-status does not cascade from bundle to collections/products when a LID is provided

2 participants