Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#505 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
github-actions, rust

Línea de trabajo

Ejecuta la reproducción enlazada con pnpm install y ./repro.sh, y luego sigue getEnvs({ prefix: "" }, { tracked }) a través de @voidzero-dev/vite-task-client y del punto de entrada vp build. Compara el comportamiento de las variables rastreadas y no rastreadas cuando cambia una variable ambiental no relacionada; se considera completado cuando se ha establecido el comportamiento previsto de la consulta de variables rastreadas y la reproducción ya no informa del fallo descrito, problemático para CI.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Rust
Estrellas
466
Forks
42
Merge medio
1 d 20 h
PR fusionados (30 d)
21

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de voidzero-dev/vite-task

Todos los issues de voidzero-dev/vite-task

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.