test(site/src/api): expect v2 MCP ACL path by jakehwll · Pull Request #28657 · coder/coder · GitHub
Skip to content

test(site/src/api): expect v2 MCP ACL path - #28657

Merged
jakehwll merged 1 commit into
mainfrom
jakehwll/fix-mcp-acl-test
Aug 26, 2026
Merged

test(site/src/api): expect v2 MCP ACL path#28657
jakehwll merged 1 commit into
mainfrom
jakehwll/fix-mcp-acl-test

Conversation

@jakehwll

Copy link
Copy Markdown
Contributor

🤖 This PR was written by Coder Agents on behalf of Jake Howell.

The MCP server ACL client uses the promoted /api/v2 route, but its path assertion still expected the experimental compatibility route.

Update the assertion to match the v2 endpoint and restore the JavaScript test suite.

@jakehwll
jakehwll marked this pull request as ready for review August 26, 2026 18:42
@jakehwll
jakehwll enabled auto-merge (squash) August 26, 2026 18:43
@jakehwll
jakehwll disabled auto-merge August 26, 2026 18:43
@jakehwll
jakehwll enabled auto-merge (squash) August 26, 2026 18:45
@jakehwll
jakehwll merged commit 20ca63d into main Aug 26, 2026
53 of 54 checks passed
@jakehwll
jakehwll deleted the jakehwll/fix-mcp-acl-test branch August 26, 2026 18:51
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 26, 2026
ibetitsmike added a commit that referenced this pull request Aug 26, 2026
…ths (#28659)

~~test-js is failing on main~~ Main is fixed: #28657 landed the same
`api.test.ts` expectation update, so this PR no longer unbreaks anything
and is not urgent.

What remains here is the other half of the original fix:
`site/src/testHelpers/handlers.ts` still registers the MCP server ACL
GET/PATCH msw handlers at `/api/experimental/...`, but since #28498 the
client calls `/api/v2/...`, so those handlers can never intercept a
request. Any future test or story that exercises the ACL endpoints
through the shared msw handlers would hit an unhandled-request error
instead of the mock. This points them at the v2 paths the client
actually uses.

Validation: `pnpm exec vitest run --project=unit src/api/api.test.ts`
passes 43/43 on this branch (merged with current main).

> Xum acted on Mike's behalf.
<!-- xum-attribution: model=claude-fable-5 thinking=high -->
ibetitsmike added a commit that referenced this pull request Aug 27, 2026
…ths (#28659)

~~test-js is failing on main~~ Main is fixed: #28657 landed the same
`api.test.ts` expectation update, so this PR no longer unbreaks anything
and is not urgent.

What remains here is the other half of the original fix:
`site/src/testHelpers/handlers.ts` still registers the MCP server ACL
GET/PATCH msw handlers at `/api/experimental/...`, but since #28498 the
client calls `/api/v2/...`, so those handlers can never intercept a
request. Any future test or story that exercises the ACL endpoints
through the shared msw handlers would hit an unhandled-request error
instead of the mock. This points them at the v2 paths the client
actually uses.

Validation: `pnpm exec vitest run --project=unit src/api/api.test.ts`
passes 43/43 on this branch (merged with current main).

> Xum acted on Mike's behalf.
<!-- xum-attribution: model=claude-fable-5 thinking=high -->

(cherry picked from commit 78d0571)
ibetitsmike added a commit that referenced this pull request Aug 27, 2026
…ths (#28659)

~~test-js is failing on main~~ Main is fixed: #28657 landed the same
`api.test.ts` expectation update, so this PR no longer unbreaks anything
and is not urgent.

What remains here is the other half of the original fix:
`site/src/testHelpers/handlers.ts` still registers the MCP server ACL
GET/PATCH msw handlers at `/api/experimental/...`, but since #28498 the
client calls `/api/v2/...`, so those handlers can never intercept a
request. Any future test or story that exercises the ACL endpoints
through the shared msw handlers would hit an unhandled-request error
instead of the mock. This points them at the v2 paths the client
actually uses.

Validation: `pnpm exec vitest run --project=unit src/api/api.test.ts`
passes 43/43 on this branch (merged with current main).

> Xum acted on Mike's behalf.
<!-- xum-attribution: model=claude-fable-5 thinking=high -->

(cherry picked from commit 78d0571)
mtojek added a commit that referenced this pull request Aug 27, 2026
Batch backport of ibetitsmike's PRs that merged into `main` after the
`release/2.37` branch was cut (merge-base `c275327fb72`, 2026-08-24).

## Included (9 cherry-picks, in order)

| PR | Title |
|----|-------|
| #28470 | fix(coderd/x): surface Gemini malformed-function-call stream
deaths as retryable errors |
| #28471 | fix: apply MCP server selection when editing a chat message |
| #28460 | refactor: consolidate viewport hooks and remove
defineProperty matchMedia stub |
| #28476 | feat(coderd/x/chatd/chattool): improve find_tools relevance
and model guidance |
| #28400 | fix(coderd/x/chatd/mcpclient): enforce MCP connect budget and
unblock session cleanup |
| #28589 | fix(coderd/x/chatd): truncate overlong generated chat titles
instead of rejecting them |
| #28496 | feat: mount chat API routes under /api/v2 |
| #28497 | feat: promote codersdk chat API methods to Client |
| #28498 | feat(site): use /api/v2 chat API paths |

All picks applied cleanly with `git cherry-pick -x` onto `release/2.37`.

## Excluded and follow-up backports

The remaining post-cut PRs are cherry-picked onto this PR as a GitHub
stack (#28692) that merges bottom-up, so the dependency order is
enforced by the PR bases:

| Stack order | Original PR | Backport PR | Notes |
|-------------|-------------|-------------|-------|
| 1 | #28462 (repair failing Storybook stories) | #28687 | One fixture
adaptation: 2.37's `OrganizationModelsContextValue` has no
`organizations` field |
| 2 | #28186 (enable Coder Agents for organization members) | #28688 |
One story-assertion conflict resolved to the picked regex; ships no
migration by design |
| 3 | #28593 (allow sharing MCP servers with users and groups) | #28686
| Clean pick on top of #28688, plus the 1-line test fix #28657 (expect
v2 MCP ACL path) |
| 4 | #28659 (point MCP server ACL msw handlers at v2 paths) | #28689 |
Clean pick on top of #28686 |

Intentionally skipped: #28587 (restore agents-access cleanup migration).
Release branches cannot take a migration unless its sequence number
matches main with no gap.

## Validation

- `go build ./...` and test-binary compilation for `./coderd/...
./codersdk/... ./enterprise/... ./site` pass
- `pnpm check` and `pnpm lint:types` pass
- Targeted Vitest on all touched test files: unit 281/281 pass;
Storybook 180/181 pass. The single failure (`AgentChatPage.stories.tsx`
> Queued For Capacity After Polling) reproduces identically on the
untouched `release/2.37` baseline, so it is pre-existing and unrelated.

> Xum acted on Mike's behalf.
<!-- xum-attribution: model=claude-fable-5 thinking=high -->
mtojek pushed a commit that referenced this pull request Aug 27, 2026
…ths (#28659)

~~test-js is failing on main~~ Main is fixed: #28657 landed the same
`api.test.ts` expectation update, so this PR no longer unbreaks anything
and is not urgent.

What remains here is the other half of the original fix:
`site/src/testHelpers/handlers.ts` still registers the MCP server ACL
GET/PATCH msw handlers at `/api/experimental/...`, but since #28498 the
client calls `/api/v2/...`, so those handlers can never intercept a
request. Any future test or story that exercises the ACL endpoints
through the shared msw handlers would hit an unhandled-request error
instead of the mock. This points them at the v2 paths the client
actually uses.

Validation: `pnpm exec vitest run --project=unit src/api/api.test.ts`
passes 43/43 on this branch (merged with current main).

> Xum acted on Mike's behalf.
<!-- xum-attribution: model=claude-fable-5 thinking=high -->

(cherry picked from commit 78d0571)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants