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

Support custom package server #1260

Merged
merged 10 commits into from
May 26, 2023
Merged

Conversation

mint-thompson
Copy link
Collaborator

Fixes #1135 and part of task CIMPL-1000.

If the FPL_CUSTOM_REGISTRY environment variable is set, use it when updating external dependencies and loading automatic dependencies. This variable will also be used by fhir-package-loader, which is responsible for downloading most dependencies.

See also the corresponding PR: FHIR/fhir-package-loader#10. This PR will remain in a draft state until an updated version of fhir-package-loader is available.

If the FPL_CUSTOM_REGISTRY environment variable is set, use it when
updating external dependencies and loading automatic dependencies. This
variable will also be used by fhir-package-loader, which is responsible
for downloading most dependencies.
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.

This looks really good to me as well. I just left one question about a warning message that's logged.

try {
res = await axiosGet(`https://packages2.fhir.org/packages/${dep.packageId}`);
res = await axiosGet(`${process.env.FPL_REGISTRY}/${dep.packageId}`);
latestVersion = res?.data?.['dist-tags']?.latest;
} catch (e) {
logger.warn(`Could not get version info for package ${dep.packageId}`);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if this warning should include some mention that it is trying to load using a custom registry. Maybe Could not get version info for package ${dep.packageId} from custom FHIR package registry?

Copy link
Member

Choose a reason for hiding this comment

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

@mint-thompson - just checking in... are you planning to make this change?

@mint-thompson mint-thompson marked this pull request as ready for review May 15, 2023 18:31
@mint-thompson mint-thompson requested a review from cmoesel as a code owner May 15, 2023 18:31
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.

I noticed one other thing I had a question about below. Everything else is looking good and the new FPL works like a charm ✨

src/utils/Processing.ts Show resolved Hide resolved
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 all works well. I've tested it manually and confirmed that it uses the value in your FPL_REGISTRY environment variable. A few notes:

  1. I think that we should eventually move the logic for "latest" into FPL.
  2. I noticed that since some of this logic (e.g., "latest") doesn't call FPL, the log message about a custom registry being used never gets output.

I think that # 2 above will be resolved when we implement # 1 above.

For now, I think we should include the custom registry URL in the log messages when there is an error. This is actually what FPL does in its error messages anyway, so doing it here will be more consistent and at least provides an indication of the custom registry in use.

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.

Looks good to me!

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.

image

@mint-thompson mint-thompson merged commit 24359df into master May 26, 2023
@mint-thompson mint-thompson deleted the cimpl-1000-custom-registry branch May 26, 2023 17:00
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 support FHIR package downloads from other registries
3 participants