feat(governance): add custom properties tools - #2992
Conversation
There was a problem hiding this comment.
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
| "value": { | ||
| Description: "The value to assign. A string, an array of strings, or null to clear the value", | ||
| }, | ||
| }, | ||
| Required: []string{"property_name"}, |
| "default_value": { | ||
| Description: "Default value of the property. A string or an array of strings", | ||
| }, |
53de049 to
f340ea4
Compare
|
👋 Heads up: #2991 (this PR's base) was rebased onto current 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:
Leaving this open since the functionality itself is still needed. |
8e78920 to
fe0ece5
Compare
…challenge Add custom properties support to the non-default governance toolset, completing the second half of the rulesets + custom properties work requested in #820. Rather than porting the original six single-level tools verbatim, this consolidates them into two level-parameterized tools: - custom_properties_read (level: repository | organization | enterprise) - custom_properties_write (level: repository | organization | enterprise) The `level` argument dispatches to the correct GitHub API. Repository level reads and writes property VALUES (property_name + value), while organization and enterprise levels read and write property DEFINITIONS/schema (value_type, required, allowed_values, default_value, description, values_editable_by). This distinction is documented in the tool and field descriptions. Both tools reuse the shared governanceReadScopeAccess/governanceWriteScopeAccess helpers (renamed from the ruleset-specific names) so rulesets and custom properties present one consistent, exhaustive scope-challenge policy that up-scopes based on the requested level. Co-authored-by: Patrick Knight <patrick-knight@github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1e886867-a922-419a-b02c-ac643716aea8
b912101 to
484991c
Compare
Governance toolset — Custom Properties (PR 2 of 2)
Adds the second half of the non-default
governancetoolset: GitHub custom properties at the repository, organization, and enterprise levels.Supersedes the very stale #821 (re: #820), replayed onto the current codebase (modelcontextprotocol/go-sdk, go-github v89) and consolidated to fit today's tool surface.
Tools (2)
Rather than porting #821's six single-level tools verbatim, this consolidates them into two
level-parameterized tools, mirroring the ruleset tools in #2991:levelvaluescustom_properties_readrepository/organization/enterprisecustom_properties_writerepository/organization/enterpriseValues vs. definitions
The
levelargument dispatches to the correct GitHub API, and the semantics differ by level (documented in the tool + field descriptions):repositoryreads/writes property values (property_name+value) — this is the inventory-ID / cost-centre source-of-truth use case customers asked for.organization/enterpriseread/write property definitions / schema (value_type,required,allowed_values,default_value,description,values_editable_by).Scope challenge
Both tools reuse the shared
governanceReadScopeAccess/governanceWriteScopeAccesshelpers introduced in #2991 (renamed from the ruleset-specific names). They use aDynamicChallengekeyed onlevel, so a repository-level call needs only repo scope and org/enterprise calls up-scope from there — one consistent, exhaustive policy across both rulesets and custom properties.Size
+812 / −20 across 9 files (363 lines of tool logic, 262 of tests, plus toolsnaps + regenerated README).
Verified:
script/lint(0 issues),script/test(race),script/generate-docsall green.Co-authored with @patrick-knight, original author of #821.