GCWing / GCWing/OpenBitFun

[Bug]: git trust and review output tests can escape the test tempdir through the host environment

Fermée
#2,652 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Rust
Étoiles
2.3k
Forks
231
Merge moyen
2 h 49 min
PR mergées (30 j)
589

Description

## Summary

The plain-directory trust test ran git without pinning the search ceiling and the review output tests did not guard against ancestor-repository probes, so a host environment with an enclosing git repository (or git walking upward past the tempdir) changes which directory is adopted as the repository root.

The trust test now pins GIT_CEILING_DIRECTORIES at the tempdir parent and feeds a controlled env through the existing inspect_repository_trust_with_env entry point; the invalid lexical .git marker test asserts the marker is never adopted as a repository root and keeps the strict Err when no repository ancestor exists. (No historical red entries for these suites in our CI ledger; this is a defensive host-environment isolation for host-sensitive suites.)

## Area

src/crates/services/services-integrations/src/git/trust.rs (tests) + src/crates/services/services-integrations/src/git/utils.rs (tests). Crate: bitfun-services-integrations (requires the git feature for its test target).

## Reproduction or evidence

At 32f2427697, trust.rs has no GIT_CEILING_DIRECTORIES isolation (only the production inspect_repository_trust_with_env and its callers, :386/:389/:512/:565) and utils.rs has no host_has_repository_ancestor guarding (Grep zero hits); tests therefore pass only on hosts without an enclosing repository. Zero production diff.

## Environment

Hosts whose tempdir sits inside or above a git checkout (developer machines, some CI images); baseline 32f2427697. These suites are not in the remote CI gate (remote only runs file_watch_contracts for this crate) and the local runs are the verification face; disclosed as defensive host-environment isolation.

---
AI-assisted change. Testing: verified locally (`cargo check -p bitfun-services-integrations` exit 0; `--features git --lib trust` 19 passed; `--features git --lib review_git_output` 3 passed, 0 failed).

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par les tests dans src/crates/services/services-integrations/src/git/trust.rs et utils.rs, notamment inspect_repository_trust_with_env et les tests de sortie de review. Exécutez cargo check -p bitfun-services-integrations, puis les cibles de test git-feature trust et review_git_output. Le travail est terminé lorsque les tests indiqués réussissent et que les dépôts ancêtres ainsi que les marqueurs .git invalides ne peuvent pas affecter les résultats.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
git, rust
Domaine
testing
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
Active
Clarté
Clairement spécifiée
Accessibilité débutants
76/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.