You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+76Lines changed: 76 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -586,6 +586,7 @@ The following sets of tools are available:
586
586
| <picture><sourcemedia="(prefers-color-scheme: dark)"srcset="pkg/octicons/icons/comment-discussion-dark.png"><sourcemedia="(prefers-color-scheme: light)"srcset="pkg/octicons/icons/comment-discussion-light.png"><imgsrc="pkg/octicons/icons/comment-discussion-light.png"width="20"height="20"alt="comment-discussion"></picture> |`discussions`| GitHub Discussions related tools |
587
587
| <picture><sourcemedia="(prefers-color-scheme: dark)"srcset="pkg/octicons/icons/logo-gist-dark.png"><sourcemedia="(prefers-color-scheme: light)"srcset="pkg/octicons/icons/logo-gist-light.png"><imgsrc="pkg/octicons/icons/logo-gist-light.png"width="20"height="20"alt="logo-gist"></picture> |`gists`| GitHub Gist related tools |
588
588
| <picture><sourcemedia="(prefers-color-scheme: dark)"srcset="pkg/octicons/icons/git-branch-dark.png"><sourcemedia="(prefers-color-scheme: light)"srcset="pkg/octicons/icons/git-branch-light.png"><imgsrc="pkg/octicons/icons/git-branch-light.png"width="20"height="20"alt="git-branch"></picture> |`git`| GitHub Git API related tools for low-level Git operations |
589
+
| <picture><sourcemedia="(prefers-color-scheme: dark)"srcset="pkg/octicons/icons/law-dark.png"><sourcemedia="(prefers-color-scheme: light)"srcset="pkg/octicons/icons/law-light.png"><imgsrc="pkg/octicons/icons/law-light.png"width="20"height="20"alt="law"></picture> |`governance`| Repository governance tools for managing rulesets and custom properties at the repository, organization, and enterprise levels |
589
590
| <picture><sourcemedia="(prefers-color-scheme: dark)"srcset="pkg/octicons/icons/issue-opened-dark.png"><sourcemedia="(prefers-color-scheme: light)"srcset="pkg/octicons/icons/issue-opened-light.png"><imgsrc="pkg/octicons/icons/issue-opened-light.png"width="20"height="20"alt="issue-opened"></picture> |`issues`| GitHub Issues related tools |
590
591
| <picture><sourcemedia="(prefers-color-scheme: dark)"srcset="pkg/octicons/icons/tag-dark.png"><sourcemedia="(prefers-color-scheme: light)"srcset="pkg/octicons/icons/tag-light.png"><imgsrc="pkg/octicons/icons/tag-light.png"width="20"height="20"alt="tag"></picture> |`labels`| GitHub Labels related tools |
591
592
| <picture><sourcemedia="(prefers-color-scheme: dark)"srcset="pkg/octicons/icons/bell-dark.png"><sourcemedia="(prefers-color-scheme: light)"srcset="pkg/octicons/icons/bell-light.png"><imgsrc="pkg/octicons/icons/bell-light.png"width="20"height="20"alt="bell"></picture> |`notifications`| GitHub Notifications related tools |
@@ -872,6 +873,81 @@ The following sets of tools are available:
-`bypass_actors`: The actors that can bypass the rules in this ruleset (object[], optional)
881
+
-`conditions`: Conditions for when this ruleset applies, e.g. {"ref_name": {"include": ["refs/heads/main"], "exclude": []}} (object, optional)
882
+
-`enforcement`: The enforcement level of the ruleset. 'evaluate' allows admins to test rules before enforcing them (string, required)
883
+
-`enterprise`: Enterprise slug. Required when level is 'enterprise'. (string, optional)
884
+
-`level`: The level at which the ruleset is configured:
885
+
- 'repository': A ruleset on a single repository (requires 'owner' and 'repo').
886
+
- 'organization': A ruleset covering repositories in an organization (requires 'org').
887
+
- 'enterprise': A ruleset covering repositories across an enterprise (requires 'enterprise'). (string, required)
888
+
-`name`: The name of the ruleset (string, required)
889
+
-`org`: Organization name. Required when level is 'organization'. (string, optional)
890
+
-`owner`: Repository owner. Required when level is 'repository'. (string, optional)
891
+
-`repo`: Repository name. Required when level is 'repository'. (string, optional)
892
+
-`rules`: An array of rules within the ruleset. Each rule is an object with a 'type' (e.g. 'creation', 'deletion', 'non_fast_forward', 'required_signatures', 'pull_request', 'required_status_checks') and, for rules that need configuration, a 'parameters' object (object[], required)
893
+
-`target`: The target of the ruleset. Defaults to 'branch'. 'repository' is only valid for 'organization' and 'enterprise' level rulesets. (string, optional)
-`enterprise`: Enterprise slug. Required when level is 'enterprise'. (string, optional)
909
+
-`level`: The level at which custom properties are managed:
910
+
- 'repository': The custom property VALUES assigned to a repository (requires 'owner' and 'repo').
911
+
- 'organization': The custom property DEFINITIONS (schema) for an organization (requires 'org').
912
+
- 'enterprise': The custom property DEFINITIONS (schema) for an enterprise (requires 'enterprise'). (string, required)
913
+
-`org`: Organization name. Required when level is 'organization'. (string, optional)
914
+
-`owner`: Repository owner. Required when level is 'repository'. (string, optional)
915
+
-`properties`: The custom properties to create or update. At the repository level each item assigns a value ('property_name' and 'value'); at the organization and enterprise levels each item defines the schema ('property_name' and 'value_type', plus optional definition fields). (object[], required)
916
+
-`repo`: Repository name. Required when level is 'repository'. (string, optional)
-`actor_name`: The handle for the GitHub user account to filter rule suites on. Used by the 'list_rule_suites' method. (string, optional)
921
+
-`branch`: Branch name. Required for the 'get_rules_for_branch' method. (string, optional)
922
+
-`enterprise`: Enterprise slug. Required when level is 'enterprise'. (string, optional)
923
+
-`evaluate_status`: Filter rule suites by ruleset evaluation mode. Used by the 'list_rule_suites' method. (string, optional)
924
+
-`includes_parents`: Include rulesets configured at higher levels that also apply. Defaults to true. Used by the 'get' and 'list' methods at the repository level. (boolean, optional)
925
+
-`level`: The level at which the ruleset is configured:
926
+
- 'repository': A ruleset on a single repository (requires 'owner' and 'repo').
927
+
- 'organization': A ruleset covering repositories in an organization (requires 'org').
928
+
- 'enterprise': A ruleset covering repositories across an enterprise (requires 'enterprise'). (string, required)
929
+
-`method`: Operation to perform:
930
+
- 'get': Get a specific ruleset by ID (requires 'ruleset_id'). Supported at every level.
931
+
- 'list': List all rulesets. Supported at every level.
932
+
- 'get_rules_for_branch': Get all rules that apply to a branch (requires 'branch'). Repository level only.
933
+
- 'list_rule_suites': List rule suites, the evaluations of rules against pushes. Repository and organization levels only.
934
+
- 'get_rule_suite': Get a specific rule suite by ID (requires 'rule_suite_id'). Repository and organization levels only. (string, required)
935
+
-`org`: Organization name. Required when level is 'organization'. (string, optional)
936
+
-`owner`: Repository owner. Required when level is 'repository'. (string, optional)
937
+
-`page`: Page number for pagination (min 1) (number, optional)
938
+
-`perPage`: Results per page for pagination (min 1, max 100) (number, optional)
939
+
-`ref`: The name of the ref (branch, tag, etc.) to filter rule suites by. Used by the 'list_rule_suites' method. (string, optional)
940
+
-`repo`: Repository name. Required when level is 'repository'. (string, optional)
941
+
-`repository_name`: Repository name to filter rule suites by. Used by the 'list_rule_suites' method at the organization level. (string, optional)
942
+
-`rule_suite_id`: Rule suite ID. Required for the 'get_rule_suite' method. (number, optional)
943
+
-`rule_suite_result`: The rule suite result to filter by. Used by the 'list_rule_suites' method. (string, optional)
944
+
-`ruleset_id`: Ruleset ID. Required for the 'get' method. (number, optional)
945
+
-`time_period`: The time period to filter rule suites by. Used by the 'list_rule_suites' method. (string, optional)
Copy file name to clipboardExpand all lines: docs/insiders-features.md
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -207,6 +207,11 @@ Insiders is a **meta feature flag** — the same shape as `default` or `all` for
207
207
3.**Insiders expansion.** If insiders mode is on (`--insiders`, `/insiders` route, or `X-MCP-Insiders: true`), every flag in [`InsidersFeatureFlags`](../pkg/github/feature_flags.go) is unioned in. The insiders expansion is **not** re-validated against the allowlist — insiders is a server-controlled switch that can reach internal-only flags.
208
208
4.**Server-side fallback (remote server only).** Any flag not yet decided falls back to the remote server's feature manager, which can roll a feature out independently of user input or insiders membership.
209
209
210
+
For tool availability, functional rules declare the flags they may read and are
211
+
evaluated lazily after request narrowing. Short-circuiting skips unnecessary
212
+
checks, and request-owned state memoizes each flag that is reached. The same
213
+
state backs `deps.IsFeatureEnabled`.
214
+
210
215
`AllowedFeatureFlags` and `InsidersFeatureFlags` are deliberately independent sets:
211
216
212
217
- A flag in **`AllowedFeatureFlags` only** is a regular opt-in: users can turn it on, but insiders does not auto-enable it. Granular issues/PRs flags work this way.
@@ -219,5 +224,6 @@ Insiders is a **meta feature flag** — the same shape as `default` or `all` for
219
224
2. Add it to `AllowedFeatureFlags` if end users should be able to opt in via
220
225
`--features`, `X-MCP-Features`, or the `features` URL query parameter.
221
226
3. Add it to `InsidersFeatureFlags` if insiders mode should turn it on automatically.
222
-
4. Gate the behavior on the concrete flag (`deps.IsFeatureEnabled(ctx, FeatureFlagX)`), never on `cfg.InsidersMode`. There is a `TestGitHubPackageDoesNotReadInsidersMode` guard test that fails if `pkg/github` reads `InsidersMode` directly.
223
-
5. The MCP-diff CI workflow picks up new entries in `AllowedFeatureFlags` automatically — see `.github/workflows/mcp-diff.yml`.
227
+
4. For tool availability, attach an `inventory.NewFeatureRule` that declares every flag used by its predicate. For behavior inside a handler, use `deps.IsFeatureEnabled(ctx, FeatureFlagX)`.
228
+
5. Gate on concrete flags, never on `cfg.InsidersMode`. There is a `TestGitHubPackageDoesNotReadInsidersMode` guard test that fails if `pkg/github` reads `InsidersMode` directly.
229
+
6. The MCP-diff CI workflow picks up new entries in `AllowedFeatureFlags` automatically — see `.github/workflows/mcp-diff.yml`.
0 commit comments