openPublicStore: tighten bare-repo guard with git rev-parse --is-bare-repository
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 76/100
- Tipo de issue
- Refactorización
- Claridad
- Bien especificado
- Estado de actividad
- Tranquilo
- Stack tecnológico
- git, typescript
- Área
- backend
Línea de trabajo
Empieza en apps/api/src/store/public.ts, en openPublicStore, y revisa la comprobación actual de .git alrededor de las líneas 80-87. Comprueba el resultado síncrono de git rev-parse --is-bare-repository para rutas de repositorio bare, non-bare y no válidas; se considera terminado cuando los repositorios non-bare o las comprobaciones fallidas generan el error de remediación con la estructura existente, mientras que los repositorios bare válidos continúan.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Background
PR #86's openPublicStore (apps/api/src/store/public.ts:80-87) guards against non-bare clones via:
```ts
if (existsSync(join(repoPath, '.git'))) {
throw new Error(`CFP_DATA_REPO_PATH=${repoPath} looks like a non-bare clone ...`);
}
```
This catches the common misconfiguration (someone ran `git clone` instead of `git clone --bare`) but isn't the authoritative check. A directory created with `git init` (non-bare, no `.git` subdir because the path IS the working tree's gitdir... wait, no — `git init` creates `.git/`) — actually, the more interesting failure mode is something like a partially-initialized directory, or a future case where someone manually constructs a layout the existsSync check misses.
The authoritative check is git's own:
```bash
git -C "$repoPath" rev-parse --is-bare-repository
Prints 'true' for a bare repo, 'false' otherwise; exits non-zero if not a repo at all.
```
Proposed change
Replace the existsSync check in `openPublicStore` with a synchronous spawn of `git rev-parse --is-bare-repository` against `repoPath`, asserting the output is `true`. On `false` or non-zero exit, throw the same shaped error with the same remediation message.
Cost: one subprocess at boot (already paying many). Benefit: the guard catches every non-bare shape, not just the one we thought of.
Why backlog
The current guard catches the realistic misconfiguration today. This is hardening, not a fix. Trivially-sized PR (~10 lines), open to picking up anytime.
Filed as follow-up from PR #86.
- Lenguaje dominante
- TypeScript
- Estrellas
- 1
- Forks
- 1
- Merge medio
- 1 d 20 h
- PR fusionados (30 d)
- 25
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de CodeForPhilly/codeforphilly-ng
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
-
MarkdownEditor toolbar: use Radix Toolbar from radix-ui instead of the hand-rolled roving tabindex Abiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
Todos los issues de CodeForPhilly/codeforphilly-ng
Issues similares
-
Browser Waiting for: Product Owner
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
getsentry/sentry-javascript#24577 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
agilepathway/label-checker#640 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
copse-dev/agent-pane#2953 ·
-
[aw] Upgrade available Abiertoagentic-workflows
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
githubnext/rig#534 ·
-
automation missing-model model-sync provider:pioneer
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
anomalyco/models.dev#7701 ·