通过启动来审查拉取请求
Review a pull request by booting it

原始链接: https://fzakaria.com/2026/09/09/review-a-pull-request-by-booting-it

`trynix-preview` 是一项全新的 GitHub Action,它允许评审者通过 [trynix.dev](https://trynix.dev) 直接在网页浏览器中启动拉取请求(pull request)的构建版本。该工具利用 Nix 存储路径,无需克隆代码、本地构建、使用 Docker 或外部服务器,仅需一个简单的链接,即可提供一个预装了 PR 二进制文件的功能性 Linux 环境。 使用时,您只需将该 action 集成到 CI 工作流程中,并确保构建产物已推送到 Nix 缓存(如 Cachix)。当有 PR 开启时,该 action 会自动发布一条包含链接的评论,点击即可在浏览器中启动环境。 尽管这项技术在测试与验证方面是一项重大创新,但目前它更适合处理中小型二进制文件,因为大型文件在启动时可能会出现性能延迟。尽管如此,`trynix-preview` 展示了基于浏览器的 Nix 执行所蕴含的巨大潜力,为提供 PR 反馈提供了一种无缝且无需基础设施的全新方式。

Hacker News | 最新 | 过往 | 评论 | 提问 | 展示 | 招聘 | 提交 | 登录 通过启动来审查 Pull Request (fzakaria.com) 3 分 | lalitmaganti 发布于 1 小时前 | 隐藏 | 过往 | 收藏 | 讨论 | 帮助 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文

tl;dr; trynix-preview is a GitHub action that comments a link on a pull request which lets you boot the PR’s build in the browser using https://trynix.dev. No servers, just browsers.

I ended my earlier trynix post with a list of ideas I think we could accomplish now that we can boot arbitrary /nix/store paths in the browser. The most obvious one was to let a reviewer boot a pull request’s build in the browser for testing, validation and feedback.

That is now real. 🤯

A demo is worth a 1000 words: here is a pull request (PR#31) against my sqlelf project, from a fork, with the comment our action left on it:

A GitHub pull request comment from github-actions[bot]. It links "Boot this build in your browser", says a Linux VM boots in the tab and fetches this pull request's build from the cache, notes which commit it was built from, and has a collapsed "Store paths" section.

Click the link and a Linux machine boots in your tab with that PR’s sqlelf on PATH.

You did not clone anything, you did not build anything. No servers, no SSH, no VPN, no Docker, no VM, no cloud. Just a browser and a link. 😈

§Gimme. Gimme. Gimme.

As with any GitHub action, it’s just a few lines to add to your workflow.

The caveat is that you must have built and cached the path already, so the action can link to it. The action does not build or cache anything.

# Setup Cachix as our Nix cache.
- uses: cachix/cachix-action@v17
  with:
    name: sqlelf
    authToken: $
# We build the pull request's code and push it to the cache, so the action can link to it.
- run: nix build .#default
- uses: fzakaria/trynix@v1
  with:
    cache: https://sqlelf.cachix.org
    publicKey: sqlelf.cachix.org-1:MLnjolA9AsKscTOJKDSA+ZAcgIK8BwZA574j4+Cs2bg=
    # You can have multiple attrs if you want to boot more than one path.
    attrs: .#default

The action publishes and builds nothing. Whatever already fills your cache keeps doing it, and the action’s whole job is to simply provide the store paths via nix eval and hand the cache’s URL and public key to the browser.

It is not Nix cache provider specific, but I do recommend Cachix because it is free for open source up to 5GiB.11You should definitely sign up for Cachix but you can test this out without it since the free tier is very generous. 

You can checkout my trynix.yaml workflow for the full example. You have to set allow-unsafe-pr-checkout: true in the actions/checkout step because the workflow runs on a fork’s pull request, and that has security implications.22I recommend a private segregated cache for pull request builds, so that a fork cannot push to your main cache. 

If that is not your cup of tea, there is a version where a maintainer types /trynix on the pull request which kicks off the workflow.

In either case, the workflow runs on the default branch and checks out the pull request’s code, so a fork cannot edit the workflow that builds it.

§Game over?

Did I just upend all CI products by easily letting reviewers boot a PR?

Unfortunately, no. 🥲

The performance for large binaries is pretty bad. Even with many of the improvements I AI-assisted into the engine, large binaries can still take 1-2 minutes to execute.33I added a benchmark page, https://trynix.dev/bench/, to the site with a lot of rich data on boot and run times for various applications. 

Nevertheless, this is still a pretty amazing workflow and showcases the power of Nix.

Maybe as we get closer to AGI, our AI overlords will be able to optimize the engine to execute large binaries in a few seconds, but for now, the action is best suited for small to medium-sized binaries.

联系我们 contact @ memedata.com