Skip to content

Issue relationships

An issue's place among the others, what it belongs to and what it waits for, is set as a GitHub relationship. It is not written into its body (#454). GitHub shows relationships in the issue's sidebar, and the coordinator reads them over REST. Nobody has to keep a "Part of #n" or "Blocked by #n" line in step with them. A reference that carries content stays in the body as a link with its reason: "the screens follow the approved mockup of #197".

The types and what each is for here

Relationship REST (/repos/{owner}/{repo}/issues/{n}/…) Used here for
Parent / sub-issue GET, POST sub_issues (sub_issue_id); DELETE sub_issue; parent_issue_url on the issue An epic and its tasks. gh-issues plan field parent, gh-issues link. One parent per issue; it may live in another repository of the same owner.
Blocked by / blocking GET, POST dependencies/blocked_by (issue_id); DELETE dependencies/blocked_by/{issue_id}; GET dependencies/blocking (read only) "Cannot start before the other is done". "Blocked by #n" and "Depends on #n" in old bodies meant the same and both become this. gh-issues plan field blocked_by; coordinator candidates and start skip an issue with an open blocker.
Relates to GET, POST relates_to (issue_id); DELETE relates_to/{issue_id} Not used by the skills. A plain "see also" carries no order; a body link with its reason says more.
Security alert none in the REST description Not used. It links a code scanning or Dependabot alert to the issue that tracks its fix, and is set in the issue's sidebar or from the alert.

All three write endpoints take the other issue's id, not its number and not its node_id. The id is the database id from GET /repos/{owner}/{repo}/issues/{n}, .id.

Each issue carries issue_dependencies_summary: blocked_by and blocking count the open ones, total_blocked_by and total_blocking all of them. A blocker may live in another repository of the same owner. The listing returns the full issue with its repository_url and state.

Findings

  • The endpoints above are in GitHub's published OpenAPI description (github/rest-api-description, api.github.com.json).
  • "Relates to" has a REST API (list, add, remove) and webhook events (issue_relates_to_added, …_removed), but no count in the issue's summary.
  • "Security alert" has no endpoint on the issue side in the REST description: nothing lists or sets it through issues/….
  • All reads and writes are REST, so the coordinator keeps working in a cloud session, whose proxy refuses GraphQL (#302).

Moving old bodies

gh-issues migrate-deps (skill git-flow:github-issues) turns the prose of open issues into relationships, once per repository. It writes a plan, checks it, and executes it only after the owner's yes. Closed issues keep their prose. Until an issue is migrated, coordinator candidates does not block on its prose line, but warns prose dependency, not a relationship: #n.