-
Notifications
You must be signed in to change notification settings - Fork 35
FI-928: Integrate generation with validator #476
FI-928: Integrate generation with validator #476
Conversation
|
||
begin | ||
Inferno.logger.info "Posting IG for '#{module_name}' to validator" | ||
RestClient.post("#{validator_url}/igs", File.read(file.path)) |
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.
From what I can tell, you are not using the response from this route for anything, right? I just wanted to make sure because in inferno-community/fhir-validator-wrapper#16, we recently changed the response for the PUT
and POST /igs
routes. Just wanted to give you a heads-up in case this might break some functionality in this PR.
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.
If it receives a 4xx/5xx response, then an error is raised, otherwise it's not doing anything with the response.
I think it'd be worth updating the i.e. validator_service:
image: infernocommunity/fhir-validator-wrapper can be changed to validator_service:
image: infernocommunity/fhir-validator-service |
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 like how this waits for the validator service to be up. I'm a little wary about not having any protection from simply overwriting our public service's IGs (could have some secret in an env variable, or blocking the route externally in our site-overlay). But that doesn't seem like a likely issue and we can wait on that. I wonder if this slows down startup time in practice... but if it does, we can address then.
Splitting these pieces off into microservices sure does add a lot of code. My dream is to reunify validation back into Ruby so we can get back to monolith. But this looks good for now 👍
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.
Tested it again and it worked well. Still some issues when the IGs do not include a index.json
, but that's more of an issue on the validator side.
This branch integrates the generic generator with the validator service. When Inferno starts up, the resources for any module created via the generic will be posted to the validator service so that it can validate resources. This only works for the contents of an IG package containing the corresponding
package.json
. If nopackage.json
is present, the resources are not uploaded to the validator.This functionality depends on inferno-framework/fhir-validator-wrapper#16 and inferno-framework/fhir-validator-wrapper#18
Loading inferno's modules has been moved from
Inferno::Module
to a newInferno::StartupTasks
. Loading modules now may involve making a POST to an external service, so this change makes it so that you won't make external HTTP requests just by requiringlib/app/models/module.rb
.Submitter:
Reviewer 1:
Name:
where appropriate, and accomplishes the task's purpose
Reviewer 2:
Name:
where appropriate, and accomplishes the task's purpose