Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

🎙️ task - fix(repo): coerce empty-string homepage/description to null (perpetual UPDATE drift)

Aperta Adatta ai principianti
#61 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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

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

  1. declare a DeclaredGithubRepo with homepage: null (repo has no homepage set on github)
  2. declastruct plan -> shows homepage empty-string vs null UPDATE
  3. declastruct apply -> no-op (github stores empty string again)
  4. 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 homepage as 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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ehmpathy/declastruct-github

Tutte le issue di ehmpathy/declastruct-github

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.