Skip to content

fix: hide write UI resources in read-only mode#2612

Merged
SamMorrowDrums merged 2 commits into
github:mainfrom
he-yufeng:fix/read-only-ui-resources-v2
Jun 11, 2026
Merged

fix: hide write UI resources in read-only mode#2612
SamMorrowDrums merged 2 commits into
github:mainfrom
he-yufeng:fix/read-only-ui-resources-v2

Conversation

@he-yufeng

Copy link
Copy Markdown
Contributor

Summary

  • hide the issue/pr write UI resources when the server runs in read-only mode
  • keep the read-only-safe get_me UI resource registered
  • add a regression test for the resource list returned by RegisterUIResources in read-only mode

Fixes #2519.

To verify

  • go test ./pkg/github -run "Test(RegisterUIResources|NewMCPServer_RegistersUIResources)" -count=1
  • git diff --check origin/main...HEAD
@he-yufeng he-yufeng requested a review from a team as a code owner June 5, 2026 16:02
@advancedresearcharray

Copy link
Copy Markdown

Rebased this branch onto current main and validated locally.

Rebased commit: b5e2b7b (based on latest github/github-mcp-server main)

Validation (Go 1.25):

  • go test ./pkg/github -run "Test(RegisterUIResources|NewMCPServer_RegistersUIResources)" -count=1 — pass (TestRegisterUIResources_ReadOnlySkipsWriteResources; UI-asset tests skip without script/build-ui)
  • go test ./... -count=1 — pass
  • git diff --check upstream/main...HEAD — clean

To update this PR branch:

git fetch https://github.com/advancedresearcharray/github-mcp-server.git fix/read-only-ui-resources-v2
git checkout fix/read-only-ui-resources-v2
git reset --hard FETCH_HEAD
git push --force-with-lease origin fix/read-only-ui-resources-v2

This should trigger CI on the PR. The branch is currently mergeable with main; only maintainer review is blocking.

Note: #2581 is an older duplicate of the same fix and is behind main — consider closing it in favor of this PR.

@SamMorrowDrums SamMorrowDrums left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you for this! Much appreciated. 🙏

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

Labels

None yet

3 participants