-
Notifications
You must be signed in to change notification settings - Fork 26
Library dependency packaging fails due to CqlProcessor fileMap key mismatch introduced in 3.9.0 #591
Description
The Bug
The refreshGeneratedContent method in LibraryProcessor fails to populate relatedArtifact entries (type depends-on) on Library resources during RefreshIG. This causes the packaging step to produce bundles missing dependency Libraries and ValueSets.
Root Cause
In v3.8.0, LibraryProcessor.refreshGeneratedContent() set the attachment URL to the absolute file path (att.setUrl(f.getAbsolutePath())). This matched the keys in CqlProcessor.fileMap, which are also absolute file paths (file.getAbsoluteFile().toString() at CqlProcessor.java:384). So getFileInformation(attachment.getUrl()) successfully looked up the CQL source info and relatedArtifact entries were populated.
Starting in v3.9.1, refreshGeneratedContent() had this change:
CqlProcessor.CqlSourceFileInformation info = getCqlProcessor().getFileInformation(attachment.getUrl());
if (this.parentContext != null && this.parentContext.getCanonicalBase() != null) {
attachment.setUrl(this.parentContext.getCanonicalBase() + "/" + fileName);
}
This mismatch (canonical URL vs file path) causes getFileInformation() to return null, relatedArtifact entries are never set on the Library, and the packaging step finds no dependencies to include.
Impact (used NHSN IG as a test case)
- Bundles produced by RefreshIG contain only the Measure and its primary Library — dependency Libraries and ValueSets are missing
- The issue is masked on subsequent runs if a previous run (e.g., with v3.8.0) had already written relatedArtifact entries to the Library files on disk, since the packaging step reads from a stale in-memory cache populated at the start of the run
Affected Versions
v3.9.0 through current (master)
To Reproduce
Steps to reproduce the behavior:
- Delete the relatedArtifact entries of type depends-on from one of the Library resources in input/resources/library/ (e.g., NHSNHelpers.json)
- Run _refresh.sh (which uses tooling-cli-3.9.1.jar)
- Check the output bundle in bundles/measure/ — the bundle will contain only the Measure and its primary Library, missing the dependency Libraries and ValueSets
- Check input/resources/library/NHSNHelpers.json — the relatedArtifact entries of type depends-on will still be missing despite the refresh having run
Expected behavior
The refresh operation populates the relatedArtifact dependencies
Desktop:
- OS: Mac Tahoe v26.3
- Java Version 17