-
Notifications
You must be signed in to change notification settings - Fork 120
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
Nested NPM package support #1149
Conversation
…pendency loading for npm package manager class
…n checks, and enhanced testing
Ready for review. Resolution for #847 @ktarasenko feel free to validate this logic with any testing you have locally |
Thanks, will give it a try! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for cleaning up, looks much better now!
@@ -3,4 +3,6 @@ | |||
dependencies { | |||
implementation project(':cql-to-elm') | |||
implementation group: 'com.google.code.gson', name: 'gson', version: '2.9.1' | |||
implementation group: 'org.apache.commons', name: 'commons-compress', version: '1.20' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see where you are using these dependencies
} | ||
|
||
@Override | ||
public void logMessage(String message) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for fixing the logger!
@@ -40,7 +39,7 @@ public Library readLibrary(InputStream stream) throws FHIRFormatError, IOExcepti | |||
VersionConvertor_40_50 versionConvertor_40_50 = new VersionConvertor_40_50(new BaseAdvisor_40_50()); | |||
return (Library) versionConvertor_40_50.convertResource(res); | |||
} else if (VersionUtilities.isR5Ver(version)) { | |||
return (Library) new JsonParser().parse(stream); | |||
return (Library) new org.hl7.fhir.r5.formats.JsonParser().parse(stream); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: is it intenional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. This is needed to avoid org.objectweb.asm.ClassTooLargeException: Class too large: org/hl7/fhir/r5/formats/JsonParser
. See this PR for more information on why that is required.
import org.hl7.fhir.convertors.conv40_50.VersionConvertor_40_50; | ||
import org.hl7.fhir.exceptions.FHIRException; | ||
import org.hl7.fhir.r4.formats.FormatUtilities; | ||
import ca.uhn.fhir.model.primitive.IdDt; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the difference between this and IdType?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IdDt is not model-specific
private static final Logger logger = LoggerFactory.getLogger(NpmPackageManager.class); | ||
private final ImplementationGuide sourceIg; | ||
private final FilesystemPackageCacheManager fspcm; | ||
private final List<NpmPackage> npmList; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: could be initialized here
|
||
try { | ||
// userMode indicates whether the packageCache is within the working directory or in the user home | ||
fspcm = new FilesystemPackageCacheManager(true, ToolsVersion.TOOLS_VERSION); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I ask you to go an extra mile and add a way to inject FilesystemPackageCacheManager
(but keep the existing manager as the default) ?
This will solve two problems:
- allow to provide a fake package manager to have better tests (like the test that verifies that dependencies were actually loaded, similar to what i did here )
- use the same class with more android friendly version FilesystemPackageCacheManager
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applied in latest commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, builds locally, tests pass. Also verified CQF Tooling still builds and tests pass correctly with this snapshot build
Just seeing if this passes CI build for now. Still needs cleanup and hardening