darnit audit silently resolves upstream and never prints the audited repo

Abierto Apto para principiantes
#344 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 3 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
76/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
cli, github, python

Línea de trabajo

Empieza por packages/darnit/src/darnit/core/utils.py, especialmente por detect_repo_from_git y detect_owner_repo; después, busca cmd_audit y su registro de auditoría actual. Conserva la fuente remota detectada al resolver el repositorio e incluye el owner/repo resuelto y la fuente en la salida de auditoría. Ejecuta las pruebas pertinentes de la CLI de auditoría; el trabajo está terminado cuando los usuarios puedan ver qué repositorio y qué remoto se auditaron.

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

Descripción

module-baseline

Description

darnit audit <path> auto-detects owner/repo preferring the upstream remote, and never prints which owner/repo it resolved. On a fork checkout (both origin and upstream present), the live checks target upstream — potentially a different repo than the one the user is working in — with no indication in the output.

Steps to Reproduce

  1. Clone a fork so the checkout has both origin (your fork) and upstream remotes.
  2. Run darnit audit <path> with authenticated gh.
  3. Inspect which owner/repo the live gh api checks target.

Expected Behavior

The audit output states the resolved owner/repo and which remote it came from, so it's obvious which repository was audited.

Actual Behavior

The checks target upstream silently; the CLI logs only Auditing {path} with {N} controls. Details:

  • packages/darnit/src/darnit/core/utils.py:186, :302 — prefer_upstream: bool = True.
  • utils.py:231 — remotes = ["upstream", "origin"] if prefer_upstream else ["origin", "upstream"].
  • cmd_audit calls detect_owner_repo(str(repo_path)) with no override and prints no repo identity.

The information already exists internally: detect_repo_from_git returns a source field (utils.py:263, 275), but the detect_owner_repo wrapper (:299) collapses it to (owner, repo) and the CLI discards it.

Environment

  • darnit version: main @ 86f9cfa
  • Python version: 3.12 (uv-managed)
  • OS: any

Additional Context

Suggested fix (visibility only): print the resolved owner/repo + source remote at the top of audit output. A new --owner/--repo flag is likely unnecessary — the origin-preference path (prefer_upstream=False) already resolves origin correctly.

Lenguaje dominante
Python
Estrellas
22
Forks
27
Merge medio
4 d 20 h
PR fusionados (30 d)
75

Preparar el entorno

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 darnitdevorg/darnit

Todos los issues de darnitdevorg/darnit

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.