trace: safely snapshot tracked paths below ignored directories

Aperta
#3,700 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
git, go
Ambito
backend, security

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
Go
Stelle
582
Fork
61
Merge medio
12h 47m
PR unite (30g)
137

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di chainloop-dev/chainloop

Tutte le issue di chainloop-dev/chainloop

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.