Public: anyone can read this; the crew can change it.

MCP `backups_test`: check that the snapshot destination is reachable, as the Backups page's Test button does, for a forge admin #5451

Parked opened this
Closed without merging

This pull adds the backupstest MCP tool; this push only merges current main into the branch and changes none of the tool's code. The earlier check failed on test/system-stream.test.ts ("the sampler's clock runs only while someone watches…"), which this pull doesn't touch.

Notes

stopped parked by the crew deploy 498e20c

opened this

This pull adds the backups_test MCP tool; this push only merges current main into the branch and changes none of the tool's code. The earlier check failed on test/system-stream.test.ts ("the sampler's clock runs only while someone watches…"), which this pull doesn't touch. That test passes here after the merge, along with test/mcp.test.ts, test/mcp-docs.test.ts and test/mcp-size.test.ts. I treated that failure as a flake rather than a fault in the tool. The forge's check on this push will show whether it recurs.

What the tool does

  • Fields: backups_test takes the Backups form's fields (endpoint, bucket, region, accessKey, secretKey).
  • Call and answer: it calls testDestination and answers { reached, says }, where says is the action's own sentence. It never echoes a credential.
  • Admin only: a non-admin gets the page's Not found.
  • Write marking: it is marked as a write in tools/list, with one row in docs/MCP.md.

What to look at

  • Description cuts: test/mcp-size.test.ts has a hard 37,000-byte headroom, and the new tool put tools/list about 300 bytes over it. I did not raise the ceiling. I shortened about 25 other tool descriptions in src/http/mcp.ts by a few words each, with no behaviour change.
  • test/mcp-backups-test.test.ts: it holds the three cases (reached, unreachable with a reason, non-admin refused). The reached case uses a loopback fake bucket, which my sandbox blocks, so it only runs in the forge's check.
  • Local directory: testDestination only knows S3 targets, so "local" in the issue means a loopback S3 endpoint, not a directory path.

Closes #5428

2 earlier comments
commented

This pull adds the backups_test MCP tool; this push only merges current main into the branch and changes none of the tool's code. The earlier check failed on test/system-stream.test.ts ("the sampler's clock runs only while someone watches…"), which this pull doesn't touch. That test passes here after the merge, along with test/mcp.test.ts, test/mcp-docs.test.ts and test/mcp-size.test.ts. I treated that failure as a flake rather than a fault in the tool. The forge's check on this push will show whether it recurs.

What the tool does

  • Fields: backups_test takes the Backups form's fields (endpoint, bucket, region, accessKey, secretKey).
  • Call and answer: it calls testDestination and answers { reached, says }, where says is the action's own sentence. It never echoes a credential.
  • Admin only: a non-admin gets the page's Not found.
  • Write marking: it is marked as a write in tools/list, with one row in docs/MCP.md.

What to look at

  • Description cuts: test/mcp-size.test.ts has a hard 37,000-byte headroom, and the new tool put tools/list about 300 bytes over it. I did not raise the ceiling. I shortened about 25 other tool descriptions in src/http/mcp.ts by a few words each, with no behaviour change.
  • test/mcp-backups-test.test.ts: it holds the three cases (reached, unreachable with a reason, non-admin refused). The reached case uses a loopback fake bucket, which my sandbox blocks, so it only runs in the forge's check.
  • Local directory: testDestination only knows S3 targets, so "local" in the issue means a loopback S3 endpoint, not a directory path.
commented

The "reached" test was failing because of the proxy variables in the check's environment, not because of the tool. All three tests in test/mcp-backups-test.test.ts now pass here, including the reached case, but I haven't seen the forge's check run on this push.

The cause: Bun's S3 client sends even loopback requests through HTTP(S)_PROXY, and it reads those variables at process start. In the check's environment the fake bucket on 127.0.0.1 was therefore unreachable. I reproduced this with a standalone script. It fails with a proxy set and answers correctly without one. The same thing blocked it in my sandbox earlier.

The fix: the reached case now runs in a child bun test process with every proxy variable removed. The parent test (a local destination is reached (in a process without a proxy)) spawns that child and asserts it passed. The tool and its description are unchanged.

Still open: the test now spawns a bun subprocess, which is more machinery than the other MCP tests use. The only alternative I found was mocking the S3 test function, which would stop the test exercising the real S3 path. Say if you'd rather have that.

The earlier check on #5437 failed on the /system stream test, which this pull doesn't touch. The 2035176a push only merged main, and that test passed here afterwards.

commented

Parked by the crew: the check failed ("muting a repository's asks > MCP asks applies the saved filter, and takes the same filter as arguments") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs