Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Greptile SummaryThis PR introduces Key changes:
Confidence Score: 5/5Safe to merge — the primary prior concern (no_proxy not honoured) is resolved, and no new P0/P1 issues are present. The no_proxy gap from the previous review round is addressed: get_no_proxy() is called and properly wired into the Proxy object. The reqwest-based client correctly handles all four proxy env vars and loads full PEM bundles. No correctness, security, or data-integrity issues remain. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant Caller
participant Config
participant run_pklr
participant build_pklr_http_client
participant pklr
Caller->>Config: load config (hkrc / project pkl)
Config->>Config: check HK_PKL_BACKEND == "pklr"
alt pklr backend
Config->>run_pklr: run_pklr(path)
run_pklr->>build_pklr_http_client: build_pklr_http_client()
build_pklr_http_client->>build_pklr_http_client: get_http_proxy() → Proxy::all()
build_pklr_http_client->>build_pklr_http_client: get_no_proxy() → proxy.no_proxy()
build_pklr_http_client->>build_pklr_http_client: read HK_PKL_CA_CERTIFICATES PEM bundle
build_pklr_http_client-->>run_pklr: reqwest::Client
run_pklr->>run_pklr: build EvalOptions {client, http_rewrites}
run_pklr->>pklr: eval_to_json_with_options(path, options)
pklr-->>run_pklr: serde_json::Value
run_pklr-->>Config: deserialized T
else pkl CLI backend
Config->>Config: run_pkl(&["eval"], path)
end
Config-->>Caller: Config / UserConfig
Reviews (12): Last reviewed commit: "fix(pkl): remove pklr normalize workarou..." | Re-trigger Greptile |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
## Summary pklr previously skipped pkl's `output` block entirely, which meant converter functions were never applied. This caused consumers like hk to need [post-processing workarounds](jdx/hk#769) (`pklr_normalize_step_or_group`) to normalize the JSON output. This PR implements `output.renderer.converters` support: - Track which pkl class each object was instantiated from via `ObjectSource.type_name` - Parse the `output.renderer.converters` block from the AST and evaluate converter lambdas - Add `Evaluator::apply_converters()` which recursively walks the value tree and applies matching converter functions - Call `apply_converters()` in `eval_to_json_with_options()` before serializing to JSON This enables pkl files like hk's `Config.pkl` to use converters for: - Type discrimination (`_type` tags for serde tagged enums) - Value coercion (string → array, bool → string) - Custom serialization (Regex objects) Without this, hk needed ~100 lines of Rust to replicate what pkl's converters do natively. ## Test plan - [x] All 229 existing tests pass unchanged - [x] 5 new tests covering converter functionality: - `converter_injects_type_tag` — basic _type injection - `converter_coerces_values` — string→array and bool→string coercion - `converter_multiple_types` — Group + Step converters with nesting - `converter_no_converters_is_noop` — no converters = unchanged output - `converter_output_not_in_result` — output block excluded from JSON *This comment was generated by Claude Code.* --------- Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
## Summary Fixes the `missing field '_type'` error in hk's CI ([PR #769](jdx/hk#769)). PR #49 added `output.renderer.converters` support, but only extracted converters from the *current* module's body entries. When a file `amends` or `extends` a base module that defines converters (like hk's `hk.pkl` amending `Config.pkl`), those converters were never extracted. - Extract converters from the base module's AST during amends processing - Extract converters from the base module's AST during extends processing - Added `converter_inherited_from_amends_base` test with two files on disk ## Test plan - [x] New test: `converter_inherited_from_amends_base` — creates Base.pkl with converters + child.pkl that amends it, verifies converters are applied - [x] All 235 existing tests pass *This comment was generated by Claude Code.* --------- Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
When using HK_PKL_BACKEND=pklr, proxy (http_proxy/HTTP_PROXY) and CA certificate (HK_PKL_CA_CERTIFICATES) settings were silently ignored. Now builds a configured reqwest::Client with these settings and passes it to pklr via eval_to_json_with_client(). Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…e warning - Route hkrc evaluation through pklr backend when HK_PKL_BACKEND=pklr - Support no_proxy/NO_PROXY in pklr HTTP client - Remove http:// restriction on proxy URLs (reqwest supports https proxies) - Warn when HK_PKL_HTTP_REWRITE is set with pklr backend (unsupported) Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
pklr 0.2.2 added eval_to_json_with_options() with HTTP URL rewrite support. Use it instead of warning that rewrites are unsupported. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Certificate::from_pem only parses the first PEM certificate, silently dropping the rest. Use from_pem_bundle to handle CA bundles correctly. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
pklr does not yet implement pkl's output.renderer.converters, so the _type tags that Config.pkl adds to Step/Group objects are missing. This causes deserialization to fail with "missing field _type". Post-process the pklr JSON to inject _type based on object shape: objects with a nested "steps" field are groups, everything else is a step. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
pklr skips pkl's output.renderer.converters block, so several
normalizations are missing:
- _type tags for Step/Group/Regex (already partially handled)
- depends/stage: string -> array coercion
- stash: bool -> string coercion ("git"/"none")
- Regex objects: inject _type: "regex" for glob/exclude fields
Also add #[serde(default)] to Step.depends and Step.env so missing
fields default to empty rather than failing deserialization.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
pklr 0.3.0 implements output.renderer.converters natively, so the Rust-side workarounds (pklr_normalize_output, pklr_normalize_step_or_group, pklr_tag_regex) and the #[serde(default)] annotations are no longer needed. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
pklr's output.renderer.converters don't apply to objects created via
Mapping type parameters (only explicit `new ClassName { ... }`), so the
normalize workarounds are still needed. Keep pklr 0.3.0 for the other
improvements (converter infrastructure, HTTP rewrites).
This reverts the normalize removal from 4290fbf while retaining the
version bump.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
pklr 0.4.0 implements output.renderer.converters natively and propagates type info through Mapping generics and body amendments, so the Rust-side workarounds (pklr_normalize_output, pklr_normalize_step_or_group, pklr_tag_regex) and the Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
### 🚀 Features - **(betterleaks)** add betterleaks config to hk builtin config by [@hituzi-no-sippo](https://github.com/hituzi-no-sippo) in [#750](#750) - **(builtins)** add google-java-format to builtins by [@timothysparg](https://github.com/timothysparg) in [#777](#777) - **(builtins)** add dclint to builtins by [@timothysparg](https://github.com/timothysparg) in [#779](#779) - **(config)** set default value for exclude to List() by [@timothysparg](https://github.com/timothysparg) in [#781](#781) - **(core)** add required field to prevent unconfigured steps from running by [@timothysparg](https://github.com/timothysparg) in [#785](#785) - **(gitleaks)** add gitleaks config to hk builtin config by [@hituzi-no-sippo](https://github.com/hituzi-no-sippo) in [#749](#749) - **(mdschema)** add mdschema config to hk builtin config by [@hituzi-no-sippo](https://github.com/hituzi-no-sippo) in [#748](#748) - **(pkl)** add pklr as opt-in pkl backend by [@jdx](https://github.com/jdx) in [#769](#769) - add pklr as opt-in pkl backend by [@jdx](https://github.com/jdx) in [#768](#768) ### 🐛 Bug Fixes - **(docs)** replace invalid /latest/ pkl package URIs with versioned format by [@jdx](https://github.com/jdx) in [#770](#770) - **(stage)** do not stage pre-existing untracked files by [@jdx](https://github.com/jdx) in [#788](#788) ### 📚 Documentation - add benchmarks page and reproducible benchmark suite by [@jdx](https://github.com/jdx) in [#766](#766) - add recommended setup section to mise integration by [@timothysparg](https://github.com/timothysparg) in [#780](#780) ### 📦️ Dependency Updates - lock file maintenance by [@renovate[bot]](https://github.com/renovate[bot]) in [#762](#762) - update rust crate pklr to 0.4 by [@renovate[bot]](https://github.com/renovate[bot]) in [#776](#776) - update apple-actions/import-codesign-certs digest to fe74d46 by [@renovate[bot]](https://github.com/renovate[bot]) in [#774](#774) - update anthropics/claude-code-action digest to 094bd24 by [@renovate[bot]](https://github.com/renovate[bot]) in [#773](#773) - update taiki-e/upload-rust-binary-action digest to 0e34102 by [@renovate[bot]](https://github.com/renovate[bot]) in [#775](#775) - bump usage to 3.2.0 and pkl to 0.31.1, add windows platforms by [@jdx](https://github.com/jdx) in [#787](#787) - lock file maintenance by [@renovate[bot]](https://github.com/renovate[bot]) in [#786](#786) ### New Contributors - @timothysparg made their first contribution in [#781](#781) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Primarily a version/documentation bump, but it also updates the Rust dependency lockfile (e.g., `hyper` and `windows-sys`), which could introduce build/runtime regressions. > > **Overview** > Bumps hk to **v1.40.0** and publishes the corresponding release notes in `CHANGELOG.md`. > > Updates generated CLI/docs and all Pkl package URL references in docs/examples to point at `v1.40.0`, and refreshes `Cargo.lock` with dependency updates/removals consistent with the new release. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit da00ab8. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: mise-en-dev <[email protected]>
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [hk](https://github.com/jdx/hk) | minor | `1.39.0` → `1.40.0` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>jdx/hk (hk)</summary> ### [`v1.40.0`](https://github.com/jdx/hk/blob/HEAD/CHANGELOG.md#1400---2026-04-01) [Compare Source](jdx/hk@v1.39.0...v1.40.0) ##### 🚀 Features - **(betterleaks)** add betterleaks config to hk builtin config by [@​hituzi-no-sippo](https://github.com/hituzi-no-sippo) in [#​750](jdx/hk#750) - **(builtins)** add google-java-format to builtins by [@​timothysparg](https://github.com/timothysparg) in [#​777](jdx/hk#777) - **(builtins)** add dclint to builtins by [@​timothysparg](https://github.com/timothysparg) in [#​779](jdx/hk#779) - **(config)** set default value for exclude to List() by [@​timothysparg](https://github.com/timothysparg) in [#​781](jdx/hk#781) - **(core)** add required field to prevent unconfigured steps from running by [@​timothysparg](https://github.com/timothysparg) in [#​785](jdx/hk#785) - **(gitleaks)** add gitleaks config to hk builtin config by [@​hituzi-no-sippo](https://github.com/hituzi-no-sippo) in [#​749](jdx/hk#749) - **(mdschema)** add mdschema config to hk builtin config by [@​hituzi-no-sippo](https://github.com/hituzi-no-sippo) in [#​748](jdx/hk#748) - **(pkl)** add pklr as opt-in pkl backend by [@​jdx](https://github.com/jdx) in [#​769](jdx/hk#769) - add pklr as opt-in pkl backend by [@​jdx](https://github.com/jdx) in [#​768](jdx/hk#768) ##### 🐛 Bug Fixes - **(docs)** replace invalid /latest/ pkl package URIs with versioned format by [@​jdx](https://github.com/jdx) in [#​770](jdx/hk#770) - **(stage)** do not stage pre-existing untracked files by [@​jdx](https://github.com/jdx) in [#​788](jdx/hk#788) ##### 📚 Documentation - add benchmarks page and reproducible benchmark suite by [@​jdx](https://github.com/jdx) in [#​766](jdx/hk#766) - add recommended setup section to mise integration by [@​timothysparg](https://github.com/timothysparg) in [#​780](jdx/hk#780) ##### 📦️ Dependency Updates - lock file maintenance by [@​renovate\[bot\]](https://github.com/renovate\[bot]) in [#​762](jdx/hk#762) - update rust crate pklr to 0.4 by [@​renovate\[bot\]](https://github.com/renovate\[bot]) in [#​776](jdx/hk#776) - update apple-actions/import-codesign-certs digest to [`fe74d46`](jdx/hk@fe74d46) by [@​renovate\[bot\]](https://github.com/renovate\[bot]) in [#​774](jdx/hk#774) - update anthropics/claude-code-action digest to [`094bd24`](jdx/hk@094bd24) by [@​renovate\[bot\]](https://github.com/renovate\[bot]) in [#​773](jdx/hk#773) - update taiki-e/upload-rust-binary-action digest to [`0e34102`](jdx/hk@0e34102) by [@​renovate\[bot\]](https://github.com/renovate\[bot]) in [#​775](jdx/hk#775) - bump usage to 3.2.0 and pkl to 0.31.1, add windows platforms by [@​jdx](https://github.com/jdx) in [#​787](jdx/hk#787) - lock file maintenance by [@​renovate\[bot\]](https://github.com/renovate\[bot]) in [#​786](jdx/hk#786) ##### New Contributors - [@​timothysparg](https://github.com/timothysparg) made their first contribution in [#​781](jdx/hk#781) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMDIuMTAiLCJ1cGRhdGVkSW5WZXIiOiI0My4xMDIuMTAiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbIlJlbm92YXRlIEJvdCIsImF1dG9tYXRpb246Ym90LWF1dGhvcmVkIiwiZGVwZW5kZW5jeS10eXBlOjptaW5vciJdfQ==-->

Summary
HK_PKL_BACKEND=pklrto use it instead of the default pkl CLIhttp_proxy/HTTP_PROXY), CA certificate (HK_PKL_CA_CERTIFICATES), and HTTP rewrite (HK_PKL_HTTP_REWRITE) settings through to the pklr HTTP client_typetags and normalize missing converter transforms in pklr JSON output for pkl CLI parityTest plan
test/pklr_backend.batscovers pklr-specific behaviorNote
Medium Risk
Changes how
.pklconfig (including hkrc) can be evaluated by introducing an alternate Rust-based evaluator and new HTTP client wiring, which could affect config loading and network/certificate behavior. Default CLI-based evaluation remains unchanged unlessHK_PKL_BACKEND=pklris set.Overview
Adds an opt-in
pklrevaluation path for.pklconfig files (including hkrc discovery/parsing) whenHK_PKL_BACKEND=pklris set, otherwise continuing to use the externalpklCLI.When using
pklr, config evaluation now builds a dedicated HTTP client that propagates proxy / no-proxy settings, supports loading all certs fromHK_PKL_CA_CERTIFICATESPEM bundles, and passesHK_PKL_HTTP_REWRITErules intopklreval options. Also updatesCargo.lockto use an olderwindows-sysversion foros_pipe.Written by Cursor Bugbot for commit d587a79. This will update automatically on new commits. Configure here.