Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix configs to allow the use of configs as keys of other configs (#2206)
* Fix configs to allow the use of configs as keys of other configs This allows things like this: ``` def git_info(args): info = { "commit": ["git", "rev-parse", "HEAD"], "branch": ["git", "rev-parse", "--abbrev-ref", "HEAD"], "message": ["git", "log", "-1", "--pretty=%B"], } cfg = {} for key, cmd in info.items(): cfg[key] = check_output(cmd, text=True).strip() if cfg["branch"].startswith("feature/"): cfg["branch_type"] = "feature" elif cfg["branch"].startswith("main"): cfg["branch_type"] = "main" else: cfg["branch_type"] = "default"] print(f"cfg is {cfg}") return cfg class MyExampleCICDFlow(FlowSpec): git_config = Config("git_config", default_value={}, parser=git_info) flow_config = Config("flow_config", default="my_config.json") @timeout(seconds=flow_config[git_config.branch_type].timeout) @step def start(self): # More code ``` * Fix error message that referred to non-existing object
- Loading branch information