darnit audit silently resolves upstream and never prints the audited repo

オープン 初心者向け
#344 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
cli, github, python

調査の方向性

まず packages/darnit/src/darnit/core/utils.py、特に detect_repo_from_git と detect_owner_repo を確認し、次に cmd_audit と現在の監査ログを探してください。リポジトリの解決時に検出されたリモートソースを保持し、解決された owner/repo とソースを監査出力に含めてください。関連する監査CLIテストを実行してください。ユーザーがどのリポジトリとリモートが監査されたのか確認できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Python
スター
22
フォーク
27
平均マージ
4日 20時間
マージ済み PR(30日)
75

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

darnitdevorg/darnit のほかの issue

darnitdevorg/darnit の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。