-
Notifications
You must be signed in to change notification settings - Fork 7
Transform script refactor #6159
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
Conversation
introduce AnalysisScript class to handle different scripting operations
| result.add(new File(scriptPath)); | ||
| } | ||
| } | ||
| ObjectProperty validationScripts = protocol.getObjectProperties().get(ScriptType.VALIDATION.getPropertyURI(protocol)); |
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 know we don't expose anything in the UI for defining a validation script, just transform scripts. Was this possible from a file based module? Is there code somewhere that would convert any legacy validation scripts to transform scripts or is that not needed?
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.
Not that I'm aware of, the file based module code for transform scripts is in ModuleAssayProvider.
| private AnalysisScript(File script, List<String> operations) | ||
| { | ||
| _script = new FileSystemLike.Builder(script).build().getRoot(); | ||
| for (String op : operations) |
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 assume it is not possible to have a null operations param here, but thoughts on adding in a check and default case for setting operations to insert?
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.
Good suggestion, done.
15e395a
| continue; | ||
|
|
||
| // read the contents of the script file | ||
| File scriptFile = analysisScript.getScript().toNioPathForRead().toFile(); |
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 saw a few usages of getScript().toNioPathForRead().toFile(). Thoughts on having a method like analysisScript.getScriptFile()? Likewise there are usages like getScript().toNioPathForRead().toString() that could be replaced with something like analysisScript.getScriptPath()
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 took your advice on the getScriptPath method. I decided to not expose a method that returned a File object since I wanted callers to work with the FileLike class instead.
15e395a
Rationale
This represents some initial work in preparation to support invoking transformation scripts at assay import time as well as when updating assay results.
api.assay.transformpackage.AnalysisScriptclass to allow configuration of data operations on a per script basisRelated Pull Requests
#6159
LabKey/commonAssays#828
LabKey/LabDevKitModules#225