Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Add `--related-to` flags to `gh issue create` / `gh issue edit` for the "Relates to" relationship

未关闭
#14,467 2 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
30/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
github, go
领域
api, cli

调研方向

This is currently blocked on GitHub API support for the “Relates to” relationship; start by checking the REST and GraphQL capabilities described in the issue. Once the API exposes it, compare the existing --blocked-by/--blocking behavior for gh issue create, gh issue edit, and gh issue view --json, then verify related links appear in the TTY view and JSON output.

由索引模型根据 Issue 内容生成。

描述

blocked enhancement gh-issue
Describe the feature or problem you’d like to solve

As of v2.101.0, gh covers almost every relationship in the issue sidebar: --parent / --add-sub-issue / --remove-sub-issue for sub-issues, --blocked-by / --blocking and --add-blocked-by / --remove-blocked-by / --add-blocking / --remove-blocking for dependencies, plus parent, blockedBy, blocking in gh issue view --json. That came from #10298, #11757 and the design in #13120.

The one relationship left out is "Relates to" — the non-blocking link in the same Relationships panel. There is no flag on gh issue create or gh issue edit, and no field in gh issue view --json, so the only way to record it is to open the issue in a browser and click through the UI.

That is a real gap for scripted and agentic workflows (see #12522): a script can now open an issue and wire up every blocking dependency and every sub-issue in the same command, but if two issues are merely related — a decision issue and the issue that implements it, a bug and the follow-up that hardens it — it has to stop and ask a human to finish the job by hand. In practice the link often just gets written as a mention in the body instead, where it does not show up in the sidebar and is not filterable.

Proposed solution

Mirror the flags that already exist for dependencies:

  • gh issue create --related-to <numbers or URLs>
  • gh issue edit --add-related-to <numbers or URLs> and --remove-related-to <numbers or URLs>
  • relatedTo as a gh issue view --json field, and the relationship shown in the TTY view next to blockedBy / blocking

Naming and cross-repo URL handling would follow whatever --blocked-by / --blocking already do, so there is nothing new to learn.

Additional context

This is very likely blocked on the API, and I'm filing it so it's tracked rather than because it can be picked up today. Probing the public API today (2026-09-17), "Relates to" looks UI-only:

  • REST: the issue dependencies endpoints expose only blocked_by and blocking; GET /repos/{owner}/{repo}/issues/{n}/related and .../relationships both 404.
  • GraphQL: the Issue type has blockedBy, blocking, parent, subIssues and subIssuesSummary, but no related-issues field; the only relationship mutations in the schema are addSubIssue, removeSubIssue and reprioritizeSubIssue.

So this probably has to wait for GitHub to expose the relationship — the feature has been in public preview since August 2026. If that's the case, this issue can serve as the place to track it so it isn't forgotten once the API lands, since the CLI side is already shaped by the work done for #11757.

主要语言
Go
星标
46.3k
派生
9.1k
平均合并
1 天 7 小时
30 天内合并 PR
76

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

cli/cli 的其他 Issue

查看 cli/cli 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。