Skip to content

Workspace mode skips symlinked child repos — breaks monorepo-composite layout #1054

Closed

Description

@fruxxxl

Problem

Workspace mode (multi-repo review, shipped in #527 / v0.20.0) does not discover child repositories that are symlinked into the workspace root. With a monorepo-composite layout this makes it impossible to review changes across several related repos in one session without duplicating checkouts.

Layout

A common setup — a top-level repo that only wires things together, with independent service repos placed under an ignored projects/ directory:

my-composite/               (git repo, wires services together)
└── projects/                (gitignored)
    ├── backend-a/           (independent git repo)
    ├── backend-b/           (independent git repo)
    ├── backend-c/           (independent git repo)
    ├── frontend-a/          (independent git repo)
    ├── frontend-b/          (independent git repo)
    └── frontend-c/          (independent git repo)

projects/ is in .gitignore, so running plannotator review from the composite root only sees the (empty) top-level diff. The goal is to review changes that span several service repos in one go, with the guided review understanding how they relate.

What I tried

  1. Symlink wrapper. Create a non-git parent and symlink the service repos in:

    mkdir -p ~/projects/workspace-root
    for svc in backend-a backend-b backend-c frontend-a frontend-b frontend-c; do
      ln -s ~/projects/my-composite/projects/$svc ~/projects/workspace-root/$svc
    done
    cd ~/projects/workspace-root
    plannotator review
    # -> "Not in a VCS repo and no nested Git/JJ repositories were found."

    Symlinks are silently ignored.

  2. Running plannotator review from inside my-composite/projects/ — plannotator walks up to the composite git root instead of treating projects/ as the workspace root.

Root cause

In collectWorkspaceRepos (workspace discovery, review-workspace-node.ts), entries are filtered with withFileTypes: true and only entry.isDirectory() is accepted:

function collectWorkspaceRepos(root, current, results) {
  let entries;
  try {
    entries = readdirSync(current, { withFileTypes: true });
  } catch {
    return;
  }
  if (current !== root && hasVcsMarker(current)) {
    results.push(current);
    return;
  }
  for (const entry of entries) {
    if (!entry.isDirectory())   //  ← symlinked repos are filtered out here
      continue;
    if (SKIP_DIRS.has(entry.name))
      continue;
    collectWorkspaceRepos(root, resolve(current, entry.name), results);
  }
}

With withFileTypes: true, Dirent.isDirectory() returns false for a symlink, so every symlinked child repo is dropped before recursion. There is no flag to follow symlinks.

Suggested fix

Accept symlinks that resolve to directories during workspace discovery. Minimal change:

if (!(entry.isDirectory() || entry.isSymbolicLink()))
  continue;

with symlink-loop protection (track visited realpaths) to avoid cycles. Alternatively, an opt-in flag (--follow-symlinks) if there are concerns about traversal cost or loops.

Why this matters

The "composite repo + independent service repos under an ignored projects/" layout is common for compose-driven monorepos. A cross-cutting task routinely touches several service repos at once, and being able to review (and guided-review) them together — seeing the links between the API and client changes — is the main value of workspace mode. Right now the only workaround is git clone --local of every service into a fresh tree, which detaches the review from the actual working copy and defeats the purpose for uncommitted/in-progress work.

Related

Tested on: plannotator installed via ~/.local/bin/plannotator, macOS (darwin arm64).

Activity

  1. changed the title [-]Workspace mode skips symlinked child repos — breaks "composed repo" layout[/-] [+]Workspace mode skips symlinked child repos — breaks monorepo-composite layout[/+] on Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions