Skip to content
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

Create a new automation step for executing JS #15366

Merged
merged 63 commits into from
Mar 6, 2025
Merged

Conversation

samwho
Copy link
Collaborator

@samwho samwho commented Jan 14, 2025

Description

In the process of upgrading the development experience of writing JavaScript in automations, we want to port improvements we've made in the JS experience in the designer: live evaluation, access to helpers, access to snippets, showing test values in the bindings drawer.

Unfortunately one problem with all this is that the way JavaScript gets executed on the backend for the existing JavaScript step in automations differs quite a lot to JavaScript elsewhere in Budibase. For example, there is no $("foo") syntax in automations to access the execution context, you would just say foo.

To bring automation JS in line with the rest of the app, we're introducing a new JavaScript execution step and deprecating the old one. Existing old ones will continue to work, but you will not be able to create new instances of the old JavaScript step.

Code written for the old JS step, e.g.:

return trigger.row.name;

Will no longer work in the new one, it will need to be translated to:

return $("trigger.row.name");

Launchcontrol

Add a small description in layman's terms of what this PR achieves. This will be used in the release notes.

Copy link

qa-wolf bot commented Jan 14, 2025

QA Wolf here! As you write new code it's important that your test coverage is keeping up.
Click here to request test coverage for this PR!

@samwho samwho requested a review from deanhannigan January 14, 2025 15:07
@github-actions github-actions bot added firestorm Data/Infra/Revenue Team size/m labels Jan 14, 2025
samwho and others added 24 commits January 14, 2025 16:14
Copy link
Contributor

@deanhannigan deanhannigan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Nicely done! I've been running this locally and it's handling both ExecuteScript and ExecuteScriptV2 steps as expected. 🎉

@deanhannigan deanhannigan added the do not merge PR is not ready to be merged - generally the PR description should say why label Feb 26, 2025
@deanhannigan
Copy link
Contributor

deanhannigan commented Feb 26, 2025

Hold off on merging for the moment. There seems to be an issue now on the child branch around live evaluation.
False alarm 👍

@deanhannigan deanhannigan removed the do not merge PR is not ready to be merged - generally the PR description should say why label Feb 26, 2025
@mike12345567 mike12345567 enabled auto-merge March 6, 2025 14:40
@mike12345567 mike12345567 merged commit b6169cd into master Mar 6, 2025
22 checks passed
@mike12345567 mike12345567 deleted the execute-script-v2 branch March 6, 2025 14:50
@github-actions github-actions bot locked and limited conversation to collaborators Mar 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
firestorm Data/Infra/Revenue Team size/m
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants