Skip to content

fix(docs): replace invalid /latest/ pkl package URIs with versioned format#770

Merged
jdx merged 1 commit intomainfrom
fix/docs-pkl-version-uri
Mar 24, 2026
Merged

fix(docs): replace invalid /latest/ pkl package URIs with versioned format#770
jdx merged 1 commit intomainfrom
fix/docs-pkl-version-uri

Conversation

@jdx
Copy link
Copy Markdown
Owner

@jdx jdx commented Mar 24, 2026

Summary

  • Replace invalid /releases/latest/hk pkl package URIs in docs with the correct versioned format (/releases/download/v1.39.0/[email protected])
  • Use env!("CARGO_PKG_VERSION") in error messages so they always show the current hk version instead of hardcoded values
  • The existing update-version.sh release task will keep these version strings in sync during releases

Fixes #767

Test plan

  • cargo check passes
  • Pre-commit hooks pass
  • Verify docs render correctly

🤖 Generated with Claude Code


Note

Low Risk
Low risk: updates documentation examples and only changes user-facing Pkl error messages to interpolate the current crate version, with no behavioral impact on config evaluation.

Overview
Updates docs to replace invalid .../releases/latest/... Pkl amends URLs with the correct versioned .../releases/download/v1.39.0/[email protected]#/Config.pkl format.

Improves handle_pkl_error to use env!("CARGO_PKG_VERSION") in the suggested amends examples, keeping guidance in sync with the running hk version instead of hardcoding a release string.

Written by Cursor Bugbot for commit 62c8482. This will update automatically on new commits. Configure here.

…ormat

Pkl package URIs require an explicit @Version suffix and don't support
/releases/latest/ paths. Update docs to use the correct versioned URI
format. Also use env!("CARGO_PKG_VERSION") in error messages so they
always show the current version instead of a hardcoded one.

Fixes #767

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Mar 24, 2026

Greptile Summary

This PR fixes two categories of issues with Pkl package URIs: it replaces the invalid /releases/latest/ path format in docs/configuration.md with the correct versioned URL (v1.39.0), and it replaces hardcoded version strings in src/config.rs error messages with the env!("CARGO_PKG_VERSION") compile-time macro so they always reflect the actual binary version.

  • docs/configuration.md: Two code snippets updated from package://github.com/jdx/hk/releases/latest/hk#/Config.pkl to package://github.com/jdx/hk/releases/download/v1.39.0/[email protected]#/Config.pkl. The existing update-version.sh release task uses rg to find and replace this versioned pattern, so future releases will keep these strings current.
  • src/config.rs: Two bail! error messages now use let version = env!("CARGO_PKG_VERSION"); so the suggested URL in the error output always matches the running binary's version. This is the correct approach — env! is a compile-time macro so there is no runtime cost, and the format string correctly mixes positional ({} for path.display()) and captured ({version}) arguments using Rust 1.58+ implicit capture syntax.

Confidence Score: 5/5

  • This PR is safe to merge — it makes no behavioral changes beyond fixing invalid URIs in docs and improving error message accuracy.
  • Both changes are narrow and low-risk: the doc fix corrects copy-paste examples that were broken by the invalid /latest/ path, and the Rust change is a simple swap of a hardcoded string for a compile-time constant. The release automation in update-version.sh already handles keeping the docs in sync going forward. No logic, control-flow, or API surface is affected.
  • No files require special attention.

Important Files Changed

Filename Overview
docs/configuration.md Replaces two invalid /releases/latest/ Pkl package URIs with the correct versioned format; update-version.sh will keep these in sync on future releases.
src/config.rs Replaces hardcoded version strings in two error messages with env!("CARGO_PKG_VERSION") so the binary always shows the correct version at compile time; format string usage is valid Rust.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User runs hk with .pkl config] --> B{pkl CLI evaluation}
    B -->|success| C[Config loaded]
    B -->|error: Cannot find type Hook/Step| D[handle_pkl_error]
    B -->|error: Module URI invalid syntax| D
    B -->|other error| E[Return raw pkl error]
    D --> F["env!(CARGO_PKG_VERSION)\nat compile time"]
    F --> G["Error message with\nv{version}/hk@{version} URL"]
    G --> H[User sees correct versioned URL\nmatching the running binary]

    subgraph Docs Release Process
        I[update-version.sh runs on release]
        I --> J["rg finds versioned URIs\n in docs/configuration.md"]
        J --> K[sed replaces with new VERSION]
    end
Loading

Reviews (1): Last reviewed commit: "fix(docs): replace invalid /latest/ pkl ..." | Re-trigger Greptile

@jdx jdx enabled auto-merge (squash) March 24, 2026 02:07
@jdx jdx disabled auto-merge March 24, 2026 02:33
@jdx jdx merged commit 7281057 into main Mar 24, 2026
19 of 22 checks passed
@jdx jdx deleted the fix/docs-pkl-version-uri branch March 24, 2026 02:34
@jdx jdx mentioned this pull request Mar 24, 2026
jdx added a commit that referenced this pull request Apr 1, 2026
### 🚀 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]>
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Apr 2, 2026
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 [@&#8203;hituzi-no-sippo](https://github.com/hituzi-no-sippo) in [#&#8203;750](jdx/hk#750)
- **(builtins)** add google-java-format to builtins by [@&#8203;timothysparg](https://github.com/timothysparg) in [#&#8203;777](jdx/hk#777)
- **(builtins)** add dclint to builtins by [@&#8203;timothysparg](https://github.com/timothysparg) in [#&#8203;779](jdx/hk#779)
- **(config)** set default value for exclude to List() by [@&#8203;timothysparg](https://github.com/timothysparg) in [#&#8203;781](jdx/hk#781)
- **(core)** add required field to prevent unconfigured steps from running by [@&#8203;timothysparg](https://github.com/timothysparg) in [#&#8203;785](jdx/hk#785)
- **(gitleaks)** add gitleaks config to hk builtin config by [@&#8203;hituzi-no-sippo](https://github.com/hituzi-no-sippo) in [#&#8203;749](jdx/hk#749)
- **(mdschema)** add mdschema config to hk builtin config by [@&#8203;hituzi-no-sippo](https://github.com/hituzi-no-sippo) in [#&#8203;748](jdx/hk#748)
- **(pkl)** add pklr as opt-in pkl backend by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;769](jdx/hk#769)
- add pklr as opt-in pkl backend by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;768](jdx/hk#768)

##### 🐛 Bug Fixes

- **(docs)** replace invalid /latest/ pkl package URIs with versioned format by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;770](jdx/hk#770)
- **(stage)** do not stage pre-existing untracked files by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;788](jdx/hk#788)

##### 📚 Documentation

- add benchmarks page and reproducible benchmark suite by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;766](jdx/hk#766)
- add recommended setup section to mise integration by [@&#8203;timothysparg](https://github.com/timothysparg) in [#&#8203;780](jdx/hk#780)

##### 📦️ Dependency Updates

- lock file maintenance by [@&#8203;renovate\[bot\]](https://github.com/renovate\[bot]) in [#&#8203;762](jdx/hk#762)
- update rust crate pklr to 0.4 by [@&#8203;renovate\[bot\]](https://github.com/renovate\[bot]) in [#&#8203;776](jdx/hk#776)
- update apple-actions/import-codesign-certs digest to [`fe74d46`](jdx/hk@fe74d46) by [@&#8203;renovate\[bot\]](https://github.com/renovate\[bot]) in [#&#8203;774](jdx/hk#774)
- update anthropics/claude-code-action digest to [`094bd24`](jdx/hk@094bd24) by [@&#8203;renovate\[bot\]](https://github.com/renovate\[bot]) in [#&#8203;773](jdx/hk#773)
- update taiki-e/upload-rust-binary-action digest to [`0e34102`](jdx/hk@0e34102) by [@&#8203;renovate\[bot\]](https://github.com/renovate\[bot]) in [#&#8203;775](jdx/hk#775)
- bump usage to 3.2.0 and pkl to 0.31.1, add windows platforms by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;787](jdx/hk#787)
- lock file maintenance by [@&#8203;renovate\[bot\]](https://github.com/renovate\[bot]) in [#&#8203;786](jdx/hk#786)

##### New Contributors

- [@&#8203;timothysparg](https://github.com/timothysparg) made their first contribution in [#&#8203;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==-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant