From 99f170813fb4b72278d043f9f7e39bef40d42b89 Mon Sep 17 00:00:00 2001 From: Iulia Bejan <64602043+iulia-b@users.noreply.github.com> Date: Wed, 22 Apr 2026 17:13:59 +0300 Subject: [PATCH 1/3] Fix set_issue_fields mutation: use correct inline fragments for IssueFieldValue union MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The mutation response struct used a single inline fragment '... on IssueFieldDateValue' with a 'Name' field that doesn't exist on that type (only IssueFieldSingleSelectValue has 'name'). This caused GraphQL validation to fail with: Field 'name' doesn't exist on type 'IssueFieldDateValue' Since GraphQL validates the entire document (including response selection sets) before executing any operation, the mutation never fired at all — no fields were ever set regardless of input. Fix by adding correct inline fragments for all four union types: - IssueFieldTextValue (value) - IssueFieldSingleSelectValue (name) - IssueFieldDateValue (value) - IssueFieldNumberValue (value) --- pkg/github/issues_granular.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkg/github/issues_granular.go b/pkg/github/issues_granular.go index 5dbd7d8d11..fe3b4bcc9b 100644 --- a/pkg/github/issues_granular.go +++ b/pkg/github/issues_granular.go @@ -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"` } } `graphql:"setIssueFieldValue(input: $input)"` } From 2c2cb5132976f92c3e2384752c64c61e24e71809 Mon Sep 17 00:00:00 2001 From: Iulia Bejan <64602043+iulia-b@users.noreply.github.com> Date: Wed, 22 Apr 2026 17:21:40 +0300 Subject: [PATCH 2/3] Update test mock to match corrected inline fragments --- pkg/github/granular_tools_test.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkg/github/granular_tools_test.go b/pkg/github/granular_tools_test.go index 883158bb25..6623894e43 100644 --- a/pkg/github/granular_tools_test.go +++ b/pkg/github/granular_tools_test.go @@ -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)"` }{}, From b6f41f7c859efe225f511d3d159327a0f0cd3e79 Mon Sep 17 00:00:00 2001 From: Iulia Bejan <64602043+iulia-b@users.noreply.github.com> Date: Wed, 22 Apr 2026 17:23:43 +0300 Subject: [PATCH 3/3] Update handler_test.go formatting --- pkg/http/handler_test.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pkg/http/handler_test.go b/pkg/http/handler_test.go index 46e86b4a89..002266ba15 100644 --- a/pkg/http/handler_test.go +++ b/pkg/http/handler_test.go @@ -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, }, }