🎙️ task - fix(repo): coerce empty-string homepage/description to null (perpetual UPDATE drift)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 82/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Tranquilla
- Stack tecnologico
- github, typescript
- Ambito
- backend-api-design
Direzione di ricerca
Inizia in src/domain.operations/repo/castToDeclaredGithubRepo.ts, nei cast di homepage e description alle righe 47-48. Esamina anche setRepo per determinare se sia necessaria la stessa normalizzazione. Verifica la correzione con lo scenario segnalato di plan, apply e re-plan, confermando che i valori null convergano senza deriva UPDATE perpetua.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
🦫🎙️ dispatch to foreman
💧 task enqueued
├─ priority = ?
├─ yieldage = ?
└─ leverage = ?
title
fix(repo): coerce empty-string homepage/description to null (perpetual UPDATE drift)
description
.what
castToDeclaredGithubRepo casts an empty-string homepage (and description) from the GitHub API to an empty string, but the natural desired value is null. The two never converge, so every declastruct plan on a DeclaredGithubRepo shows a homepage empty-string to null UPDATE, and every apply is a no-op that re-stores the empty string. The resource is never idempotent.
.where
src/domain.operations/repo/castToDeclaredGithubRepo.ts (main / 1.7.0)
description: input.description ?? null, // line 47
homepage: input.homepage ?? null, // line 48
.root-cause
GitHub's REST API returns homepage and description as an empty string for repos with no homepage/description set — NOT null. the ?? null coalesce only fires on null/undefined, so an empty string stays an empty string.
- remote casts to
homepage= empty string - a natural wish declares
homepage: null(there is no homepage) - empty string is not equal to null, so declastruct decides UPDATE, forever
.repro
- declare a
DeclaredGithubRepowithhomepage: null(repo has no homepage set on github) declastruct plan-> showshomepageempty-string vs null UPDATEdeclastruct apply-> no-op (github stores empty string again)- re-plan -> same UPDATE. never converges.
observed on ahbode/infrastructure provision/github.repo at declastruct-github 1.6.0; confirmed unchanged on main (1.7.0).
.fix
coerce empty string to null in the cast, so remote matches a null wish:
description: input.description || null, // empty string -> null
homepage: input.homepage || null, // empty string -> null
(|| null is safe here — both fields are free-text where empty string and "unset" are equivalent; there is no meaningful empty-string value to preserve.)
alternatively, if you prefer to keep ?? semantics elsewhere, an explicit input.homepage?.trim() || null also handles whitespace-only values.
.also-consider
whichever coercion you choose, apply it symmetrically on the SET side (setRepo) if it sends homepage/description, so a null wish is written consistently and a round-trip get -> cast -> set is stable.
.impact
- breaks idempotency guarantee for
DeclaredGithubRepo(always dirty) - noise in every plan; erodes trust in the KEEP vs UPDATE signal
- forces consumers to declare
homepageas an empty string (matching the buggy cast) as a workaround, which is backwards
- Lingua principale
- TypeScript
- Stelle
- 0
- Fork
- 0
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ehmpathy/declastruct-github
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 38/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 42/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 45/100
Tutte le issue di ehmpathy/declastruct-github
Issue simili
-
effort:S priority:P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
cameri/nostream#811 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
dam-agents/dam#4562 ·
I maintainer di solito rispondono entro 1 giorno
-
bug p3 triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
bug javascript P2-medium python release:v3.1
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
adrirubio/claude-deck#546 ·
I maintainer di solito rispondono entro 1 giorno