Repository navigation
fix(s062): the MCP plug's authorize hook is a remote capture, so the release compiles - #62
Merged
Merged
Conversation
…release compiles Plug.Builder calls init/1 at compile time under MIX_ENV=prod and escapes what it returns into the endpoint; 062 had passed an anonymous function, which cannot be escaped, and all three package legs failed to compile at the slice/062 tag (run 35786247006). The gate runs in :test, where init/1 is called per request, so it was green over it. The regression test runs Macro.escape/1 over Plug.init([]) and was demonstrated red against the closure. Signed-off-by: Ayla Croft <aylacroft@proton.me>
Signed-off-by: Ayla Croft <aylacroft@proton.me>
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.
The
slice/062tag fired thepackageworkflow for the first time over slice 062, and all threelegs failed to compile the release (run 35786247006, linux / macOS / windows, one cause):
Plug.Buildercalls a plug'sinit/1at compile time whenMIX_ENV=prodand escapes the resultinto the compiled endpoint. Slice 062 replaced 061's
authorize: &Auth.Local.authorize/1with ananonymous function closing over the process-dictionary key; a closure cannot be escaped. The hook is
now
&__MODULE__.authorized/1, a public function with the same body and a typespec.Nothing about the authorization behaviour changes:
call/2still authorizes before the transportruns and the hook is still the transport's second look at what it decided.
test/trinity/mcp/server_test.exs, "every option the plug's init returns can beescaped, as a compile-time init must be" — it runs
Macro.escape/1overPlug.init([]), thecompile-time step that failed, and was demonstrated red against the closure with the same message
CI printed.
MIX_ENV=prod mix compileexits 0 on this branch and exits 1 onmainat9859fbe.corrections; neither is rewritten and the tag is not moved.
Follow-up for the owner, in NOTES: nothing in
mix gateor the push-triggered CI compiles:prod, andpackage.ymltriggers on tags only, so this class of defect is invisible until afterapproval. Either a
MIX_ENV=prod mix compilestep in the gate or abranches:trigger onpackage.ymlwould close it; that is the gate's contract and every slice's, so it is not changedhere.