Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

A `tracked` env query is validated against the unfiltered parent environment (broad queries are CI-hostile)

オープン
#505 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
github-actions, rust

調査の方向性

リンクされた再現手順を pnpm install./repro.sh で実行し、その後 getEnvs({ prefix: "" }, { tracked })@voidzero-dev/vite-task-clientvp build のエントリポイントを通して追跡します。無関係な環境変数が変化した場合の tracked と untracked の動作を比較します。tracked-query の意図した動作が確立され、再現手順が説明されている CI に不向きなミスを報告しなくなれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Summary

A tracked env query is validated against the full unfiltered parent process environment. A broad query (empty prefix, matching every variable) therefore cache-misses whenever any ambient variable changes, even one the build never reads. In CI, per-run variables (e.g. ACTIONS_ORCHESTRATION_ID) change every run, so such a build never cache-hits.

Reproduction

https://github.com/why-reproductions-are-required/vite-task-tracked-env-query-unfiltered-parent-env

pnpm install
./repro.sh

Two tasks call getEnvs({ prefix: "" }, { tracked }) via @voidzero-dev/vite-task-client and read no variable in particular. Run 3 sets one unrelated ambient variable before running.

task tracked run 3 (one unrelated ambient var set)
untracked-bulk-env false HIT (control)
tracked-bulk-env true MISS: TrackedEnvQueryChanged { Prefix "", Added ... }

Where this bites a real build

vp build loads env via Vite's loader, which issues getEnvs({ prefix }, { tracked: true }) for each configured envPrefix (@voidzero-dev/vite-plus-core, chunks/node.js). In a Vite + void app one of those queries is empty-prefix (Prefix "", all variables), so on GitHub Actions vp run build misses every run:

$ vp build ○ cache miss: env 'ACTIONS_ORCHESTRATION_ID' changed, executing

Note env: [] on the task does not help (that controls value-fingerprinting, not the bulk query). The only workaround found is to run the build under a sanitized environment, e.g. env -i PATH="$PATH" HOME="$HOME" vp run build.

Question for maintainers

Is validating a tracked query against the unfiltered parent env intended? A broad tracked query is unavoidably CI-hostile this way. Options might include validating against the filtered env the task received, an ignore-list for ambient/volatile variables, or scoping/untracking broad reads on the consumer side (Vite env loader / void). Filing here to confirm where the fix belongs.

Environment

  • vite-plus 0.2.2, @voidzero-dev/vite-task-client 0.2.0
  • Reproduced on macOS (darwin 25.x) and GitHub Actions ubuntu-latest

Found alongside #504 while enabling the GitHub Actions cache for a real Vite + void app.

主要言語
Rust
スター
466
フォーク
42
平均マージ
1日 20時間
マージ済み PR(30日)
21

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

voidzero-dev/vite-task のほかの issue

voidzero-dev/vite-task の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。