Repository navigation
refactor(mcp): unify workbench pagination defaults and ID formatting - #1186
Merged
kyasbal merged 5 commits intoOct 28, 2026
Merged
Conversation
Ackberry
requested review from
K53,
RyuSA,
jyane,
kkuchima,
kyasbal and
renamoo
as code owners
October 27, 2026 02:31
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors page size normalization by extracting the logic into a reusable NormalizePageSize function in pkg/server/mcp/mdtemplate/template.go and adding comprehensive unit tests for it. It updates the call sites in workbench_detail.go to use this new function. Additionally, it simplifies ID formatting in workbench_search.go by replacing strconv.FormatUint calls with a helper function formatID and removing the unused strconv import. There are no review comments to address.
kyasbal
requested changes
Oct 27, 2026
Member
|
/gcbrun |
kyasbal
enabled auto-merge
October 28, 2026 01:16
kyasbal
approved these changes
Oct 28, 2026
Merged
via the queue into
GoogleCloudPlatform:main
with commit Oct 28, 2026
0fb67fb
17 checks passed
This was referenced Oct 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This refactors the MCP workbench tools to share page-size handling and ID formatting without changing their output.
NormalizePageSizeand used it inPaginateandhandleGetResourceRevisions. Nonpositive sizes use the default, and positive maximums cap the result. A nonpositive maximum means no cap.formatIDfor log and timeline IDs in workbench search responses.Added table-driven tests covering defaulting, limits, and uncapped sizes.
Validation:
TestNormalizePageSizeandTestPaginatepass.dist/browser).Fixes #1125