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

Automatically load hl7.fhir.uv.tools dependency #1186

Merged
merged 2 commits into from
Dec 13, 2022

Conversation

mint-thompson
Copy link
Collaborator

Fixes #1166 and completes task CIMPL-1036.

The current version of this package will always be loaded, even if it is not configured as a dependency. If it is configured as a dependency, use the configured version. When it fails to load, log a warning instead of an error if it was not a configured dependency.

My strategy for implementing this was to consider loading dependencies in two groups: automatic dependencies and configured dependencies. Hopefully, this makes it straightforward to add more automatic dependencies later. There are changes to a lot of the tests for loadExternalDependencies, since there's now an additional package that shows up every time. A lot of those tests are really testing loadConfiguredDependencies, though, so it may be worthwhile to adjust the tests accordingly. Please let me know if you think that would be useful.

The current version of this package will always be loaded, even if it is
not configured as a dependency. If it is configured as a dependency, use
the configured version. When it fails to load, log a warning instead of
an error if it was not a configured dependency.
Copy link
Member

@cmoesel cmoesel left a comment

Choose a reason for hiding this comment

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

This looks good and works well! I tested it locally w/ an existing cache as well as a cleared cache. I also tweaked the package date in the cached package and saw that it was detected as being stale. That's good!

I've only asked for one small change (to have the warning indicate it is an automatic dependency). The changes in the test file are all optional.

src/utils/Processing.ts Outdated Show resolved Hide resolved
test/utils/Processing.test.ts Outdated Show resolved Hide resolved
test/utils/Processing.test.ts Outdated Show resolved Hide resolved
test/utils/Processing.test.ts Show resolved Hide resolved
Add helper function to check for the presence of automatic dependencies
in the package list.
Copy link
Collaborator

@jafeltra jafeltra left a comment

Choose a reason for hiding this comment

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

These changes make sense to me and work as expected!

Copy link
Member

@cmoesel cmoesel left a comment

Choose a reason for hiding this comment

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

Hurray!

@cmoesel cmoesel merged commit f13bdd2 into master Dec 13, 2022
@cmoesel cmoesel deleted the cimpl-1036-uv-tools-available branch December 13, 2022 18:24
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.

SUSHI should always put hl7.fhir.uv.tools in scope
3 participants