Skip to content

Conversation

@labkey-klum
Copy link
Contributor

@labkey-klum labkey-klum commented Dec 18, 2024

Rationale

This represents some initial work in preparation to support invoking transformation scripts at assay import time as well as when updating assay results.

  • Move transform related code to the api.assay.transform package.
  • Miscellaneous clean up and consolidation
  • Introduce AnalysisScript class to allow configuration of data operations on a per script basis

Related Pull Requests

#6159
LabKey/commonAssays#828
LabKey/LabDevKitModules#225

introduce AnalysisScript class to handle different scripting operations
@labkey-klum labkey-klum requested a review from cnathe December 18, 2024 21:40
@labkey-klum labkey-klum marked this pull request as ready for review December 18, 2024 21:42
result.add(new File(scriptPath));
}
}
ObjectProperty validationScripts = protocol.getObjectProperties().get(ScriptType.VALIDATION.getPropertyURI(protocol));
Copy link
Contributor

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?

Copy link
Contributor Author

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)
Copy link
Contributor

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?

Copy link
Contributor Author

@labkey-klum labkey-klum Dec 19, 2024

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();
Copy link
Contributor

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()

Copy link
Contributor Author

@labkey-klum labkey-klum Dec 19, 2024

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

@labkey-klum labkey-klum merged commit 19aba0b into develop Dec 20, 2024
6 checks passed
@labkey-klum labkey-klum deleted the fb_transform_on_update branch December 20, 2024 23:10
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.

3 participants