Refactor Base Schema to not require Donor/Specimen/Sample#878
Refactor Base Schema to not require Donor/Specimen/Sample#878
Conversation
…cimen-sample-from-analysis Remove Donor, Specimen, and Sample from Analysis Data Classes in SONG
…cimen-sample-from-base-schema Remove Donor, Specimen, and Samples from Base Schema and Allow in Dynamic Schemas
…cimen-sample-search Remove Donor/Specimen/Sample References from Study and Search APIs
…on-rules-for-analysis Add External Validation Rules for Analysis Properties Based on Dynamic Schema
- when missing, uses value from previous schema or sets as empty (default) value - when set as empty array, replaces current value with empty array (removes optional validations) - sets options in get registration by version query
justincorrigible
left a comment
There was a problem hiding this comment.
This is just awesome! long time coming too.
thanks for taking the time to get this done!
Left a couple comments on the docs side, the rest of the changes LGTM 👍 (except for that random semicolon 😆 maybe I'm missing something?)
|
|
||
| ## Options | ||
|
|
||
| All properties in options are optional. If no value is provided, a default configuration will be used for the analysis. If this is an update to an existing analysis type, you can omit any option and the value will be maintained from the previous version. |
There was a problem hiding this comment.
| All properties in options are optional. If no value is provided, a default configuration will be used for the analysis. If this is an update to an existing analysis type, you can omit any option and the value will be maintained from the previous version. | |
| All properties in "options" are elective. If no value is provided, a default configuration (shown bellow) will be used for the analysis. If this is an update to an existing analysis type, you can omit any option and its value will be maintained from the previous version (if one is available). |
is the following object a representation of the default options? added note here in case that is so, to make it explicit. otherwise, we could include a link to the file/code that contains said default options.
There was a problem hiding this comment.
also, if I omit an option because I'm trying to clear it for whatever reason, but it was already set (and therefor the existing value will be maintained), should we explain here how to remove it?
|
|
||
| ### External Validation | ||
|
|
||
| External validations configure Song to check a value in the analysis against an external service by sending an HTTP GET request to a configurable URL. The URL needs to return 2XX status message to indicate that if the provided value "is valid", typically meaning that the value for this property is known by that service. |
There was a problem hiding this comment.
| External validations configure Song to check a value in the analysis against an external service by sending an HTTP GET request to a configurable URL. The URL needs to return 2XX status message to indicate that if the provided value "is valid", typically meaning that the value for this property is known by that service. | |
| External validations configure Song to check a value in the analysis against an external service, by sending an HTTP GET request to a configurable URL. The service should respond with a 2XX status message to indicate the value "is valid". |
There was a problem hiding this comment.
Including all these changes in my next commit, some of them conflict with a change I made so I'll commit the suggestions but not through the GH UI.
| } | ||
| ``` | ||
|
|
||
| Song would attempt to validate the donorId by sending a URL to `http://example.com/ABC123/donor/id01`. |
There was a problem hiding this comment.
| Song would attempt to validate the donorId by sending a URL to `http://example.com/ABC123/donor/id01`. | |
| Song would attempt to validate the donorId by sending a validation request to `http://example.com/ABC123/donor/id01`. |
|
|
||
| Song would attempt to validate the donorId by sending a URL to `http://example.com/ABC123/donor/id01`. | ||
|
|
||
| It is allowable to use either the `{study}` or `{value}` multiple times in the URL, each instance will be replaced by the corresponding value. |
There was a problem hiding this comment.
| It is allowable to use either the `{study}` or `{value}` multiple times in the URL, each instance will be replaced by the corresponding value. | |
| The URL parsing allows using either the `{study}` or `{value}` placeholders multiple times (e.g. `http://example.com/{study}-{value}/{value}`), each instance will be interpolated accordingly. |
| It is allowable to use either the `{study}` or `{value}` multiple times in the URL, each instance will be replaced by the corresponding value. | ||
|
|
||
| > [!Warning] | ||
| > The URL may cause errors in song if it contains any tokens matching the `{word}` format other than `{study}` and `{value}` No newline at end of file |
There was a problem hiding this comment.
Changing this here for consistency with the rest of your additions... and now I realize I've been noticing we spell SONG/Song/song in different places (beyond this repo).
Is it worth making a pass in a different PR to unify those here? if so, which spelling should we use? in Overture docs, we've been using all caps. TBD
| > The URL may cause errors in song if it contains any tokens matching the `{word}` format other than `{study}` and `{value}` | |
| > The URL may cause errors in Song if it contains any tokens matching the `{word}` format other than `{study}` and `{value}` |
| } | ||
|
|
||
| private boolean isIdSearchMode() { | ||
| return nonNull(fileId) || nonNull(sampleId) || nonNull(specimenId) || nonNull(donorId); |
| import lombok.EqualsAndHashCode; | ||
| import lombok.NoArgsConstructor; | ||
| import lombok.ToString; | ||
| import lombok.*; |
There was a problem hiding this comment.
How's Maven's tree shaking these days? I recall this `.* pattern could add some pounds to the code back when
There was a problem hiding this comment.
I'm not sure on this but I know the common practice for code formatters is that after a minimum number of imports from a package the formatter will switch to the .* form. So I would assume there is not a meaningful package size change associated with this. Important to know that this affects docker image size, less impactful than a web page bundle size increase.
There was a problem hiding this comment.
This makes me soooooo happy! 👏
| .setSubmitterSpecimenId(randomGenerator.generateRandomUUID().toString()); | ||
| x.getDonor().setSubmitterDonorId(randomGenerator.generateRandomUUID().toString()); | ||
| }); | ||
| ; |
There was a problem hiding this comment.
typo?
| ; |
|
I changed the optional property name from |
|
|
||
| ## Options | ||
|
|
||
| The `options` property is not required, if provided extra validations for this analysis can be specified. Similarly, each property in `options` is also optional. If no value is provided for an option, a default configuration will be used for the analysis. If this is an update to an existing analysis type, you can omit any option and its value will be maintained from the previous version. |
There was a problem hiding this comment.
| The `options` property is not required, if provided extra validations for this analysis can be specified. Similarly, each property in `options` is also optional. If no value is provided for an option, a default configuration will be used for the analysis. If this is an update to an existing analysis type, you can omit any option and its value will be maintained from the previous version. | |
| The `options` property is not required. If provided, extra validations for this analysis can be specified. Similarly, each property in `options` is also optional. If no value is provided for an option, a default configuration will be used for the analysis. If this is an update to an existing analysis type, you can omit any option and its value will be maintained from the previous version. |
|
|
||
| If you want to remove the previous value of an option so that this validation is no longer required, for instance removing the restriction on file types so that any file type could be provided, you should provide an empty list for that option. | ||
|
|
||
| In the example below, both `fileTypes` and `externalValidations` properties are set to empty arrays, which means that these validations will not be applied to submitted analysis: |
There was a problem hiding this comment.
love it. very helpful description 👍
Issue Reference
Summary
Important
Breaking change! This pull requests changes the core data model. With this change, analyses are no longer required to link to a specific donor, or reference specific samples. This data can be optionally added to a Custom Schema if that is relevant to that type of analysis.
This change removes all references to donors, specimens, and samples from the base schema. Analyses now have very little required information, primarily the Study and list of Files. Since Analyses no longer require donor or sample information, the relation between donors, specimens, and samples is no longer built and validated during analysis submission. See the linked issue for details on the motivation for this change.
Changes
Bug Fixes
The following fixes are included in this work but not captured in the above tickets
get_analysisis updated to no longer join with the donor/specimen/sample tables and fixes this type issuefileTypesare set to empty lists by default, and can be cleared by providing an empty list.