Code review: recurse into submodules (or aggregate per-submodule diffs)

Abierto
#3,533 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
git, typescript

Línea de trabajo

Read packages/shared/review-core.test.ts for the existing gitlink behavior and packages/server/inbox-pulls.ts for the review diff options. Then trace the directory-target review path mentioned in the issue to assess the minimal action proposal. Done could mean adding that action, or designing and implementing recursive or aggregate submodule diffs; agree on scope first and test with initialized and uninitialized submodules, including dirty work.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

What happens today

On a superproject with submodules, code review shows only the gitlink pointer:

diff --git a/deps/module b/deps/module
-Subproject commit 1111111111111111111111111111111111111111
+Subproject commit 2222222222222222222222222222222222222222-dirty

Keeping gitlinks as normal text hunks is the right call (they're annotatable, and packages/shared/review-core.test.ts covers it), but the content inside the submodule is invisible. There is no --recurse-submodules anywhere in the review path, and packages/server/inbox-pulls.ts explicitly passes --no-recurse-submodules. The -dirty suffix tells you the submodule has uncommitted work, but not what it is.

Concrete case I hit: a superproject with more than a dozen submodules. Running git submodule foreach shows a handful of modified source files inside one submodule, while the review page shows exactly one changed line for it.

Why it matters

"Superproject + one repo per submodule" is a common enterprise monorepo layout. A review surface that can't reach the submodule content forces reviewers to open N reviews one at a time (in remote/fixed-port mode only one review can be open at a time), and the parent review can't answer the question reviewers actually ask: what did this change do?

Proposal — any subset of these would help
  1. Minimal, reuses what exists: a "Review this submodule" action on a gitlink row. When a diff contains a Subproject commit change (especially -dirty), offer a button that opens that submodule's own review through the existing directory-target path — /plannotator-review <submodule-path> already works today. Keeps one decision per repo, no new diff plumbing.

  2. --recurse-submodules in the review diff, with the file tree grouped per submodule, each group resolving its own base/default branch. Annotations would need to be scoped by repository, not just by path, or the same relative path in two submodules collides.

  3. Aggregate mode: for each changed submodule, run its own diff and merge the results into one review with prefixed paths (deps/module/src/...), one decision for the whole change set. This is what actually scales to a superproject with many submodules.

Constraints worth designing around
  • --recurse-submodules only covers committed submodule commits. The common case — uncommitted work inside a submodule (-dirty) — needs that submodule's own git diff, so option 2 alone doesn't solve it.
  • Submodules can be uninitialized (no work tree), shallow, or on a detached HEAD; .gitmodules URLs may be unreachable.
  • Staging/unstaging across repositories changes what a "file action" means in the tree.
  • Remote/fixed-port mode allows one open review at a time, which is what makes per-submodule reviews awkward and an aggregate view valuable.

I'm happy to test a branch against a many-submodule superproject (git 2.x, macOS + Linux) if you want to try one of these.

Lenguaje dominante
TypeScript
Estrellas
8.7k
Forks
649
Merge medio
16 h 1 min
PR fusionados (30 d)
756

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de backnotprop/plannotator

Todos los issues de backnotprop/plannotator

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.