Repository navigation
feat(pkl): persist packages for offline evaluation - #1199
Conversation
|
No actionable comments were generated in the recent review. π βΉοΈ Recent review infoβοΈ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: β Files ignored due to path filters (1)
π Files selected for processing (1)
π§ Files skipped from review as they are similar to previous changes (1)
π WalkthroughWalkthroughThe change adds ChangesPKL cache and offline configuration
Estimated code review effort: 2 (Simple) | ~10 minutes Mergeability Score: βͺ Minimal Β· up to This PR adds persistent and optional offline package caching for Pkl evaluation; no actionable merge-blocking risk remains based on the supplied evidence. Poem
π₯ Pre-merge checks | β 5β Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThe PR adds a persistent package cache and offline evaluation mode to the built-in pklr backend.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains, and the previously reported platform-dependent cache-path documentation issue has been fixed. Important Files Changed
Reviews (4): Last reviewed commit: "docs: clarify pkl cache directory defaul..." | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 2
π€ Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/environment_variables.md`:
- Line 207: Update the HK_PKL_CACHE_DIR default documentation to describe the
platform-specific directory returned by dirs::cache_dir(), including the Linux
example ~/.cache/pklr, and retain the fallback path only as a fallback rather
than the unconditional default.
In `@src/config.rs`:
- Around line 748-749: Update the EvalOptions construction around
package_cache_dir and offline to match the locked pklr 1.3.0 API: either add a
reproducible dependency patch that provides these fields or remove/defer this
wiring until a compatible pklr release is available. Ensure the project compiles
with --locked without referencing unsupported EvalOptions fields.
πͺ Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
βΉοΈ Review info
βοΈ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: acb392b2-5714-405d-a59c-f6f2ffd28ac2
π Files selected for processing (3)
docs/environment_variables.mdsrc/config.rssrc/env.rs
a7a399e to
1d45f87
Compare
1d45f87 to
1df62cc
Compare
Instruction countsThe comparison never ran β an earlier step failed.
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
### π Features - **(builtins)** support pinact v3 and v4 by [@risu729](https://github.com/risu729) in [#1195](#1195) - **(pkl)** persist packages for offline evaluation by [@jdx](https://github.com/jdx) in [#1199](#1199) ### π Bug Fixes - **(builtins)** preserve file argument boundaries by [@jdx](https://github.com/jdx) in [#1194](#1194) - **(config)** allow steps to include binary files by [@jdx](https://github.com/jdx) in [#1190](#1190) - **(hook)** preserve worktree root for scoped steps by [@jdx](https://github.com/jdx) in [#1200](#1200) - **(pre-push)** peel annotated tags before diffing by [@jdx](https://github.com/jdx) in [#1197](#1197) - **(step)** preserve condition compatibility with expr v2 by [@jdx](https://github.com/jdx) in [#1212](#1212) ### π Other Changes - **(pkl)** upgrade formatter to 0.32.1 by [@jdx](https://github.com/jdx) in [#1203](#1203) - Add `HK_OUTPUT_FILE` env var to control the output file location by [@signadou](https://github.com/signadou) in [#1204](#1204) ### π¦οΈ Dependency Updates - update anthropics/claude-code-action action to v1.0.185 by [@renovate[bot]](https://github.com/renovate[bot]) in [#1191](#1191) - update dependency vitest to v4 by [@renovate[bot]](https://github.com/renovate[bot]) in [#1186](#1186) - update dependency vite to v8 by [@renovate[bot]](https://github.com/renovate[bot]) in [#1185](#1185) - lock file maintenance by [@renovate[bot]](https://github.com/renovate[bot]) in [#1202](#1202) - update anthropics/claude-code-action action to v1.0.190 by [@renovate[bot]](https://github.com/renovate[bot]) in [#1205](#1205) - update dependency @testing-library/jest-dom to v7.0.1 by [@renovate[bot]](https://github.com/renovate[bot]) in [#1206](#1206) - update rust crate shell-quote to 0.8 by [@renovate[bot]](https://github.com/renovate[bot]) in [#1207](#1207) - update jdx/renovate-config digest to 75abd12 by [@renovate[bot]](https://github.com/renovate[bot]) in [#1208](#1208) - update anthropics/claude-code-action action to v1.0.191 by [@renovate[bot]](https://github.com/renovate[bot]) in [#1209](#1209) ### New Contributors - @signadou made their first contribution in [#1204](#1204) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Mechanical version and documentation bump with no application source changes in the diff; typical low-risk release packaging. > > **Overview** > **Release v1.56.0** β bumps the crate and CLI metadata from `1.55.0` to `1.56.0` and adds the **1.56.0** section to `CHANGELOG.md`. > > Every published `hk@β¦` / `v1.55.0` Pkl package URI in docs, examples, and sample `hk.pkl` files is retargeted to **v1.56.0**. Generated usage docs (`hk.usage.kdl`, `docs/cli/commands.json`, `docs/cli/index.md`) pick up the new version string; `Cargo.lock` reflects the workspace version only. > > The changelog documents what ships in this tag: **pinact v3/v4**, offline Pkl package persistence, hook/pre-push/step/config/builtins fixes, Pkl formatter 0.32.1, **`HK_OUTPUT_FILE`**, and assorted dependency updates β those behaviors are not introduced in this diff, only recorded and versioned here. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 3b70bac. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: mise-en-dev <123107610+mise-en-dev@users.noreply.github.com>
This MR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [hk](https://github.com/jdx/hk) | tools | minor | `1.55.0` β `1.56.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.56.0`](https://github.com/jdx/hk/blob/HEAD/CHANGELOG.md#1560---2026-08-19) [Compare Source](jdx/hk@v1.55.0...v1.56.0) ##### π Features - **(builtins)** support pinact v3 and v4 by [@​risu729](https://github.com/risu729) in [#​1195](jdx/hk#1195) - **(pkl)** persist packages for offline evaluation by [@​jdx](https://github.com/jdx) in [#​1199](jdx/hk#1199) ##### π Bug Fixes - **(builtins)** preserve file argument boundaries by [@​jdx](https://github.com/jdx) in [#​1194](jdx/hk#1194) - **(config)** allow steps to include binary files by [@​jdx](https://github.com/jdx) in [#​1190](jdx/hk#1190) - **(hook)** preserve worktree root for scoped steps by [@​jdx](https://github.com/jdx) in [#​1200](jdx/hk#1200) - **(pre-push)** peel annotated tags before diffing by [@​jdx](https://github.com/jdx) in [#​1197](jdx/hk#1197) - **(step)** preserve condition compatibility with expr v2 by [@​jdx](https://github.com/jdx) in [#​1212](jdx/hk#1212) ##### π Other Changes - **(pkl)** upgrade formatter to 0.32.1 by [@​jdx](https://github.com/jdx) in [#​1203](jdx/hk#1203) - Add `HK_OUTPUT_FILE` env var to control the output file location by [@​signadou](https://github.com/signadou) in [#​1204](jdx/hk#1204) ##### π¦οΈ Dependency Updates - update anthropics/claude-code-action action to v1.0.185 by [@​renovate\[bot\]](https://github.com/renovate\[bot]) in [#​1191](jdx/hk#1191) - update dependency vitest to v4 by [@​renovate\[bot\]](https://github.com/renovate\[bot]) in [#​1186](jdx/hk#1186) - update dependency vite to v8 by [@​renovate\[bot\]](https://github.com/renovate\[bot]) in [#​1185](jdx/hk#1185) - lock file maintenance by [@​renovate\[bot\]](https://github.com/renovate\[bot]) in [#​1202](jdx/hk#1202) - update anthropics/claude-code-action action to v1.0.190 by [@​renovate\[bot\]](https://github.com/renovate\[bot]) in [#​1205](jdx/hk#1205) - update dependency [@​testing-library/jest-dom](https://github.com/testing-library/jest-dom) to v7.0.1 by [@​renovate\[bot\]](https://github.com/renovate\[bot]) in [#​1206](jdx/hk#1206) - update rust crate shell-quote to 0.8 by [@​renovate\[bot\]](https://github.com/renovate\[bot]) in [#​1207](jdx/hk#1207) - update jdx/renovate-config digest to [`75abd12`](jdx/hk@75abd12) by [@​renovate\[bot\]](https://github.com/renovate\[bot]) in [#​1208](jdx/hk#1208) - update anthropics/claude-code-action action to v1.0.191 by [@​renovate\[bot\]](https://github.com/renovate\[bot]) in [#​1209](jdx/hk#1209) ##### New Contributors - [@​signadou](https://github.com/signadou) made their first contribution in [#​1204](jdx/hk#1204) </details> --- ### Configuration π **Schedule**: (UTC) - 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 [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yODguMCIsInVwZGF0ZWRJblZlciI6IjQzLjI4OC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiLCJhdXRvbWF0aW9uOmJvdC1hdXRob3JlZCIsImRlcGVuZGVuY3ktdHlwZTo6bWlub3IiXX0=-->
Summary
~/.cache/pklrby defaultHK_PKL_CACHE_DIRto override the persistent package cache locationHK_PKL_OFFLINE=1for deterministic network-free Pkl evaluationMotivation
hk caches its fully evaluated configuration, so unchanged hooks normally avoid package downloads. A config edit, hk upgrade, cache cleanup, or ephemeral hk cache still forces pklr to fetch the pinned package again. That can block local commits during a GitHub outage.
With the persistent pklr cache, a package downloaded during any prior evaluation remains available even after hk's resolved-config cache is invalidated. Offline mode fails immediately with the missing package URL and cache location instead of attempting the network.
This addresses discussion #1198.
Dependency status
pklr1.4.0 was published by jdx/pklr#154, andCargo.locknow resolves to that release. The manifest remains at the lowest compatible requirement,pklr = "1".Validation
mise run pkl:gencargo check --lockedcargo test --locked(254 passed)git diff --checkAI-assisted β Tool: Codex; model: unavailable/unavailable; version: unavailable.
Summary by CodeRabbit
New Features
HK_PKL_CACHE_DIRto configure the built-in package cache directory, defaulting to the platformβs standard cache location.HK_PKL_OFFLINEto disable network access while continuing to use cached packages.Documentation
Note
Low Risk
Scoped to pklr evaluation and env-driven cache/offline behavior; no auth or hook execution changes.
Overview
Built-in pklr now keeps downloaded Pkl packages on disk (default under the platform cache as
pklr) and wires that throughEvaluatorBuilderinstead of the previous one-shotEvalOptionseval API.HK_PKL_CACHE_DIRoverrides the cache path;HK_PKL_OFFLINEblocks network fetches while still using cached packages, with clear errors when a package is missing.pklris resolved to 1.4.0 inCargo.lockfor the new cache/offline support. Docs add both variables and note they are read from the environment beforehk.pklis evaluated (not configurable insidehk.pkl).Reviewed by Cursor Bugbot for commit 449c2bf. Bugbot is set up for automated code reviews on this repo. Configure here.