Skip to content

Commit 83a4a32

Browse files
owenniblockCopilot
andcommitted
list_issues legacy snap: restore strict field_filters Required to match main
The legacy variant's field_filters items schema was loosened from ['field_name', 'value'] (main) to ['field_name'] (MS-aware) when I collapsed the two schemas into the buildListIssues helper. The MS-aware loosening is correct (either 'value' or 'values' is acceptable, enforced at runtime in parseRawFieldFilters), but the legacy variant has no 'values' slot so it should keep 'value' required outright. The runtime parser still rejects missing value in either variant, so this was a schema-strictness regression rather than a behavioural one, but worth fixing — the legacy snap is now byte-identical to main's list_issues.snap, which is the right invariant: legacy variant === main. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent b9f6265 commit 83a4a32

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

pkg/github/__toolsnaps__/list_issues.snap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
}
3333
},
3434
"required": [
35-
"field_name"
35+
"field_name",
36+
"value"
3637
],
3738
"type": "object"
3839
},

pkg/github/issues.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2485,6 +2485,14 @@ func buildListIssues(t translations.TranslationHelperFunc, multiSelectEnabled bo
24852485
}
24862486
}
24872487

2488+
// Legacy variant requires `value` outright (its schema has no `values` slot).
2489+
// MS-aware variant only requires `field_name` because either `value` or
2490+
// `values` is acceptable; the parser enforces exactly-one-of at runtime.
2491+
fieldFilterRequired := []string{"field_name", "value"}
2492+
if multiSelectEnabled {
2493+
fieldFilterRequired = []string{"field_name"}
2494+
}
2495+
24882496
schema := &jsonschema.Schema{
24892497
Type: "object",
24902498
Properties: map[string]*jsonschema.Schema{
@@ -2528,7 +2536,11 @@ func buildListIssues(t translations.TranslationHelperFunc, multiSelectEnabled bo
25282536
Items: &jsonschema.Schema{
25292537
Type: "object",
25302538
Properties: fieldFilterItemProps,
2531-
Required: []string{"field_name"},
2539+
// Legacy keeps the historical strict shape (field_name + value).
2540+
// MS-aware loosens to just field_name because either `value` or
2541+
// `values` is acceptable — the parser enforces "exactly one of"
2542+
// at runtime.
2543+
Required: fieldFilterRequired,
25322544
},
25332545
},
25342546
},

0 commit comments

Comments
 (0)