From edef00099887ef29864b89576cdd34da69938c12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Slav=20Pidgorny=20=F0=9F=87=BA=F0=9F=87=A6?= Date: Thu, 20 Nov 2025 09:27:03 +1100 Subject: [PATCH 1/4] Add ParentIssueURL attribute to Issue struct --- github/issues.go | 1 + github/issues_test.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/github/issues.go b/github/issues.go index 72d0dbae6bd..d19987f26bf 100644 --- a/github/issues.go +++ b/github/issues.go @@ -54,6 +54,7 @@ type Issue struct { EventsURL *string `json:"events_url,omitempty"` LabelsURL *string `json:"labels_url,omitempty"` RepositoryURL *string `json:"repository_url,omitempty"` + ParentIssueURL *string `json:"parent_issue_url,omitempty"` Milestone *Milestone `json:"milestone,omitempty"` PullRequestLinks *PullRequestLinks `json:"pull_request,omitempty"` Repository *Repository `json:"repository,omitempty"` diff --git a/github/issues_test.go b/github/issues_test.go index a859fd7c9ec..53fe46aa81d 100644 --- a/github/issues_test.go +++ b/github/issues_test.go @@ -586,6 +586,7 @@ func TestIssue_Marshal(t *testing.T) { EventsURL: Ptr("eurl"), LabelsURL: Ptr("lurl"), RepositoryURL: Ptr("rurl"), + ParentIssueURL: Ptr("piurl"), Milestone: &Milestone{ID: Ptr(int64(1))}, PullRequestLinks: &PullRequestLinks{URL: Ptr("url")}, Repository: &Repository{ID: Ptr(int64(1))}, @@ -629,6 +630,7 @@ func TestIssue_Marshal(t *testing.T) { "events_url": "eurl", "labels_url": "lurl", "repository_url": "rurl", + "parent_issue_url": "piurl", "milestone": { "id": 1 }, From 7939beeb906ebcdfb3dec16890e275dc378dc065 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Slav=20Pidgorny=20=F0=9F=87=BA=F0=9F=87=A6?= Date: Thu, 20 Nov 2025 10:23:17 +1100 Subject: [PATCH 2/4] Add ParentIssueURL to TestIssue_String for string representation --- github/github-stringify_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index 6f0cdbeb8f1..5bf246a265d 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -931,6 +931,7 @@ func TestIssue_String(t *testing.T) { EventsURL: Ptr(""), LabelsURL: Ptr(""), RepositoryURL: Ptr(""), + ParentIssueURL: Ptr(""), Milestone: &Milestone{}, PullRequestLinks: &PullRequestLinks{}, Repository: &Repository{}, @@ -940,7 +941,7 @@ func TestIssue_String(t *testing.T) { Type: &IssueType{}, ActiveLockReason: Ptr(""), } - want := `github.Issue{ID:0, Number:0, State:"", StateReason:"", Locked:false, Title:"", Body:"", AuthorAssociation:"", User:github.User{}, Assignee:github.User{}, Comments:0, ClosedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, ClosedBy:github.User{}, URL:"", HTMLURL:"", CommentsURL:"", EventsURL:"", LabelsURL:"", RepositoryURL:"", Milestone:github.Milestone{}, PullRequestLinks:github.PullRequestLinks{}, Repository:github.Repository{}, Reactions:github.Reactions{}, NodeID:"", Draft:false, Type:github.IssueType{}, ActiveLockReason:""}` + want := `github.Issue{ID:0, Number:0, State:"", StateReason:"", Locked:false, Title:"", Body:"", AuthorAssociation:"", User:github.User{}, Assignee:github.User{}, Comments:0, ClosedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, ClosedBy:github.User{}, URL:"", HTMLURL:"", CommentsURL:"", EventsURL:"", LabelsURL:"", RepositoryURL:"", ParentIssueURL:"", Milestone:github.Milestone{}, PullRequestLinks:github.PullRequestLinks{}, Repository:github.Repository{}, Reactions:github.Reactions{}, NodeID:"", Draft:false, Type:github.IssueType{}, ActiveLockReason:""}` if got := v.String(); got != want { t.Errorf("Issue.String = %v, want %v", got, want) } From 4eb3d10d1e726ddccb724120c3d8d54fcd4224f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Slav=20Pidgorny=20=F0=9F=87=BA=F0=9F=87=A6?= Date: Thu, 20 Nov 2025 10:38:24 +1100 Subject: [PATCH 3/4] Completing it --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/github/github-accessors.go b/github/github-accessors.go index d9ed060d5ce..52798ac89d3 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -12558,6 +12558,14 @@ func (i *Issue) GetNumber() int { return *i.Number } +// GetParentIssueURL returns the ParentIssueURL field if it's non-nil, zero value otherwise. +func (i *Issue) GetParentIssueURL() string { + if i == nil || i.ParentIssueURL == nil { + return "" + } + return *i.ParentIssueURL +} + // GetPullRequestLinks returns the PullRequestLinks field. func (i *Issue) GetPullRequestLinks() *PullRequestLinks { if i == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index d2ae9e7b911..894a3685b95 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -16327,6 +16327,17 @@ func TestIssue_GetNumber(tt *testing.T) { i.GetNumber() } +func TestIssue_GetParentIssueURL(tt *testing.T) { + tt.Parallel() + var zeroValue string + i := &Issue{ParentIssueURL: &zeroValue} + i.GetParentIssueURL() + i = &Issue{} + i.GetParentIssueURL() + i = nil + i.GetParentIssueURL() +} + func TestIssue_GetPullRequestLinks(tt *testing.T) { tt.Parallel() i := &Issue{} From b75cb820158e2f3b661aa026d2a0ec2230e3bcf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Slav=20Pidgorny=20=F0=9F=87=BA=F0=9F=87=A6?= Date: Thu, 20 Nov 2025 11:46:52 +1100 Subject: [PATCH 4/4] CLA