CLI: connectivity check prints diagnostics to stdout, breaking piped output
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 85/100
Línea de trabajo
Comienza con check_connectivity() y su llamador @test_connection en collectoss/application/cli/__init__.py; ejecuta el comando de reproducción de Python del issue para observar los diagnósticos de stdout y el traceback. Verifica que las comprobaciones correctas mantengan stdout limpio, que las comprobaciones fallidas informen de los diagnósticos por stderr o mediante logging y que los mensajes de error utilicen la excepción capturada; añade o actualiza pruebas de CLI enfocadas si la estructura de pruebas existente del proyecto lo permite.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description:
check_connectivity() in collectoss/application/cli/__init__.py (used by @test_connection) reports failures with print(), so they go to stdout. It prints for every failed URL even when a later URL succeeds and the command runs normally, and for network/protocol errors it also prints a full traceback. This puts stray lines at the top of a working command's stdout and breaks piping, e.g. JSON output. The "no way to get connection to the database" error also goes to stdout.
Also, the network/protocol error messages print the exception class ({httpx.NetworkError}) instead of the caught exception ({e}).
Question for maintainers: is CLI output a stable API surface, and should diagnostics go to stderr? Found while working on #547 .
How to reproduce:
Run, with the first URL unreachable and the second reachable: uv run python -c “from collectoss.application.cli import check_connectivity as c; c([‘http://10.255.255.1','http://github.com’])” 2>/dev/null
stdout gets Connectivity test Request 0 Network Error: <class 'httpx.NetworkError'> plus a traceback, even though the function returns True. In normal use this happens when any of chaoss.community, github.com or gitlab.com is slow or unreachable.
Expected behavior:
Diagnostics go to stderr (or logging), and only when the check actually fails, so collectoss <command> > out.json gives valid output. Error messages include the caught exception.
Screenshots
N/A
Log files
Full output (~55 lines):
Software versions:
- CollectOSS: 4027f1212
- OS: macOS 12.6.7 (21G651)
- Browser: N/A
- Lenguaje dominante
- Python
- Estrellas
- 17
- Forks
- 27
- Merge medio
- 3 d 10 h
- PR fusionados (30 d)
- 10
Preparar el entorno
- Incluye un Dockerfile o un 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 chaoss/CollectOSS
-
Ensure privacy policy fields are filled out by CollectOSS maintainers for the default forgesAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
chaoss/CollectOSS#521 ·
Los mantenedores suelen responder en 1 día
-
mask keys by default when checking API key expiryPosiblemente ocupada @iGufrankhan la tomó hace 112 días. Abiertochallenging first issue CLI
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
chaoss/CollectOSS#414 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
challenging first issue CLI
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
chaoss/CollectOSS#413 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Output current time alongside API key reset timePosiblemente ocupada @Dipro-cyber la tomó hace 118 días. AbiertoCLI good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
chaoss/CollectOSS#412 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
devops
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
chaoss/CollectOSS#406 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de chaoss/CollectOSS
Issues similares
-
Validate non-divisible effective batch sizes in the Unsloth LoRA backendPosiblemente ocupada @debesh-biswas la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
`rx.Model` event arguments emit `PydanticDeprecatedSince20` once per payload keyPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
reflex-dev/reflex#7634 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
documentation
Dificultad 1/5 1-3 horas Aptitud para principiantes 82/100
topoteretes/cognee#6239 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
ranaroussi/yfinance#3009 ·
Los mantenedores suelen responder en 1 día
-
Test discovery aborts on GPU builds without cuStateVec: check_cuStateVec expects a failed result but set_config() now raises RuntimeErrorPosiblemente ocupada @dmeliksetian la tomó hoy. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Qiskit/qiskit-aer#2495 ·
Los mantenedores suelen responder en 1 día