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

add patch wildcard for ig dependencies #340

Merged

Conversation

oliveregger
Copy link
Contributor

The NPM fhir specification says:

When packages point to dependencies they should refer to the whole package version number and not use wildcards, except for the patch version in a semver version reference:

"hl7.fhir.core" : "3.0.x"
This x here means that it should a package resolver should accept the package with the highest found patch number.

This PR adds supports for the following use cases:

  • if an ig dependency is defined as .x the latest patch version will used from the file package cache or installed from the package server
  • if the ValidationEngine is called and a patched version is already specified before the dependency, the patched version will be used.

e.g.:
ch-core is depending on ch-epr-term 2.0.x, see ig

java -jar org.hl7.fhir.validator_cli.jar -version 4.0.1 -ig ch.fhir.ig.ch-core#current HPWengerRole.xml 

will download ch-epr-term 2.0.4 (latest published version) into the package cache and will be used for validation

java -jar org.hl7.fhir.validator_cli.jar -version 4.0.1 -ig ch.fhir.ig.ch-epr-term#2.0.3 -ig ch.fhir.ig.ch-core#current HPWengerRole.xml 

will download ch-epr-term 2.0.3 into the package cache and will be used for validation, ch-epr-term 2.0.4 will not be used

java -jar org.hl7.fhir.validator_cli.jar -version 4.0.1 -ig ch.fhir.ig.ch-epr-term#2.0.4 -ig ch.fhir.ig.ch-core#current HPWengerRole.xml 
java -jar org.hl7.fhir.validator_cli.jar -version 4.0.1 -ig ch.fhir.ig.ch-core#current HPWengerRole.xml 

ch-epr-term 2.0.4 will be used for validation

This PR is depending on a PR for the IG Publisher to support building implementation guide, will follow after this one, since the IG Publisher is depending on this project.

@oliveregger oliveregger changed the title add patch wildcard for ig depencies add patch wildcard for ig dependencies Sep 8, 2020
@codecov
Copy link

codecov bot commented Sep 8, 2020

Codecov Report

Merging #340 into master will decrease coverage by 0.00%.
The diff coverage is 6.25%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #340      +/-   ##
==========================================
- Coverage    8.44%    8.44%   -0.01%     
==========================================
  Files        1140     1140              
  Lines      519798   519845      +47     
  Branches   154934   154951      +17     
==========================================
+ Hits        43878    43880       +2     
- Misses     458423   458464      +41     
- Partials    17497    17501       +4     
Impacted Files Coverage Δ
.../java/org/hl7/fhir/utilities/VersionUtilities.java 37.88% <0.00%> (-3.27%) ⬇️
.../fhir/utilities/cache/BasePackageCacheManager.java 33.33% <0.00%> (-1.05%) ⬇️
...va/org/hl7/fhir/utilities/cache/PackageClient.java 57.57% <0.00%> (-5.76%) ⬇️
...java/org/hl7/fhir/validation/ValidationEngine.java 9.74% <0.00%> (-0.07%) ⬇️
...utilities/cache/FilesystemPackageCacheManager.java 23.66% <30.00%> (-0.03%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a92876a...6b1ae88. Read the comment docs.

@oliveregger
Copy link
Contributor Author

An additional PR for the IG Publisher is not necessary, as soon as the dependency to this project is added it works.

Copy link
Collaborator

@grahamegrieve grahamegrieve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

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.

2 participants