Skip to content

Commit 7629b6e

Browse files
tommaso-moroCopilot
authored andcommitted
Enable fields param in Insiders mode
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent c36e4e4 commit 7629b6e

3 files changed

Lines changed: 107 additions & 0 deletions

File tree

docs/insiders-features.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,96 @@ The list below is generated from the Go source. It covers tool **inventory and s
133133
- 'blocked_by' - the subject issue is blocked by the related issue.
134134
- 'blocking' - the subject issue blocks the related issue. (string, required)
135135

136+
### `fields_param`
137+
138+
- **get_file_contents** - Get file or directory contents
139+
- **Required OAuth Scopes**: `repo`
140+
- `fields`: Subset of fields to return for each entry when the path is a directory. If omitted, all fields are returned. Ignored when the path is a single file. Use this to reduce response size when listing directories and you only need specific fields, e.g. just 'name' and 'type'. (string[], optional)
141+
- `owner`: Repository owner (username or organization) (string, required)
142+
- `path`: Path to file/directory (string, optional)
143+
- `ref`: Accepts optional git refs such as `refs/tags/{tag}`, `refs/heads/{branch}` or `refs/pull/{pr_number}/head` (string, optional)
144+
- `repo`: Repository name (string, required)
145+
- `sha`: Accepts optional commit SHA. If specified, it will be used instead of ref (string, optional)
146+
147+
- **list_commits** - List commits
148+
- **Required OAuth Scopes**: `repo`
149+
- `author`: Author username or email address to filter commits by (string, optional)
150+
- `fields`: Subset of fields to return for each commit. If omitted, all fields are returned. Use this to reduce response size when you only need specific fields, e.g. just 'sha' and 'html_url'. (string[], optional)
151+
- `owner`: Repository owner (string, required)
152+
- `page`: Page number for pagination (min 1) (number, optional)
153+
- `path`: Only commits containing this file path will be returned (string, optional)
154+
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
155+
- `repo`: Repository name (string, required)
156+
- `sha`: Commit SHA, branch or tag name to list commits of. If not provided, uses the default branch of the repository. If a commit SHA is provided, will list commits up to that SHA. (string, optional)
157+
- `since`: Only commits after this date will be returned (ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ or YYYY-MM-DD) (string, optional)
158+
- `until`: Only commits before this date will be returned (ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ or YYYY-MM-DD) (string, optional)
159+
160+
- **list_issues** - List issues
161+
- **Required OAuth Scopes**: `repo`
162+
- `after`: Cursor for pagination. Use the cursor from the previous response. (string, optional)
163+
- `direction`: Order direction. If provided, the 'orderBy' also needs to be provided. (string, optional)
164+
- `field_filters`: Filter by custom issue field values. Each entry takes a field_name and a value; the server looks up the field and coerces the value to its type (single-select option name, text, number, or YYYY-MM-DD date). (object[], optional)
165+
- `fields`: Subset of fields to return for each issue. If omitted, all fields are returned. Use this to reduce response size when you only need specific fields; omitting 'body' and 'field_values' in particular drops the largest per-result data. (string[], optional)
166+
- `labels`: Filter by labels (string[], optional)
167+
- `orderBy`: Order issues by field. If provided, the 'direction' also needs to be provided. (string, optional)
168+
- `owner`: Repository owner (string, required)
169+
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
170+
- `repo`: Repository name (string, required)
171+
- `since`: Filter by date (ISO 8601 timestamp) (string, optional)
172+
- `state`: Filter by state, by default both open and closed issues are returned when not provided (string, optional)
173+
174+
- **list_pull_requests** - List pull requests
175+
- **Required OAuth Scopes**: `repo`
176+
- `base`: Filter by base branch (string, optional)
177+
- `direction`: Sort direction (string, optional)
178+
- `fields`: Subset of fields to return for each pull request. If omitted, all fields are returned. Use this to reduce response size when you only need specific fields; omitting 'body' in particular drops the largest per-result data. (string[], optional)
179+
- `head`: Filter by head user/org and branch (string, optional)
180+
- `owner`: Repository owner (string, required)
181+
- `page`: Page number for pagination (min 1) (number, optional)
182+
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
183+
- `repo`: Repository name (string, required)
184+
- `sort`: Sort by (string, optional)
185+
- `state`: Filter by state (string, optional)
186+
187+
- **list_releases** - List releases
188+
- **Required OAuth Scopes**: `repo`
189+
- `fields`: Subset of fields to return for each release. If omitted, all fields are returned. Use this to reduce response size when you only need specific fields; omitting 'body' in particular drops the largest per-release data. (string[], optional)
190+
- `owner`: Repository owner (string, required)
191+
- `page`: Page number for pagination (min 1) (number, optional)
192+
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
193+
- `repo`: Repository name (string, required)
194+
195+
- **search_code** - Search code
196+
- **Required OAuth Scopes**: `repo`
197+
- `fields`: Subset of fields to return for each code search result. If omitted, all fields are returned. Use this to reduce response size when you only need specific fields; omitting 'repository' and 'text_matches' in particular drops the largest per-result data. (string[], optional)
198+
- `order`: Sort order for results (string, optional)
199+
- `page`: Page number for pagination (min 1) (number, optional)
200+
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
201+
- `query`: Search query (GitHub code search REST). Implicit AND between terms; supports `OR`, `NOT`, and `"quoted phrase"` for exact match. Qualifiers: `repo:owner/repo`, `org:`, `user:`, `language:`, `path:dir` (prefix match), `filename:exact.ext`, `extension:`, `in:file`, `in:path`, `size:`, `is:archived`, `is:fork`. Max 256 chars. Examples: `WithContext language:go org:github`; `"package main" repo:o/r`; `func extension:go path:cmd repo:o/r`; `NOT TODO language:go repo:o/r`. (string, required)
202+
- `sort`: Sort field ('indexed' only) (string, optional)
203+
204+
- **search_issues** - Search issues
205+
- **Required OAuth Scopes**: `repo`
206+
- `fields`: Subset of fields to return for each issue result. If omitted, all fields are returned. Use this to reduce response size when you only need specific fields; omitting 'body', 'reactions', and 'labels' in particular drops the largest per-result data. (string[], optional)
207+
- `order`: Sort order (string, optional)
208+
- `owner`: Optional repository owner. If provided with repo, only issues for this repository are listed. (string, optional)
209+
- `page`: Page number for pagination (min 1) (number, optional)
210+
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
211+
- `query`: Search query using GitHub issues search syntax (string, required)
212+
- `repo`: Optional repository name. If provided with owner, only issues for this repository are listed. (string, optional)
213+
- `sort`: Sort field by number of matches of categories, defaults to best match (string, optional)
214+
215+
- **search_pull_requests** - Search pull requests
216+
- **Required OAuth Scopes**: `repo`
217+
- `fields`: Subset of fields to return for each pull request result. If omitted, all fields are returned. Use this to reduce response size when you only need specific fields; omitting 'body', 'reactions', and 'labels' in particular drops the largest per-result data. (string[], optional)
218+
- `order`: Sort order (string, optional)
219+
- `owner`: Optional repository owner. If provided with repo, only pull requests for this repository are listed. (string, optional)
220+
- `page`: Page number for pagination (min 1) (number, optional)
221+
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
222+
- `query`: Search query using GitHub pull request search syntax (string, required)
223+
- `repo`: Optional repository name. If provided with owner, only pull requests for this repository are listed. (string, optional)
224+
- `sort`: Sort field by number of matches of categories, defaults to best match (string, optional)
225+
136226
<!-- END AUTOMATED INSIDERS TOOLS -->
137227

138228
---

pkg/github/feature_flags.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ var InsidersFeatureFlags = []string{
5555
FeatureFlagCSVOutput,
5656
FeatureFlagFileBlame,
5757
FeatureFlagIssueDependencies,
58+
FeatureFlagFieldsParam,
5859
}
5960

6061
// FeatureFlags defines runtime feature toggles that adjust tool behavior.

pkg/github/feature_flags_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,28 @@ func TestResolveFeatureFlags(t *testing.T) {
155155
enabledFeatures: []string{MCPAppsFeatureFlag},
156156
expectedFlags: []string{MCPAppsFeatureFlag},
157157
},
158+
{
159+
name: "fields param is not enabled by default",
160+
enabledFeatures: nil,
161+
unexpectedFlags: []string{FeatureFlagFieldsParam},
162+
},
163+
{
164+
name: "fields param can be directly enabled",
165+
enabledFeatures: []string{FeatureFlagFieldsParam},
166+
expectedFlags: []string{FeatureFlagFieldsParam},
167+
},
158168
{
159169
name: "insiders mode enables insiders flags",
160170
enabledFeatures: nil,
161171
insidersMode: true,
162172
expectedFlags: InsidersFeatureFlags,
163173
},
174+
{
175+
name: "insiders mode enables fields param",
176+
enabledFeatures: nil,
177+
insidersMode: true,
178+
expectedFlags: []string{FeatureFlagFieldsParam},
179+
},
164180
{
165181
name: "insiders mode does not auto-enable ifc labels",
166182
enabledFeatures: nil,

0 commit comments

Comments
 (0)