Redact live-streamed subprocess output in System.run()
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 72/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
Línea de trabajo
Comienza con src/model/system/system.ts para rastrear la ruta de escritura de stdout/stderr en vivo; después, lee src/model/secret-redaction.ts y el hilo de revisión sobre el comportamiento de redacción existente. Prueba un secret dividido entre dos chunks del stream y verifica que la salida transmitida se redacted mientras runResult.output permanece sin cambios; cubre también la ruta sin secrets.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Context
game-ci/cli#246 added the first secret redaction in src/. Before it, nothing anywhere redacted anything.
That PR covers the paths where secrets are formatted for logging:
- the logger's
formatArgs(so whole-object logs likecli.ts'sparsed:dump andloadConfig'scliOptionsare scrubbed) - the
docker runcommand string logged at-vv System.run's captured-output debug dump, redacted before truncation
It deliberately does not cover live-streamed subprocess output.
The gap
System.run() defaults to silent: false, so Docker.run() writes the child's stdout/stderr straight through to CI logs as it arrives. Those chunks are never redacted.
This is not a regression — that output was equally unredacted before #246 — but it is the one remaining place a registered secret can reach a log.
Why it wasn't fixed in #246
Doing it correctly is more than wrapping each chunk in SecretRedaction.redact():
- Chunk boundaries. A secret can be split across two
dataevents, so a naive per-chunk redact misses it. It needs a retained tail of at leastmaxSecretLength - 1bytes carried between chunks. - Throughput. This stream carries whole Unity build logs (multi-MB). A regex pass per registered secret per chunk is a real cost on the hot path, unlike the
-vv-gated paths #246 touched. - Fidelity.
runResult.outputshould stay unredacted so callers such asUnityBuildValidation.validateBuildkeep matching on the true text. Only what is written out should change.
Suggested approach
- A small streaming redactor holding a carry-over tail sized from the longest registered secret.
- Apply it only on the write-out path, leaving
runResult.outputuntouched. - Skip the work entirely when no secrets are registered, which is the common case and already how
SecretRedaction.redactbehaves. - Test: a secret deliberately split across two chunk boundaries.
References
- Review thread: https://github.com/game-ci/cli/pull/246#discussion_r3939465647
- Relevant code:
src/model/system/system.ts,src/model/secret-redaction.ts
- Lenguaje dominante
- TypeScript
- Estrellas
- 20
- Forks
- 11
- Merge medio
- 5 h 28 min
- PR fusionados (30 d)
- 4
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de game-ci/cli
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 73/100
-
Forward Unity logs to consoleAbiertoenhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 32/100
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
Todos los issues de game-ci/cli
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
AykutSarac/jsoncrack.com#616 ·
-
nip27: long hashtag swallows the rest of the content, lone # gives an empty hashtagPosiblemente ocupada @bardrop la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
nbd-wtf/nostr-tools#578 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
backnotprop/plannotator#3427 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
microsoft/Power-CAT-Copilot-Studio-Kit#942 ·
Los mantenedores suelen responder en 1 día
-
[BUG]: Duplicate preposition in heading and unformatted feedback text on Strengthen Argument pageAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
AOSSIE-Org/DebateAI#801 · 1 comentario ·
Los mantenedores suelen responder en 1 día