Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン 初心者向け
#61 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
82/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
github, typescript

調査の方向性

src/domain.operations/repo/castToDeclaredGithubRepo.ts の47-48行目にある homepage と description の cast から始めます。setRepo も調べ、同じ正規化がそこで必要かどうかを判断します。報告された plan、apply、re-plan のシナリオで修正を検証し、null 値が永続的な UPDATE のドリフトなしに収束することを確認します。

索引モデルが issue の本文から書いたものです。

説明

🦫🎙️ 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
主要言語
TypeScript
スター
0
フォーク
0
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ehmpathy/declastruct-github のほかの issue

ehmpathy/declastruct-github の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。