GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add Issues 2.0 support: issue types, sub-issues, and relationships by BagToad · Pull Request #13057 · cli/cli

Add Issues 2.0 support: issue types, sub-issues, and relationships #13057

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
BagToad merged 45 commits into trunk from kw/issues-2.0
Jun 4, 2026

Uh oh!

There was an error while loading. Please reload this page.

Merged

Add Issues 2.0 support: issue types, sub-issues, and relationships #13057

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
c002573
feat: add Issues 2.0 API types, mutations, and feature detection
BagToad Mar 29, 2026
7dae882
feat: add Issues 2.0 fields to issue view
BagToad Mar 29, 2026
44e9f4b
feat: add --type, --parent, --blocked-by, --blocking to issue create
BagToad Mar 29, 2026
b7ee31d
feat: add Issues 2.0 flags to issue edit
BagToad Mar 29, 2026
67f63a1
feat: add --type filter flag to issue list
BagToad Mar 29, 2026
4c12393
test: add comprehensive tests for Issues 2.0 features
BagToad Mar 29, 2026
ddb2fce
refactor: extract shared helpers for issue ref resolution and type lo…
BagToad Mar 29, 2026
c00bc6a
fix: address code review findings from multi-model review
BagToad Mar 29, 2026
3f1df51
test: add missing --type flag tests for issue list
BagToad Mar 29, 2026
b6f29b0
feat: add --remove-blocking flag to issue edit
BagToad Mar 29, 2026
2a72a59
fix: address round 2 code review findings
BagToad Mar 29, 2026
4a196dd
test: add regression test for issue-only fields in FieldsToEditSurvey
BagToad Mar 29, 2026
e3b0d9d
fix: restore displaced TODO comment, add GHES edit relationship test
BagToad Mar 30, 2026
6e76f11
fix: correct GraphQL field name in AddBlockedBy/RemoveBlockedBy mutat…
BagToad Mar 30, 2026
e3ce7e5
Add json tags to SubIssues and LinkedIssueConnection
BagToad May 6, 2026
469438e
Remove redundant nil check in IssueNodeID
BagToad May 6, 2026
20105ed
Include id in linked-issue JSON exports
BagToad May 6, 2026
a78bedb
Wrap relationship JSON output in {nodes, totalCount}, fetch full pages
BagToad May 6, 2026
5987cb3
Add Issue.ExportData tests for Issues 2.0 fields
BagToad May 6, 2026
201eb7e
Merge issuesV2Flags cases into TestNewCmdCreate
BagToad May 6, 2026
a04438c
Merge createRun_issuesV2 cases into Test_createRun
BagToad May 6, 2026
85ee04d
Exercise loop in blocked-by/blocking createRun test
BagToad May 6, 2026
e9f102e
Test interactive issue-type prompt in createRun
BagToad May 6, 2026
0c48bd0
Cache issue-type name->ID map and use it in issue edit
BagToad May 6, 2026
eff9d48
Replace em-dashes with hyphens in code comments
BagToad May 6, 2026
6283259
Reject cross-host issue refs in ResolveIssueRef
BagToad May 7, 2026
d1363a9
Use strongly-typed githubv4 form for new issue mutations
BagToad May 7, 2026
1a2293b
Show Issues 2.0 fields in non-tty view output
BagToad May 12, 2026
ed355a4
Reject --add-sub-issue when editing multiple issues
BagToad May 12, 2026
8f9069b
Hoist issue-type ID lookup out of the per-issue edit loop
BagToad May 12, 2026
315dafb
Drop client-side feature detection for issue relationships
BagToad May 12, 2026
0245748
Apply deferred update mutations in parallel for gh issue edit
BagToad May 13, 2026
e87ccc5
Drop interactive Parent prompt and move Parent off Editable
BagToad May 13, 2026
5c783a2
Rename --set-parent to --parent for milestone-style symmetry
BagToad May 13, 2026
eb73976
Apply deferred update mutations in parallel for gh issue create
BagToad May 13, 2026
6bbe6e5
Add --remove-type flag to gh issue edit
BagToad May 13, 2026
7285923
Move --type into the search Qualifiers
BagToad May 13, 2026
6106bd3
Rename Editable.Allowed to Selectable
BagToad May 13, 2026
dbe8e34
Overwrite existing parent on --add-sub-issue
BagToad May 13, 2026
4e975fe
Add acceptance tests for non-interactive Issues 2.0 flows
BagToad May 13, 2026
f93fcbf
test(acceptance): add sleep to avoid fetching too early
babakks May 26, 2026
ee99577
Merge pull request #13414 from cli/kw/issues-2.0-acceptance-tests
BagToad Jun 4, 2026
b085033
Merge pull request #13413 from cli/kw/issues-2.0-overwrite-parent-on-…
BagToad Jun 4, 2026
2503dcf
Merge pull request #13412 from cli/kw/issues-2.0-rename-allowed
BagToad Jun 4, 2026
9511bb9
Merge pull request #13411 from cli/kw/issues-2.0-feedback
BagToad Jun 4, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

9 changes: 9 additions & 0 deletions 9 acceptance/acceptance_test.go
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ func TestIssues(t *testing.T) {
testscript.Run(t, testScriptParamsFor(tsEnv, "issue"))
}

func TestIssues2_0(t *testing.T) {
var tsEnv testScriptEnv
if err := tsEnv.fromEnv(); err != nil {
t.Fatal(err)
}

testscript.Run(t, testScriptParamsFor(tsEnv, "issues-2.0"))
}

func TestLabels(t *testing.T) {
var tsEnv testScriptEnv
if err := tsEnv.fromEnv(); err != nil {
Expand Down
28 changes: 28 additions & 0 deletions 28 acceptance/testdata/issues-2.0/issue-create-and-edit-issue-type.txtar
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Create a repository with a file so it has a default branch
exec gh repo create $ORG/$SCRIPT_NAME-$RANDOM_STRING --add-readme --private

# Defer repo cleanup
defer gh repo delete --yes $ORG/$SCRIPT_NAME-$RANDOM_STRING

# Clone the repo
exec gh repo clone $ORG/$SCRIPT_NAME-$RANDOM_STRING

cd $SCRIPT_NAME-$RANDOM_STRING

# Create an issue with --type
exec gh issue create --title 'with type' --body '' --type 'Bug'
stdout2env ISSUE_URL

# Confirm the type stuck
exec gh issue view $ISSUE_URL --json issueType --jq .issueType.name
stdout '^Bug$'

# Clear the type with --remove-type
exec gh issue edit $ISSUE_URL --remove-type
exec gh issue view $ISSUE_URL --json issueType --jq '.issueType // "null"'
stdout '^null$'

# Set the type back with --type
exec gh issue edit $ISSUE_URL --type 'Bug'
exec gh issue view $ISSUE_URL --json issueType --jq .issueType.name
stdout '^Bug$'
32 changes: 32 additions & 0 deletions 32 acceptance/testdata/issues-2.0/issue-create-and-edit-parent.txtar
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Create a repository with a file so it has a default branch
exec gh repo create $ORG/$SCRIPT_NAME-$RANDOM_STRING --add-readme --private

# Defer repo cleanup
defer gh repo delete --yes $ORG/$SCRIPT_NAME-$RANDOM_STRING

# Clone the repo
exec gh repo clone $ORG/$SCRIPT_NAME-$RANDOM_STRING

cd $SCRIPT_NAME-$RANDOM_STRING

# Create the parent issue
exec gh issue create --title 'parent' --body ''
stdout2env PARENT_URL

# Create a child via --parent on create
exec gh issue create --title 'child via create' --body '' --parent $PARENT_URL
stdout2env CHILD_URL

# Confirm parent is set
exec gh issue view $CHILD_URL --json parent --jq .parent.url
stdout $PARENT_URL

# Clear the parent with --remove-parent
exec gh issue edit $CHILD_URL --remove-parent
exec gh issue view $CHILD_URL --json parent --jq '.parent // "null"'
stdout '^null$'

# Set the parent back with --parent on edit
exec gh issue edit $CHILD_URL --parent $PARENT_URL
exec gh issue view $CHILD_URL --json parent --jq .parent.url
stdout $PARENT_URL
54 changes: 54 additions & 0 deletions 54 acceptance/testdata/issues-2.0/issue-create-and-edit-relationships.txtar
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Create a repository with a file so it has a default branch
exec gh repo create $ORG/$SCRIPT_NAME-$RANDOM_STRING --add-readme --private

# Defer repo cleanup
defer gh repo delete --yes $ORG/$SCRIPT_NAME-$RANDOM_STRING

# Clone the repo
exec gh repo clone $ORG/$SCRIPT_NAME-$RANDOM_STRING

cd $SCRIPT_NAME-$RANDOM_STRING

# Create the two helper issues that the main issue will block / be blocked by
exec gh issue create --title 'blocker' --body ''
stdout2env BLOCKER_URL

exec gh issue create --title 'blocked' --body ''
stdout2env BLOCKED_URL

# Create the main issue with both relationships set on create
exec gh issue create --title 'main' --body '' --blocked-by $BLOCKER_URL --blocking $BLOCKED_URL
stdout2env MAIN_URL

# Confirm both relationships landed
exec gh issue view $MAIN_URL --json blockedBy --jq '.blockedBy.nodes[].url'
stdout $BLOCKER_URL

exec gh issue view $MAIN_URL --json blocking --jq '.blocking.nodes[].url'
stdout $BLOCKED_URL

# Add a second blocker / blocked via edit
exec gh issue create --title 'blocker 2' --body ''
stdout2env BLOCKER_2_URL

exec gh issue create --title 'blocked 2' --body ''
stdout2env BLOCKED_2_URL

exec gh issue edit $MAIN_URL --add-blocked-by $BLOCKER_2_URL --add-blocking $BLOCKED_2_URL

exec gh issue view $MAIN_URL --json blockedBy --jq '.blockedBy.totalCount'
stdout '^2$'

exec gh issue view $MAIN_URL --json blocking --jq '.blocking.totalCount'
stdout '^2$'

# Remove the original blocker / blocked
exec gh issue edit $MAIN_URL --remove-blocked-by $BLOCKER_URL --remove-blocking $BLOCKED_URL

exec gh issue view $MAIN_URL --json blockedBy --jq '.blockedBy.nodes[].title'
stdout '^blocker 2$'
! stdout '^blocker$'

exec gh issue view $MAIN_URL --json blocking --jq '.blocking.nodes[].title'
stdout '^blocked 2$'
! stdout '^blocked$'
35 changes: 35 additions & 0 deletions 35 acceptance/testdata/issues-2.0/issue-edit-sub-issues.txtar
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Create a repository with a file so it has a default branch
exec gh repo create $ORG/$SCRIPT_NAME-$RANDOM_STRING --add-readme --private

# Defer repo cleanup
defer gh repo delete --yes $ORG/$SCRIPT_NAME-$RANDOM_STRING

# Clone the repo
exec gh repo clone $ORG/$SCRIPT_NAME-$RANDOM_STRING

cd $SCRIPT_NAME-$RANDOM_STRING

# Create three issues: parent A, parent B, candidate C
exec gh issue create --title 'parent A' --body ''
stdout2env PARENT_A_URL

exec gh issue create --title 'parent B' --body ''
stdout2env PARENT_B_URL

exec gh issue create --title 'candidate C' --body ''
stdout2env CANDIDATE_URL

# Add C as a sub-issue of A
exec gh issue edit $PARENT_A_URL --add-sub-issue $CANDIDATE_URL
exec gh issue view $CANDIDATE_URL --json parent --jq .parent.url
stdout $PARENT_A_URL

# Adding C as a sub-issue of B silently overwrites the existing parent
exec gh issue edit $PARENT_B_URL --add-sub-issue $CANDIDATE_URL
exec gh issue view $CANDIDATE_URL --json parent --jq .parent.url
stdout $PARENT_B_URL

# Removing the sub-issue from B drops the parent
exec gh issue edit $PARENT_B_URL --remove-sub-issue $CANDIDATE_URL
exec gh issue view $CANDIDATE_URL --json parent --jq '.parent // "null"'
stdout '^null$'
21 changes: 21 additions & 0 deletions 21 acceptance/testdata/issues-2.0/issue-list-filter-by-type.txtar
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Create a repository with a file so it has a default branch
exec gh repo create $ORG/$SCRIPT_NAME-$RANDOM_STRING --add-readme --private

# Defer repo cleanup
defer gh repo delete --yes $ORG/$SCRIPT_NAME-$RANDOM_STRING

# Clone the repo
exec gh repo clone $ORG/$SCRIPT_NAME-$RANDOM_STRING

cd $SCRIPT_NAME-$RANDOM_STRING

# Create one Bug-typed issue and one untyped issue
exec gh issue create --title 'typed-bug' --body '' --type 'Bug'
exec gh issue create --title 'untyped' --body ''

sleep 3

# Filtering by type returns only the typed issue
exec gh issue list --type 'Bug'
stdout 'typed-bug'
! stdout 'untyped'
39 changes: 39 additions & 0 deletions 39 acceptance/testdata/issues-2.0/issue-view-issues-2.0-fields.txtar
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Create a repository with a file so it has a default branch
exec gh repo create $ORG/$SCRIPT_NAME-$RANDOM_STRING --add-readme --private

# Defer repo cleanup
defer gh repo delete --yes $ORG/$SCRIPT_NAME-$RANDOM_STRING

# Clone the repo
exec gh repo clone $ORG/$SCRIPT_NAME-$RANDOM_STRING

cd $SCRIPT_NAME-$RANDOM_STRING

# Create a parent, a sub-issue, a blocker, and a blocked target
exec gh issue create --title 'parent' --body ''
stdout2env PARENT_URL

exec gh issue create --title 'sub' --body ''
stdout2env SUB_URL

exec gh issue create --title 'blocker' --body ''
stdout2env BLOCKER_URL

exec gh issue create --title 'blocked' --body ''
stdout2env BLOCKED_URL

# Create the main issue wired up to all four
exec gh issue create --title 'main' --body '' --type 'Bug' --parent $PARENT_URL --blocked-by $BLOCKER_URL --blocking $BLOCKED_URL
stdout2env MAIN_URL

# Attach the sub-issue
exec gh issue edit $MAIN_URL --add-sub-issue $SUB_URL

# Non-tty view should include all the new Issues 2.0 fields
exec gh issue view $MAIN_URL
stdout '^issue-type:\tBug$'
stdout '^parent:\t.+/.+#[0-9]+$'
stdout '^sub-issues:\t.+/.+#[0-9]+$'
stdout '^sub-issues-completed:\t0/1$'
stdout '^blocked-by:\t.+/.+#[0-9]+$'
stdout '^blocking:\t.+/.+#[0-9]+$'
65 changes: 65 additions & 0 deletions 65 api/export_pr.go
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,71 @@ func (issue *Issue) ExportData(fields []string) map[string]interface{} {
})
}
data[f] = items
case "issueType":
Comment thread
BagToad marked this conversation as resolved.
Resolved

Uh oh!

There was an error while loading. Please reload this page.

data[f] = issue.IssueType
case "parent":
if issue.Parent != nil {
data[f] = map[string]interface{}{
"id": issue.Parent.ID,
"number": issue.Parent.Number,
"title": issue.Parent.Title,
"url": issue.Parent.URL,
"state": issue.Parent.State,
}
} else {
data[f] = nil
}
case "subIssues":
items := make([]map[string]interface{}, 0, len(issue.SubIssues.Nodes))
Comment thread
BagToad marked this conversation as resolved.
Resolved

Uh oh!

There was an error while loading. Please reload this page.

for _, n := range issue.SubIssues.Nodes {
items = append(items, map[string]interface{}{
"id": n.ID,
"number": n.Number,
"title": n.Title,
"url": n.URL,
"state": n.State,
})
}
Comment thread
BagToad marked this conversation as resolved.
Resolved

Uh oh!

There was an error while loading. Please reload this page.

data[f] = map[string]interface{}{
"nodes": items,
"totalCount": issue.SubIssues.TotalCount,
}
case "subIssuesSummary":
data[f] = map[string]interface{}{
"total": issue.SubIssuesSummary.Total,
"completed": issue.SubIssuesSummary.Completed,
"percentCompleted": issue.SubIssuesSummary.PercentCompleted,
}
case "blockedBy":
items := make([]map[string]interface{}, 0, len(issue.BlockedBy.Nodes))
for _, n := range issue.BlockedBy.Nodes {
items = append(items, map[string]interface{}{
"id": n.ID,
"number": n.Number,
"title": n.Title,
"url": n.URL,
"state": n.State,
})
}
data[f] = map[string]interface{}{
"nodes": items,
"totalCount": issue.BlockedBy.TotalCount,
}
case "blocking":
items := make([]map[string]interface{}, 0, len(issue.Blocking.Nodes))
for _, n := range issue.Blocking.Nodes {
items = append(items, map[string]interface{}{
"id": n.ID,
"number": n.Number,
"title": n.Title,
"url": n.URL,
"state": n.State,
})
}
data[f] = map[string]interface{}{
"nodes": items,
"totalCount": issue.Blocking.TotalCount,
}
default:
sf := fieldByName(v, f)
data[f] = sf.Interface()
Expand Down
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.