Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#505 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
github-actions, rust
Lĩnh vực
build-system, ci-cd

Hướng nghiên cứu

Chạy reproduction được liên kết bằng pnpm install./repro.sh, sau đó lần theo getEnvs({ prefix: "" }, { tracked }) qua @voidzero-dev/vite-task-client và entry point vp build. So sánh hành vi của biến được tracked và không được tracked khi một biến môi trường không liên quan thay đổi; được xem là hoàn tất khi hành vi truy vấn tracked dự kiến đã được xác lập và reproduction không còn báo lỗi miss gây vấn đề cho CI được mô tả nữa.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Rust
Star
466
Fork
42
Merge trung bình
1 ngày 20 giờ
Pull request đã merge (30 ngày)
21

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của voidzero-dev/vite-task

Tất cả issue của voidzero-dev/vite-task

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.