trace: safely snapshot tracked paths below ignored directories

未關閉
#3,700 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
48/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
git, go
領域
backend, security

研究方向

Start by reading issue #3625 and PR #3631 to understand the existing worktree snapshot behavior, then locate the walker and its race enabled tests. Trace how it applies .gitignore and identifies tracked paths; add coverage for the listed ignored directory, intent-to-add, symlink, path confinement, and special file cases. Done means all acceptance criteria pass without scanning unrelated ignored content or opening non-regular files.

由索引模型根據 Issue 內容生成。

描述

bug chainloop component/CLI trace-provider

Context

Follow-up to #3625 and PR #3631. The PR is restoring the existing worktree snapshot behavior from main while narrowing its same-call fix, following maintainer review.

The existing walker prunes directories matched by .gitignore. A force-added tracked file below such a directory can therefore be absent from the snapshot.

Scope

  • include tracked regular files below ignored directories without scanning unrelated ignored content;
  • keep untracked ignored paths excluded;
  • define the interaction with intent-to-add entries tracked in #3698;
  • reject symlinked path components and final symlinks;
  • avoid opening FIFOs, devices, sockets, and other non-regular files;
  • keep every read confined to the checkout root.

Expected behavior

Tracked regular files receive correct before/after snapshots even below ignored directories. Expanding coverage must not allow path traversal outside the checkout or block on special files.

Acceptance criteria

  • A force-added tracked file below an ignored directory is snapshotted and compared.
  • An untracked ignored sibling is not snapshotted.
  • Intent-to-add paths follow the semantics decided in #3698.
  • Escaping and in-repository symlink ancestors are not followed.
  • FIFOs and other non-regular files are checked before open and skipped.
  • Race-enabled tests cover ignored-directory and path-safety behavior.
主要語言
Go
星號
582
分支
61
平均合併
12 小時 47 分鐘
30 天內合併 PR
137

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

chainloop-dev/chainloop 的其他 Issue

查看 chainloop-dev/chainloop 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。