Skip to content

Add support for string interpolation in runScript file names #2547

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Dambakk
Copy link

@Dambakk Dambakk commented Jun 19, 2025

Proposed changes

Will enable runScript commands to have js string interpolation in their file names. Example:

appId: com.example.app
env:
    SCRIPT_FILE: 125_myScript.js
---
- runScript: 125_myScript.js
- runScript:
      file: ${SCRIPT_FILE}
- runScript: ${ (120 + 5) + '_myScript.js' }
- evalScript: ${ output.somePath = "125_myScript.js" }
- runScript: ${ output.somePath }

This change moves some file handling from the orchestra module to the orchestra-models module (including the corresponding InvalidFlowFile exception), to be able to read the script files after the jsEngine has done its magic and applied any string interpolation. This, however, means that any "file not found" issues are now not reported until runtime instead of when the maestro command is ran. After quick discussion with Dan Caseley, we figured this would be an acceptable tradeoff.

Testing

I've added a test to the integration test suite, and built the Maestro CLI locally and tested on some sample flow.

Issues fixed

This change does not fully fix a single issue, but is a partial fix or the beginning on a fix to the following issues:

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.

1 participant