Skip to content

Fix env var default value syntax (${VAR || "default"})#51

Open
omnarayan wants to merge 1 commit intomainfrom
fix/env-var-defaults
Open

Fix env var default value syntax (${VAR || "default"})#51
omnarayan wants to merge 1 commit intomainfrom
fix/env-var-defaults

Conversation

@omnarayan
Copy link
Copy Markdown
Contributor

Summary

  • Fix ${VAR || "default"} and ${VAR ?? "fallback"} env var patterns that Maestro supports but maestro-runner wasn't resolving
  • Undefined JS variables now auto-define as undefined on ReferenceError (retry loop), matching Maestro's GraalJS Proxy behavior
  • Flow config env: values and step-level env: values are now expanded before being set

Test plan

  • Unit tests: 8 new engine tests (||, ??, ternary, chain, mixed), 1 new scripting test for withEnvVars expansion
  • All existing tests pass
  • E2E: test flow with appId: ${APP_ID || "com.example.app"} and env: { USER_ID: ${USER_ID || "test_user_1"} }

Fixes #49, fixes #50

Resolve ${VAR || "default"} and ${VAR ?? "fallback"} patterns
matching Maestro's behavior. Previously, undefined variables caused
a JS ReferenceError that silently left the raw ${...} expression
in place.

Fixes #49, fixes #50
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.

[BUG] appId/-launchApp: appId: doesn't correctly parse default value [BUG] inputText not properly parsing env var fallback on -inputText

1 participant