Skip to content

fix(hooks): use versioned bunx to avoid cache issues#67

Merged
amondnet merged 2 commits into
mainfrom
hooks/code-runner-versioning
Dec 23, 2025
Merged

fix(hooks): use versioned bunx to avoid cache issues#67
amondnet merged 2 commits into
mainfrom
hooks/code-runner-versioning

Conversation

@amondnet

Copy link
Copy Markdown
Contributor

Summary

  • Add code-runner.ts wrapper that reads version from release-please manifest
  • Run bunx with exact @pleaseai/code version to prevent stale cache issues
  • Fixes hooks to use versioned package references for reproducible builds

Test plan

  • code-runner.ts imports process from 'process' module (ESLint compliant)
  • Reads version from .release-please-manifest.json
  • Spawns bunx with correct version argument
  • Pre-commit hooks pass successfully

Add code-runner.ts wrapper that reads version from release-please manifest
and runs bunx with exact version to prevent stale cache
@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @amondnet, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request aims to enhance the reliability and reproducibility of pre-commit hooks by ensuring that the @pleaseai/code package is always executed with a precise, version-controlled instance. It achieves this by introducing an intermediary script that reads the package version from the release manifest, thereby mitigating issues caused by stale bunx caches.

Highlights

  • Versioned Bunx Execution: Introduced a new wrapper script, code-runner.ts, to execute bunx with a specific, versioned instance of the @pleaseai/code package. This ensures that the exact version defined in the .release-please-manifest.json is used.
  • Reproducible Builds: The change directly addresses and prevents stale cache issues with bunx, leading to more reproducible builds for pre-commit hooks by always using a consistent package version.
  • Hook Command Update: Modified the hooks.json configuration to invoke the new code-runner.ts script for format and lsp commands, rather than directly calling bunx @pleaseai/code.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Dec 23, 2025

Copy link
Copy Markdown

Deploying code-please with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0933e8a
Status:🚫  Build failed.

View logs

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a wrapper script, code-runner.ts, to ensure that bunx uses a specific, versioned @pleaseai/code package, preventing potential cache-related issues. The version is dynamically read from the .release-please-manifest.json file. The hooks in hooks.json are updated to use this new runner. This is a good approach for ensuring reproducible builds for the hooks. My review includes a suggestion to make the new code-runner.ts script more robust by adding validation for the package version and improved error handling for the spawn process.

Comment thread hooks/scripts/code-runner.ts
@codecov

codecov Bot commented Dec 23, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 39.35%. Comparing base (f6fb62d) to head (0933e8a).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #67   +/-   ##
=======================================
  Coverage   39.35%   39.35%           
=======================================
  Files          59       59           
  Lines        6489     6489           
=======================================
  Hits         2554     2554           
  Misses       3935     3935           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@amondnet amondnet self-assigned this Dec 23, 2025
Add version validation and spawn error handling to code-runner.ts
@amondnet
amondnet merged commit 36abb66 into main Dec 23, 2025
9 of 10 checks passed
@amondnet
amondnet deleted the hooks/code-runner-versioning branch December 23, 2025 16:58
@passionfactory-bot passionfactory-bot Bot mentioned this pull request Dec 23, 2025
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