Skip to content

Commit 4517fd9

Browse files
talumCopilot
andcommitted
Merge main into pr-artifacts-support
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 633fd653-7701-48a8-8eec-934b966469a3
2 parents f0e30a3 + 4e6e6c0 commit 4517fd9

17 files changed

Lines changed: 94 additions & 319 deletions

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,6 +1371,7 @@ For negotiated supported protocol versions `2026-07-28` or newer, the consolidat
13711371
- `owner`: Repository owner (string, required)
13721372
- `pullNumber`: Pull request number (number, required)
13731373
- `repo`: Repository name (string, required)
1374+
- `resolutionReason`: Optional reason for resolving a Copilot code review thread: addressed, wont-fix, or invalid. (string, optional)
13741375
- `threadId`: The node ID of the review thread (e.g., PRRT_kwDOxxx). Required for resolve_thread and unresolve_thread methods. Get thread IDs from pull_request_read with method get_review_comments. (string, optional)
13751376

13761377
- **search_pull_requests** - Search pull requests

‎docs/feature-flags.md‎

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,7 @@ as output formatting) won't appear here.
470470

471471
- **resolve_review_thread** - Resolve Review Thread
472472
- **OAuth Challenge Scopes**: `repo`
473+
- `resolutionReason`: Optional reason for resolving a Copilot code review thread: addressed, wont-fix, or invalid. (string, optional)
473474
- `threadID`: The node ID of the review thread to resolve (e.g., PRRT_kwDOxxx) (string, required)
474475

475476
- **submit_pending_pull_request_review** - Submit Pending Pull Request Review
@@ -718,18 +719,4 @@ as output formatting) won't appear here.
718719
- `perPage`: Results per page for pagination (min 0, max 100). Zero is forwarded for the GitHub API default. (number, optional)
719720
- `repo`: The name of the repository (string, required)
720721

721-
### `thread_resolution_reason`
722-
723-
- **pull_request_review_write** - Write operations (create, submit, delete) on pull request reviews
724-
- **OAuth Challenge Scopes**: `repo`
725-
- `body`: Review comment text (string, optional)
726-
- `commitID`: SHA of commit to review (string, optional)
727-
- `event`: Review action to perform. (string, optional)
728-
- `method`: The write operation to perform on pull request review. (string, required)
729-
- `owner`: Repository owner (string, required)
730-
- `pullNumber`: Pull request number (number, required)
731-
- `repo`: Repository name (string, required)
732-
- `resolutionReason`: Optional reason for resolving a Copilot code review thread: addressed, wont-fix, or invalid. (string, optional)
733-
- `threadId`: The node ID of the review thread (e.g., PRRT_kwDOxxx). Required for resolve_thread and unresolve_thread methods. Get thread IDs from pull_request_read with method get_review_comments. (string, optional)
734-
735722
<!-- END AUTOMATED FEATURE FLAG TOOLS -->

‎pkg/github/__toolsnaps__/pull_request_review_write.snap‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,15 @@
4747
"description": "Repository name",
4848
"type": "string"
4949
},
50+
"resolutionReason": {
51+
"description": "Optional reason for resolving a Copilot code review thread: addressed, wont-fix, or invalid.",
52+
"enum": [
53+
"addressed",
54+
"wont-fix",
55+
"invalid"
56+
],
57+
"type": "string"
58+
},
5059
"threadId": {
5160
"description": "The node ID of the review thread (e.g., PRRT_kwDOxxx). Required for resolve_thread and unresolve_thread methods. Get thread IDs from pull_request_read with method get_review_comments.",
5261
"type": "string"

‎pkg/github/__toolsnaps__/pull_request_review_write_resolution_reason.snap‎

Lines changed: 0 additions & 81 deletions
This file was deleted.

‎pkg/github/__toolsnaps__/resolve_review_thread.snap‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@
2121
],
2222
"inputSchema": {
2323
"properties": {
24+
"resolutionReason": {
25+
"description": "Optional reason for resolving a Copilot code review thread: addressed, wont-fix, or invalid.",
26+
"enum": [
27+
"addressed",
28+
"wont-fix",
29+
"invalid"
30+
],
31+
"type": "string"
32+
},
2433
"threadID": {
2534
"description": "The node ID of the review thread to resolve (e.g., PRRT_kwDOxxx)",
2635
"type": "string"

‎pkg/github/__toolsnaps__/resolve_review_thread_resolution_reason.snap‎

Lines changed: 0 additions & 54 deletions
This file was deleted.

‎pkg/github/consolidated_pull_request_types.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ func normalizePullRequestReviewWriteArguments(raw json.RawMessage) (json.RawMess
598598
"method": params.Method, "owner": params.Owner, "repo": params.Repo, "pullNumber": params.PullNumber,
599599
}
600600
// Empty optional strings are equivalent to omitted ones for the handler,
601-
// but would fail the schema's enum for event.
601+
// but would fail the schema's enums for event and resolutionReason.
602602
for key, value := range map[string]string{"body": params.Body, "event": params.Event, "threadId": params.ThreadID} {
603603
if value != "" {
604604
canonical[key] = value
@@ -607,7 +607,7 @@ func normalizePullRequestReviewWriteArguments(raw json.RawMessage) (json.RawMess
607607
if params.CommitID != nil {
608608
canonical["commitID"] = *params.CommitID
609609
}
610-
if params.ResolutionReason != nil {
610+
if params.ResolutionReason != nil && *params.ResolutionReason != "" {
611611
canonical["resolutionReason"] = *params.ResolutionReason
612612
}
613613
for key := range args {

‎pkg/github/feature_flags.go‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ const FeatureFlagAgentAutomations = "agent_automations"
4646
// opt-in.
4747
const FeatureFlagDuplicateDetection = "duplicate_detection"
4848

49-
// FeatureFlagThreadResolutionReason exposes resolution reasons for Copilot review threads.
50-
const FeatureFlagThreadResolutionReason = "thread_resolution_reason"
51-
5249
// FeatureFlagSkillsExtension replaces server instructions with MCP-served skills.
5350
const FeatureFlagSkillsExtension = "skills"
5451

@@ -69,7 +66,6 @@ var AllowedFeatureFlags = []string{
6966
FeatureFlagPullRequestArtifacts,
7067
FeatureFlagAgentAutomations,
7168
FeatureFlagDuplicateDetection,
72-
FeatureFlagThreadResolutionReason,
7369
FeatureFlagSkillsExtension,
7470
}
7571

‎pkg/github/feature_flags_test.go‎

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,6 @@ func TestResolveFeatureFlags(t *testing.T) {
201201
insidersMode: false,
202202
expectedFlags: []string{FeatureFlagIssuesGranular},
203203
},
204-
{
205-
name: "thread resolution reason can be directly enabled",
206-
enabledFeatures: []string{FeatureFlagThreadResolutionReason},
207-
expectedFlags: []string{FeatureFlagThreadResolutionReason},
208-
},
209204
{
210205
name: "agent automations can be directly enabled",
211206
enabledFeatures: []string{FeatureFlagAgentAutomations},
@@ -253,36 +248,25 @@ func TestThreadResolutionReasonToolVariants(t *testing.T) {
253248
toolName string
254249
hasReason bool
255250
}{
256-
{
257-
name: "consolidated flag off",
258-
toolName: "pull_request_review_write",
259-
},
260251
{
261252
name: "consolidated flag on",
262-
flags: []inventory.FeatureFlag{FeatureFlagThreadResolutionReason},
263253
toolName: "pull_request_review_write",
264254
hasReason: true,
265255
},
266-
{
267-
name: "granular flag off",
268-
flags: []inventory.FeatureFlag{inventory.FeatureFlag(FeatureFlagPullRequestsGranular)},
269-
toolName: "resolve_review_thread",
270-
},
271256
{
272257
name: "granular flag on",
273-
flags: []inventory.FeatureFlag{inventory.FeatureFlag(FeatureFlagPullRequestsGranular), FeatureFlagThreadResolutionReason},
258+
flags: []inventory.FeatureFlag{inventory.FeatureFlag(FeatureFlagPullRequestsGranular)},
274259
toolName: "resolve_review_thread",
275260
hasReason: true,
276261
},
277262
{
278263
name: "consolidated flag on GHES",
279-
flags: []inventory.FeatureFlag{FeatureFlagThreadResolutionReason},
280264
host: utils.HostTypeGHES,
281265
toolName: "pull_request_review_write",
282266
},
283267
{
284268
name: "granular flag on GHES",
285-
flags: []inventory.FeatureFlag{inventory.FeatureFlag(FeatureFlagPullRequestsGranular), FeatureFlagThreadResolutionReason},
269+
flags: []inventory.FeatureFlag{inventory.FeatureFlag(FeatureFlagPullRequestsGranular)},
286270
host: utils.HostTypeGHES,
287271
toolName: "resolve_review_thread",
288272
},

‎pkg/github/granular_pull_request_types.go‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,11 @@ func normalizeGranularPullRequestFields(args map[string]any, kind string) error
208208
return err
209209
}
210210
if kind == "resolve_reason" {
211-
_, _, err := OptionalParamOK[string](args, "resolutionReason")
211+
reason, _, err := OptionalParamOK[string](args, "resolutionReason")
212+
if reason == "" {
213+
// An empty reason means none and would fail the schema's enum.
214+
delete(args, "resolutionReason")
215+
}
212216
return err
213217
}
214218
delete(args, "resolutionReason")

0 commit comments

Comments
 (0)