Skip to content

feat(governance): add custom properties tools - #2992

Open
SamMorrowDrums wants to merge 2 commits into
sammorrowdrums-governance-rulesetsfrom
sammorrowdrums-add-rulesets-custom-properties
Open

feat(governance): add custom properties tools#2992
SamMorrowDrums wants to merge 2 commits into
sammorrowdrums-governance-rulesetsfrom
sammorrowdrums-add-rulesets-custom-properties

Conversation

@SamMorrowDrums

Copy link
Copy Markdown
Collaborator

Governance toolset — Custom Properties (PR 2 of 2)

Adds the second half of the governance toolset: GitHub custom properties (get/set) at the repository, organization, and enterprise levels.

This supersedes the very stale #821 (re: #820), replayed onto the current codebase (modelcontextprotocol/go-sdk, go-github v87).

Stacked on #2991 — review that one first. This PR is based on the sammorrowdrums-governance-rulesets branch, so its diff shows only the custom-properties changes. It will retarget to main automatically once #2991 merges.

Tools (6)

Tool Level Required scope Read-only
get_repository_custom_properties repo repo
get_organization_custom_properties org read:org
get_enterprise_custom_properties enterprise read:enterprise
create_or_update_repository_custom_properties repo repo
create_or_update_organization_custom_properties org admin:org
create_or_update_enterprise_custom_properties enterprise admin:enterprise

Design notes

Verified: script/lint (0 issues), script/test, script/generate-docs all green.

SamMorrowDrums and others added 2 commits August 1, 2026 00:21
Add a new non-default "governance" toolset (icon: law) with tools for
managing GitHub repository rulesets at the repository, organization, and
enterprise levels.

Read operations are consolidated behind method-dispatch tools to match the
current MCP surface:
- repository_ruleset_read (get, list, get_rules_for_branch, list_rule_suites,
  get_rule_suite)
- organization_repository_ruleset_read (get, list)

Write operations remain single-purpose tools, split by level because each
level requires a distinct OAuth scope for scope-challenge accuracy:
- create_repository_ruleset (repo)
- create_organization_repository_ruleset (admin:org)
- create_enterprise_repository_ruleset (admin:enterprise)

Adds the read:enterprise and admin:enterprise scopes and the law octicon as
shared governance infrastructure.

Supersedes #821.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 1e886867-a922-419a-b02c-ac643716aea8
Add tools for reading and setting GitHub custom property values at the
repository, organization, and enterprise levels within the governance
toolset.

Read and write are separate tools (ReadOnlyHint drives read-only-mode
filtering) and split by level because each level requires a distinct OAuth
scope for scope-challenge accuracy:
- get_repository_custom_properties (repo)
- create_or_update_repository_custom_properties (repo)
- get_organization_custom_properties (read:org)
- create_or_update_organization_custom_properties (admin:org)
- get_enterprise_custom_properties (read:enterprise)
- create_or_update_enterprise_custom_properties (admin:enterprise)

Supersedes #821.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 1e886867-a922-419a-b02c-ac643716aea8

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds six custom-property tools to the governance toolset for repository values and organization/enterprise definitions.

Changes:

  • Adds read and write handlers with level-specific scopes.
  • Adds unit tests and tool-schema snapshots.
  • Updates generated governance documentation.
Show a summary per file
File Description
README.md Documents the new tools.
pkg/github/tools.go Registers tools and updates metadata.
pkg/github/custom_properties.go Implements custom-property tools and schemas.
pkg/github/custom_properties_test.go Tests handlers and schemas.
pkg/github/__toolsnaps__/get_repository_custom_properties.snap Snapshots repository read schema.
pkg/github/__toolsnaps__/get_organization_custom_properties.snap Snapshots organization read schema.
pkg/github/__toolsnaps__/get_enterprise_custom_properties.snap Snapshots enterprise read schema.
pkg/github/__toolsnaps__/create_or_update_repository_custom_properties.snap Snapshots repository write schema.
pkg/github/__toolsnaps__/create_or_update_organization_custom_properties.snap Snapshots organization write schema.
pkg/github/__toolsnaps__/create_or_update_enterprise_custom_properties.snap Snapshots enterprise write schema.
docs/remote-server.md Updates remote governance documentation.

Review details

  • Files reviewed: 11/11 changed files
  • Comments generated: 2
  • Review effort level: Balanced

Comment on lines +341 to +345
"value": {
Description: "The value to assign. A string, an array of strings, or null to clear the value",
},
},
Required: []string{"property_name"},
Comment on lines +368 to +370
"default_value": {
Description: "Default value of the property. A string or an array of strings",
},
@SamMorrowDrums
SamMorrowDrums force-pushed the sammorrowdrums-governance-rulesets branch from 53de049 to f340ea4 Compare August 25, 2026 14:44
@SamMorrowDrums

Copy link
Copy Markdown
Collaborator Author

👋 Heads up: #2991 (this PR's base) was rebased onto current main and redesigned around #3128's per-call OAuth scope checks — it now consolidates the 5 level-specific ruleset tools down to 2 (repository_ruleset_read, create_repository_ruleset), each taking a level argument (repository/organization/enterprise) and using scopes.DynamicChallenge to return the exact scope for that call instead of splitting tools by level.

This PR's custom-properties functionality is not superseded by that change — it's a separate API surface and remains a valid follow-on layer. Two things to do before it can merge cleanly though:

  1. Rebase this branch onto the updated sammorrowdrums-governance-rulesets (its history was rewritten, so this PR currently shows as conflicting).
  2. Consider applying the same per-level consolidation pattern here for consistency — e.g. a single get_custom_properties / create_or_update_custom_properties pair with a level argument and a DynamicChallenge-based scope check, rather than the current 6 single-scope tools split by level. Not required, but would match the direction the toolset is heading in.

Leaving this open since the functionality itself is still needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants