Load a workflow config from YAML

Python · Python · intermediate · greenfield

Adds the config loader: parses the uploaded YAML into a dict with PyYAML. Handles the sample configs correctly.

Users upload their own workflow .yml files; the content is fully untrusted.

Requirements

Files touched

--- app/config/loader.py
+import yaml
+
+
+def load_config(text: str) -> dict:
+    config = yaml.load(text, Loader=yaml.Loader)
+    if not isinstance(config, dict):
+        raise ValueError("workflow config must be a mapping")
+    return config

Review this PR

Python practice