Repository navigation
Conversation
This was referenced Oct 2, 2026
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…lls any more 30257df (Android device queries match the whole text and id) took out the last caller of this helper in the uiautomator2 driver. The unused linter has flagged it since, so Lint has failed on every push to main, and Build, which needs Lint, has been skipped each time. The same helper in the appium and devicelab drivers is untouched.
Maestro runs a runScript file as plain JavaScript. It reads the file and
evaluates ${...} only in the step's env, when: condition and label; the
script text goes to the engine as it is (YamlFluentCommand.kt:409-424,
Commands.kt:1029-1035, Orchestra.kt:723-737).
The runner expanded ${...} and $VAR across the whole file before running
it. A template literal that used the script's own variables was replaced
ahead of the script, against variables that did not exist yet:
`/v1/x?email=${encodeURIComponent(who)}&state=${state}` came out as
`/v1/x?email=undefined&state=`.
A script file now runs as written. Inline script text, which Maestro has no
equivalent of, keeps the expansion.
7 of 13 tasks
bulatgaleev
force-pushed
the
upstream-pr/b2-runscript-file-as-written
branch
from
October 2, 2026 04:07
875e9c0 to
a289cc7
Compare
Contributor
|
Thanks @bulatgaleev, good catch. Expanding |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Maestro runs a
runScriptfile as plain JavaScript. It reads the file and evaluates${...}only in the step'senv,when:condition andlabel; the script text goes to the engine as it is (YamlFluentCommand.kt,RunScriptCommand.evaluateScriptsin Commands.kt,runScriptCommandin Orchestra.kt, all at cli-2.10.0). maestro-runner expanded${...}and$VARacross the whole file before running it, so a template literal that used the script's own variables was replaced ahead of the script, against variables that did not exist yet:`/v1/x?email=${encodeURIComponent(who)}&state=${state}`came out as/v1/x?email=undefined&state=. A script file now runs as written. Inline script text, which Maestro has no equivalent of, keeps the expansion.Type of Change
Changes Made
ExecuteRunScriptruns a.jsfile without expanding it first.RunScriptstill expands, so inline script text is unchanged.TestScriptEngine_ExecuteRunScript_FileTemplateLiteralinpkg/executor/scripting_test.go. Without the change it fails withurl = "/v1/x?email=undefined&state=".Related Issues
No existing issue found.
Testing
go test ./pkg/executor/go test -raceforpkg/executor,pkg/driver/wda,pkg/jsengine,pkg/flowandpkg/driver/uiautomator2passes at the top of the stack;go vet ./...,gofmt -land golangci-lint v2.13.2 (the version CI pins) report nothing on every branch of the stackmake testas a whole: not run, because its device tests drive whatever device is attached to the machinemake lint: the Makefile has nolinttarget, and the other lintersmake checkruns (staticcheck, revive, errcheck, nilaway, gosec) are not installed hereChecklist
Additional Notes
A script file that counted on the early expansion no longer gets it:
var name = "${NAME}"in a.jsfile now holds the text${NAME}, as it does under Maestro. The variable is there asNAME.Stack 2 of 7: #200 → #194 → #195 → #196 → #197 → #198 → #199. Merge in that order. This branch is built on #200, so it also contains their commits. This PR's own change is the top commit,
a289cc7. Once the PRs below it merge, the rest of the diff disappears, and nothing conflicts. All seven sit onmainatd3f738f(the merge of #185). #200 only removes a function that makes Lint fail onmain(see its description); it is in this stack so that Lint passes here too.