Skip to content

fix: sub_issue_id に integer database ID を使うようサンプルを修正 - #47

Merged
hirokisakabe merged 2 commits into
mainfrom
worktree-fix-sub-issue-id-sample
Jun 14, 2026
Merged

fix: sub_issue_id に integer database ID を使うようサンプルを修正#47
hirokisakabe merged 2 commits into
mainfrom
worktree-fix-sub-issue-id-sample

Conversation

@hirokisakabe

Copy link
Copy Markdown
Owner

概要

issue-create / issue-refine の sub-issue 紐づけサンプルで、gh issue view --json id --jq '.id' を使って取得した値を gh api .../sub_issues -f sub_issue_id=... に渡していたが、これは GraphQL の node IDI_kwDO... のような文字列)であり、REST API が要求する integer の database ID ではないため、実行時に失敗していた。

背景

GitHub REST の POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issuessub_issue_idinteger と定義している。一方 gh issue view --json id は GraphQL 経由で node ID を返すため、両者は別物。

実例(issue #37 で確認):

  • gh issue view 37 --json id --jq '.id'I_kwDOSWy_FM8AAAABD3k9nQ (node ID, 文字列)
  • gh api repos/.../issues/37 --jq '.id'4554571165 (database ID, integer)

変更内容

  • skills/issue-create/SKILL.md (v1.0.2 → v1.0.3)
  • skills/issue-refine/SKILL.md (v1.0.0 → v1.0.1)

それぞれ以下のように修正:

  • CHILD_ID の取得を gh api "repos/${REPO}/issues/${N}" --jq '.id' に変更(integer database ID を取得)
  • gh api ... sub_issues-f-F に変更(-f は string、-F は integer / boolean などを型推論付きで送る)
  • 同じミスを再発させないためのコメントを追記

検証

cross-review (codex backend) を通過。critical / warning / info すべて 0 件。

🤖 Generated with Claude Code

hirokisakabe and others added 2 commits June 14, 2026 20:45
`gh issue view --json id` は GraphQL の node ID (例: `I_kwDO...`) を返すため、
integer の database ID を要求する REST `POST .../sub_issues` の `sub_issue_id`
には使えない。`gh api repos/.../issues/<N>` の `.id` (integer) に置き換え、
送信側も `-F` で integer 型として送るよう修正。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
CI rule: all skills changed in a single PR must share the same version
number. Bump issue-refine 1.0.1 → 1.0.3 to match issue-create.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hirokisakabe
hirokisakabe merged commit 7d0b509 into main Jun 14, 2026
1 check passed
@hirokisakabe
hirokisakabe deleted the worktree-fix-sub-issue-id-sample branch June 14, 2026 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant