juspay / juspay/invokr

Refactor template::resolve() params into TemplateContext struct

Open
#25 0 comments 0 reactions 0 assignees View on GitHub
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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.