-
Notifications
You must be signed in to change notification settings - Fork 29
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
latest from Tx Server #621
Conversation
Formatting check succeeded! |
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #621 +/- ##
============================================
+ Coverage 74.17% 74.20% +0.03%
Complexity 19 19
============================================
Files 363 363
Lines 19083 19099 +16
Branches 2532 2530 -2
============================================
+ Hits 14155 14173 +18
+ Misses 3590 3589 -1
+ Partials 1338 1337 -1 ☔ View full report in Codecov by Sentry. |
private Optional<IKnowledgeArtifactAdapter> latestComponentRespectingVersions( | ||
String preReleaseReference, IEndpointAdapter endpoint, boolean latestFromTxServer, boolean isOwned) { | ||
Optional<IKnowledgeArtifactAdapter> latest = Optional.empty(); | ||
var resourceType = Canonicals.getResourceType(preReleaseReference); | ||
var prereleaseReferenceVersion = Canonicals.getVersion(preReleaseReference); | ||
if (isOwned) { | ||
// get the latest version regardless of status because we own the resource so Drafts are ok (they'll be | ||
// updated as part of $release) | ||
latest = VisitorHelper.tryGetLatestVersion(preReleaseReference, repository); | ||
} else if (resourceType != null | ||
&& resourceType.equals(VALUESET) | ||
&& prereleaseReferenceVersion == null | ||
&& latestFromTxServer) { | ||
// ValueSets we don't own go to the Tx Server if latestFromTxServer is true | ||
latest = terminologyServerClient | ||
.getResource(endpoint, preReleaseReference, this.fhirVersion()) | ||
.map(r -> (IKnowledgeArtifactAdapter) createAdapterForResource(r)); | ||
} else { | ||
// get the latest ACTIVE version only because it's NOT owned | ||
latest = VisitorHelper.tryGetLatestVersionWithStatus(preReleaseReference, repository, ACTIVE); | ||
} | ||
return latest; | ||
} |
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.
@sliver007 Wanted to check that the logic here is correct, for components, if latestFromTxServer
is true it should only query the Tx Server if:
- The component is NOT owned
- The reference does not have a version
- The component is referencing a ValueSet
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.
Is there some level of 'authoritativeSource' awareness that is needed here - similar to other areas of $release?
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 there is, thanks 😬
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.
we can't get the actual authoritative source though, we can only check to see if the URL on the endpoint matches the URL in the reference and then 🤞🏾
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.
As per our Slack discussion left it as is and added a comment explaining the assumption 👍🏾 (we assume the caller knows what they're doing, at worst the VSets are just not resolved)
|
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. Thank you!
APHL-1326
This ticket is for the $release operation parameter
latestFromTxServer
, it should pull the latest versions of ValueSets from the Tx server at release time if they do not have versions specified on the canonical references in their parents.Remaining work: