Refactor template::resolve() params into TemplateContext struct
- Dominant language
- Rust
- Stars
- 2
- Forks
- 0
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 10
Description
## Context
PR #23 added the `execution.*` template namespace, bringing `resolve()` to 5 parameters. This will continue to grow as new namespaces are added.
## Suggestion
Group the parameters into a struct:
```rust
pub struct TemplateContext<'a> {
pub input: &'a HashMap,
pub config: &'a HashMap,
pub secrets: &'a HashMap,
pub execution: &'a HashMap,
}
```
Then `resolve()` becomes:
```rust
pub fn resolve(
value: &Value,
ctx: &TemplateContext,
) -> Result
```
## Scope
- Update `resolve()`, `resolve_string()`, `resolve_variable()` signatures
- Update all call sites in `pipeline.rs`
- Update all tests in `template.rs`
- Consider adding a builder or helper for `TemplateContext` construction
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.