darnit audit silently resolves upstream and never prints the audited repo
维护者通常 3 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 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 内容生成。
描述
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
- Clone a fork so the checkout has both
origin(your fork) andupstreamremotes. - Run
darnit audit <path>with authenticatedgh. - Inspect which
owner/repothe livegh apichecks 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_auditcallsdetect_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 小时
- 30 天内合并 PR
- 75
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
darnitdevorg/darnit 的其他 Issue
-
ci needs triage
难度 2/5 1-3 小时 新手友好度 62/100
darnitdevorg/darnit#607 ·
维护者通常 3 天内回复
-
good first issue maintenance
难度 2/5 1-3 小时 新手友好度 83/100
darnitdevorg/darnit#587 · 2 条评论 ·
维护者通常 3 天内回复
-
Container image has no zizmor, so OSPS-AC-04.02 always reports missing_tool可能已有人在做 @mlieberman85 于 20 天前认领。 未关闭infrastructure module-baseline
难度 2/5 1-3 小时 新手友好度 65/100
darnitdevorg/darnit#585 · 1 条评论 ·
维护者通常 3 天内回复
-
documentation module-core
难度 2/5 1-3 小时 新手友好度 68/100
darnitdevorg/darnit#196 ·
维护者通常 3 天内回复
-
module-core
难度 2/5 1-3 小时 新手友好度 78/100
darnitdevorg/darnit#195 ·
维护者通常 3 天内回复
查看 darnitdevorg/darnit 的全部 Issue
相似的 Issue
-
binding:python bug
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
The Browser tab fails with a Wayland error when Open Terminal runs from a Wayland desktop session未关闭
难度 2/5 1-3 小时 新手友好度 78/100
open-webui/open-terminal#210 ·
-
triage/confirmed
难度 2/5 1-3 小时 新手友好度 78/100
agentscope-ai/agentscope#3807 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
NousResearch/hermes-agent#150542 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 91/100
triton-inference-server/server#9069 ·
维护者通常 1 天内回复