Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion pkg/github/granular_tools_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -810,9 +810,18 @@ func TestGranularSetIssueFields(t *testing.T) {
URL githubv4.String
}
IssueFieldValues []struct {
Field struct {
TextValue struct {
Value string
} `graphql:"... on IssueFieldTextValue"`
SingleSelectValue struct {
Name string
} `graphql:"... on IssueFieldSingleSelectValue"`
DateValue struct {
Value string
} `graphql:"... on IssueFieldDateValue"`
NumberValue struct {
Value float64
} `graphql:"... on IssueFieldNumberValue"`
}
} `graphql:"setIssueFieldValue(input: $input)"`
}{},
Expand Down
11 changes: 10 additions & 1 deletion pkg/github/issues_granular.go
Original file line number Diff line number Diff line change
Expand Up @@ -793,9 +793,18 @@ func GranularSetIssueFields(t translations.TranslationHelperFunc) inventory.Serv
URL githubv4.String
}
IssueFieldValues []struct {
Field struct {
TextValue struct {
Value string
} `graphql:"... on IssueFieldTextValue"`
SingleSelectValue struct {
Name string
} `graphql:"... on IssueFieldSingleSelectValue"`
DateValue struct {
Value string
} `graphql:"... on IssueFieldDateValue"`
NumberValue struct {
Value float64
} `graphql:"... on IssueFieldNumberValue"`
}
Comment on lines 795 to 808
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IssueFieldValues is requested in the mutation response but never read (the tool only marshals MinimalResponse from Issue). Consider removing IssueFieldValues from the selection set to reduce response payload and avoid having to maintain inline fragments for union validation; if you want to keep it, add a short comment explaining why it's intentionally unused.

Copilot uses AI. Check for mistakes.
} `graphql:"setIssueFieldValue(input: $input)"`
}
Expand Down
24 changes: 12 additions & 12 deletions pkg/http/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -639,33 +639,33 @@ func TestStaticConfigEnforcement(t *testing.T) {
// and rejects requests with "application/json; charset=utf-8".
func TestContentTypeHandling(t *testing.T) {
tests := []struct {
name string
contentType string
name string
contentType string
expectUnsupportedMedia bool
}{
{
name: "exact application/json is accepted",
contentType: "application/json",
name: "exact application/json is accepted",
contentType: "application/json",
expectUnsupportedMedia: false,
},
{
name: "application/json with charset=utf-8 should be accepted",
contentType: "application/json; charset=utf-8",
name: "application/json with charset=utf-8 should be accepted",
contentType: "application/json; charset=utf-8",
expectUnsupportedMedia: false,
},
{
name: "application/json with charset=UTF-8 should be accepted",
contentType: "application/json; charset=UTF-8",
name: "application/json with charset=UTF-8 should be accepted",
contentType: "application/json; charset=UTF-8",
expectUnsupportedMedia: false,
},
{
name: "completely wrong content type is rejected",
contentType: "text/plain",
name: "completely wrong content type is rejected",
contentType: "text/plain",
expectUnsupportedMedia: true,
},
{
name: "empty content type is rejected",
contentType: "",
name: "empty content type is rejected",
contentType: "",
expectUnsupportedMedia: true,
},
}
Expand Down
Loading