Files
IdeA/agents-dev/L8-git.md
Blomios 307ae71857 feat: add main features
Agents for developpement added + frontend add + backend added. Git viewer created + agent and template creator + layout and project creator
2026-06-06 01:27:01 +02:00

3.1 KiB

L8 — Git

Binôme : dev-git / test-git Zones : infrastructure/git, application/git, frontend/features/git Dépendances amont : L0, L1, L2.

Objectif

Support Git intégré (local) via libgit2.

Périmètre (DEV)

  • Adapter Git2Repository (git2) : status, stage/unstage, commit, branches, checkout, current_branch, diff, log, pull, push, clone, init.
  • Use cases Git (GitStatus, GitCommit, GitCheckout, GitPush, …).
  • Front : panneau Git (changements, staging, commit, branches).

Périmètre (TEST)

  • Use cases avec GitRepository mocké.
  • Intégration : Git2Repository sur repo temporaire (init → commit → branch → status).
  • Front : feature git avec gateway mock.

Definition of Done

  • cargo test (git) + vitest verts ; opérations git de base utilisables (dev manuel).

Spike

  • Vendoring statique git2/openssl pour l'AppImage (coordonné avec L11).

Avancement

Backend (vert)

  • Dépendance : git2 0.20 (default-features = false, pas d'openssl) liée à la libgit2 système via .cargo/config.toml (LIBGIT2_SYS_USE_PKG_CONFIG=1) — évite cmake/vendoring ; le vendoring statique AppImage reste pour L11.
  • Infra : Git2Repository (infrastructure/git/mod.rs) implémente GitPortinit, status, stage, unstage, commit (signature de repli IdeA <idea@localhost> si pas de config user), branches, current_branch, checkout, log. pull/push renvoient une erreur explicite (réseau/credentials → L9). Appels libgit2 synchrones sans await ⇒ futures Send. 3 tests d'intégration (vrai repo temporaire).
  • Application (application/git/) : GitStatus, GitStage, GitUnstage, GitCommit (valide message non vide + event GitStateChanged), GitBranches (liste + courante), GitCheckout (+ event), GitLog, GitInit (+ event). 7 tests use cases (mock GitPort).
  • cargo test --workspace : 298 verts, 0 régression ; clippy clean.

IPC app-tauri (vert)

  • Composition root : Git2Repository construit, 8 use cases injectés. 8 commands (git_status, git_stage, git_unstage, git_commit, git_branches, git_checkout, git_log, git_init), résolution projectId → root via resolve_project. DTOs GitFileStatusDto/GitCommitDto/GitBranchesDto + request DTOs camelCase. Tests tests/dto_git.rs (12). cargo test -p app-tauri 74 verts ; workspace 310 verts, 0 régression ; clippy clean.

Front (vert)

  • Port GitGateway complet (8 méthodes) + types GitFileStatus/GitCommit/GitBranches ; adapter TauriGitGateway ; MockGitGateway stateful (état par projet, seedé) pour le mode offline.
  • Feature features/git : useGit(projectId) + GitPanel (sections Staged/Unstaged + stage/unstage, message + commit, branches + checkout, log récent), monté dans l'onglet projet. 17 tests ; suite front 157 verts ; tsc clean ; garde-fou « no invoke » OK.

Hors périmètre L8

  • pull/push/clone (réseau + credentials) → L9 (RemoteGitRepository + callbacks) ; vendoring statique git2 pour l'AppImage → L11.