Skip to content

Commit 5d2628a

Browse files
committed
address copilot feedback, align pagination tags to camelCase
1 parent 66e3431 commit 5d2628a

File tree

2 files changed

+23
-8
lines changed

2 files changed

+23
-8
lines changed

pkg/github/issues_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,11 +1301,26 @@ func Test_ListIssues(t *testing.T) {
13011301

13021302
assert.Len(t, response.Issues, tc.expectedCount, "Expected %d issues, got %d", tc.expectedCount, len(response.Issues))
13031303

1304+
// Verify pagination metadata
1305+
assert.Equal(t, tc.expectedCount, response.TotalCount)
1306+
assert.False(t, response.PageInfo.HasNextPage)
1307+
assert.False(t, response.PageInfo.HasPreviousPage)
1308+
13041309
// Verify that returned issues have expected structure
13051310
for _, issue := range response.Issues {
13061311
assert.NotZero(t, issue.Number, "Issue should have number")
13071312
assert.NotEmpty(t, issue.Title, "Issue should have title")
13081313
assert.NotEmpty(t, issue.State, "Issue should have state")
1314+
assert.NotEmpty(t, issue.CreatedAt, "Issue should have created_at")
1315+
assert.NotEmpty(t, issue.UpdatedAt, "Issue should have updated_at")
1316+
assert.NotNil(t, issue.User, "Issue should have user")
1317+
assert.NotEmpty(t, issue.User.Login, "Issue user should have login")
1318+
assert.Empty(t, issue.HTMLURL, "html_url should be empty (not populated by GraphQL fragment)")
1319+
1320+
// Labels should be flattened to name strings
1321+
for _, label := range issue.Labels {
1322+
assert.NotEmpty(t, label, "Label should be a non-empty string")
1323+
}
13091324
}
13101325
})
13111326
}

pkg/github/minimal_types.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ type MinimalIssue struct {
196196
// MinimalIssuesResponse is the trimmed output for a paginated list of issues.
197197
type MinimalIssuesResponse struct {
198198
Issues []MinimalIssue `json:"issues"`
199-
TotalCount int `json:"total_count"`
200-
PageInfo MinimalPageInfo `json:"page_info"`
199+
TotalCount int `json:"totalCount"`
200+
PageInfo MinimalPageInfo `json:"pageInfo"`
201201
}
202202

203203
// MinimalIssueComment is the trimmed output type for issue comment objects to reduce verbosity.
@@ -698,10 +698,10 @@ func convertToMinimalCommit(commit *github.RepositoryCommit, includeDiffs bool)
698698

699699
// MinimalPageInfo contains pagination cursor information.
700700
type MinimalPageInfo struct {
701-
HasNextPage bool `json:"has_next_page"`
702-
HasPreviousPage bool `json:"has_previous_page"`
703-
StartCursor string `json:"start_cursor,omitempty"`
704-
EndCursor string `json:"end_cursor,omitempty"`
701+
HasNextPage bool `json:"hasNextPage"`
702+
HasPreviousPage bool `json:"hasPreviousPage"`
703+
StartCursor string `json:"startCursor,omitempty"`
704+
EndCursor string `json:"endCursor,omitempty"`
705705
}
706706

707707
// MinimalReviewComment is the trimmed output type for PR review comment objects.
@@ -727,8 +727,8 @@ type MinimalReviewThread struct {
727727
// MinimalReviewThreadsResponse is the trimmed output for a paginated list of PR review threads.
728728
type MinimalReviewThreadsResponse struct {
729729
ReviewThreads []MinimalReviewThread `json:"review_threads"`
730-
TotalCount int `json:"total_count"`
731-
PageInfo MinimalPageInfo `json:"page_info"`
730+
TotalCount int `json:"totalCount"`
731+
PageInfo MinimalPageInfo `json:"pageInfo"`
732732
}
733733

734734
func convertToMinimalPRFiles(files []*github.CommitFile) []MinimalPRFile {

0 commit comments

Comments
 (0)