Skip to content

test(mcpx/e2e): classify MCPX_ADAPTERS_ALLOW_BARE as harness-set (#13619) - #13653

Open
dezren39 wants to merge 2 commits into
mainfrom
fix/21424-mcpx-ci
Open

dezren39 wants to merge 2 commits into
mainfrom
fix/21424-mcpx-ci

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Problem

Main-branch CI workflow mcpx test (run 45227606720, sha 4518255) failed multiple legs on issue #13619.

Root causes

1. TestEveryRegistryVariableIsHarnessSetOrSafe (e2e shard 3, flake binary e2e legs, container e2e — one shared cause)

envguard_test.go:315: MCPX_ADAPTERS_ALLOW_BARE (adapters.allowBare) is in neither table

MCPX_ADAPTERS_ALLOW_BARE was declared in the settings registry and is genuinely set by the harness (TestAdaptersAllowBareGatesABareDeclaration uses e.setenv), but it was never added to harnessSetMCPX/safeMCPX. The guard is written to fail the day a setting is added without classification, which is exactly what happened. Every leg that runs internal/e2e hit it, so shard 3, the two flake-binary legs and the container leg are one failure, not four.

2. TestEveryDocumentationLinkResolves (unit job — independent, already fixed on main)

docs/glossary.md:71: `internal/api.Ops`

The glossary cited the operation table by Go symbol in backticks, which this test reads as a file path. Fixed on main by #13597 (5412831eebd, f0c6f2e0396) before this branch was cut; the narrow test passes here.

3. TestScriptCwdIsReachableFromTheEnvironment (flake-binary leg of the verification dispatch)

The test compared the last line of the combined stream against the script directory, but the shebang-dispatch notice is written to stderr and its position against the script's stdout is unordered. Run 45251429763 recorded the notice after the pwd, so the test compared "". Now it scans for a line that resolves to the script directory; a run left in the caller's directory still fails.

Change

  • Classify MCPX_ADAPTERS_ALLOW_BARE as harness-set, per the guard's own definition (the behaviour half TestTheHarnessBuildsChildrenFromTheAllowlist proves the inherit-nothing policy for every name in both tables).
  • Make the script.cwd probe order-independent.

Verification (files and commands, not claims)

  • go test ./internal/e2e -run '^TestEveryRegistryVariableIsHarnessSetOrSafe$' — fails before with exactly the message above, passes after.
  • go test ./internal/e2e -run '^TestAdaptersAllowBareGatesABareDeclaration$' — passes (29.6s).
  • The full CI-assigned shard-3 test pattern (104 tests at the failing run's seed 01a20972-…) — ok … 332.1s.
  • go test ./internal/e2e -run '^TestScriptCwdIsReachableFromTheEnvironment$' -count=20 — 20/20 pass.
  • go test ./internal/e2e -run '^TestTheHarnessBuildsChildrenFromTheAllowlist$' — passes.
  • go test ./internal/defaults/... — passes (doc-link fix present).
  • Dispatched workflow on the branch, run 45251429763: unit, lint, plugin-ts, remote smoke, all e2e shards, container e2e green; only the flake-binary script.cwd failure above. A re-dispatch after the second commit is run 45259861221.
  • gofmt -l — clean.

Open question recorded with a default

Whether the workflow should keep the doc-link unit test from regressing again is out of scope: main already carries the glossary correction. Default chosen: no extra CI wiring in this PR.

Part of #13619

The #1992 env guard (TestEveryRegistryVariableIsHarnessSetOrSafe) fails
on main: MCPX_ADAPTERS_ALLOW_BARE (setting adapters.allowBare) is
declared in the settings registry but classified in neither envguard
table. TestAdaptersAllowBareGatesABareDeclaration sets the variable with
e.setenv in internal/e2e/effect_test.go, so per the guard's own
definitions it belongs in harnessSetMCPX.

This broke e2e shard 3, the flake binary e2e legs and the container e2e
leg of the mcpx test workflow (run 45227606720).

Verified: the guard failed before this change with exactly this one
unclassified variable and passes after; the effect probe and the full
CI-assigned shard-3 pattern (104 tests) also pass.

Part of #13619
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 9 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: eea525ae-e3ef-4176-a8d9-a376936e5e68
Commits

Reviewing files that changed from the base of the PR and between ab82a4d and f6eed7c.

Files selected for processing: 2

  • pkgs/mcpx/internal/e2e/dispatch_settings_test.go
  • pkgs/mcpx/internal/e2e/envguard_test.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

TestScriptCwdIsReachableFromTheEnvironment took the last line of the
combined stream as the script's pwd. The dispatch notice ("running under
sh (shebang dispatch): ...") is written to stderr and its position
against the script's stdout is not ordered; in the flake-binary leg of
mcpx test run 45251429763 the notice came after the pwd, so the last
line was the notice and the test compared "" against the expected
directory.

Scan the output for a line that resolves to the script directory
instead, and fail when none does (a run that stayed in the caller's
directory therefore still fails). Verified: 20 consecutive local runs
pass; the failing ordering is the one recorded in the run log.

Part of #13619

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant