A `tracked` env query is validated against the unfiltered parent environment (broad queries are CI-hostile)
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- github-actions, rust
- 領域
- build-system, ci-cd
調査の方向性
リンクされた再現手順を pnpm install と ./repro.sh で実行し、その後 getEnvs({ prefix: "" }, { tracked }) を @voidzero-dev/vite-task-client と vp 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-plus0.2.2,@voidzero-dev/vite-task-client0.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
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
voidzero-dev/vite-task のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
voidzero-dev/vite-task#738 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 78/100
voidzero-dev/vite-task#719 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
voidzero-dev/vite-task#717 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
voidzero-dev/vite-task#702 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
voidzero-dev/vite-task#700 · コメント 2 件 ·
voidzero-dev/vite-task の issue をすべて見る
似ている issue
-
Browser (wasm) relay client cannot connect to relays whose URL has a trailing-dot FQDN hostname オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
n0-computer/iroh#4550 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
paritytech/zombienet-sdk#591 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
farion1231/cc-switch#7638 · コメント 1 件 ·
-
onnx-ir re-exports ModelProto and GraphProto but not NodeProto, AttributeProto and AttributeType オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100