Skip to content

Guard workflow_settings.yaml and dataform.json require with existence check#2178

Merged
apilaskowski merged 1 commit into
mainfrom
guard_optional_config_require
May 26, 2026
Merged

Guard workflow_settings.yaml and dataform.json require with existence check#2178
apilaskowski merged 1 commit into
mainfrom
guard_optional_config_require

Conversation

@rafal-hawrylak

@rafal-hawrylak rafal-hawrylak commented May 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Replace try/catch + console.error("YAML require failed:", e) around require("./workflow_settings.yaml") with an fs.existsSync guard. Same treatment for dataform.json.
  • Eliminates the VMError: Cannot find module './workflow_settings.yaml' stack trace that Bump vm2 from 3.10.2 to 3.11.3 #2168 introduced on stderr when the file is legitimately absent (vm2 3.9.19 silently returned undefined for missing files; 3.11.3 throws).
  • The core's existing maybeRequire fallback path remains unchanged — readWorkflowSettings() still works when neither global is injected.

@rafal-hawrylak rafal-hawrylak requested a review from a team as a code owner May 26, 2026 14:09
@rafal-hawrylak rafal-hawrylak requested review from Tuseeq1 and apilaskowski and removed request for a team May 26, 2026 14:09
@apilaskowski apilaskowski merged commit 8506ed5 into main May 26, 2026
10 checks passed
@apilaskowski apilaskowski deleted the guard_optional_config_require branch May 26, 2026 14:19
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.

2 participants