Repository navigation
Conversation
A failed call fails with its own error: in the engine's function error file (DAGGER_FUNCTION_ERROR_PATH, dagger/dagger#15249), with the values of the API error it was raised from, and a short trace of the module's own frames in its logs, in Ruby's own form; nothing for an API error whose origin the engine shows. On an older engine, Ruby's full trace and a ::dagger-function-error:: marker line, which the generated entrypoint raises. The entrypoint now marks its function's exec, and no other, with DAGGER_MODULE_CALL_DIGEST: without it, no exec was the module process, and the function's logs and errors rendered on the dispatcher's exec. It declares the gems' install as prebuild, so the engine builds it as the module's build. Signed-off-by: Alex Suraci <alex@dagger.io>
Address review: a stack overflow's short trace is shortened as Ruby's own printer shortens it; error_highlight's snippet is left out when the frame that raised is not the module's, which heads the trace instead; messages with invalid UTF-8 are scrubbed before any string operation; a module file that doesn't parse exits 1 again, as before, without the generate hint. Signed-off-by: Alex Suraci <alex@dagger.io>
vito
added a commit
to dagger/dagger
that referenced
this pull request
Nov 23, 2026
Pin ruby-sdk to dagger/ruby-sdk#11 (6ba32f1) and regenerate the fixture: its entrypoint marks the dispatcher's exec as the module process and declares prebuild, and the dispatcher reports a function's error in the engine's file, with a short trace of the module's own frames in Ruby's own form. Every sdks-ruby golden now matches its target, unchanged. Signed-off-by: Alex Suraci <alex@dagger.io>
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.
Depends on dagger/dagger#15249, which adds the engine's function error file (
DAGGER_FUNCTION_ERROR_PATH) and the golden tests this is checked against (dagql/idtui,sdks-ruby-*). The Ruby counterpart of dagger/go-sdk#113, dagger/python-sdk#93, dagger/typescript-sdk#144, dagger/java-sdk#47 and dagger/php-sdk#49. Keep this a draft until that lands.What users saw
The generated entrypoint declared
callDigestbut marked no exec with it, so on an engine with the module process marker no exec was the module process:withExec ruby -rbundler/setup sdk/exe/dagger-mod call …row, with its stdin,! exit code: 2, and the full stack trace throughDagger::Mod::Dispatch,CLIand the generated clients;Dagger::Mod::FunctionError, its message the wholefull_messageof the original;What changes
callsetsDAGGER_MODULE_CALL_DIGESTto itscallDigeston the dispatcher's exec, and on no other, after syncing the install: the install is the module's build, the dispatcher its process, which gets the module, the function's span and the error file. The digest no longer rides in the request.prebuild. The entrypoint declares it, a file of the installed container (Gemfile.lock), so the engine builds the gems' install ahead of the call, underbuild <module>.Dispatchno longer wraps what module code raises.dagger-mod callreports it (newDagger::Mod::ErrorReport) and exits 2 (1 when the module's code doesn't load, as before):DAGGER_FUNCTION_ERROR_PATH, it writes{"message", "values"}: the message whole, its[traceparent:…]origins kept, and the extensions of the first API error in the error's chain of causes, verbatim, so a caller gets a typedExecErrorwith its exit code and output. A report over the engine's 1 MiB is shortened (long strings keep their end, the message its start and origins, then the values go).call()raises the exec's error unchanged when it carries the engine'sfunctionError.path:line:in 'Class#method': message (Class),\tfromlines, causes after), through the module's own frames only: not the SDK's, the generatedclients/, the installed gems' or Ruby's library. A path gem the module uses outside its directory keeps its frames.[traceparent:…]is stripped. A stack overflow is shortened as Ruby shortens it (... N levels...); error_highlight's snippet stays only when the frame that raised is the module's.Dagger::Mod::Error), whose message the engine shows; thedagger generatehint still follows a stale call./src/lib/x.rb:86: syntax errors found), which names the file and the line.::dagger-function-error::<JSON string>line (cut to 16 KiB, origins kept), whichcall()raises as the function's error. Without a marker, as after anexit, it raises the exec's error.exitof the function's own ends the process with its status and reports nothing: the engine fails the call withexit code: N.Dagger::Mod::FunctionErroris gone: nothing raises it any more. README,AGENTS.md, the design note andCHANGELOG.mddescribe the new behavior.Testing
test/mod/error_report_test.rb, anddispatch_test.rb/entrypoint_test.rbcases: the report's message and values (native, API, wrapped, SDK errors, empty messages, invalid UTF-8, the 1 MiB trim), the short trace's frames, causes, stack-overflow shortening and error_highlight, SyntaxError, the marker fallback, the CLI's exit statuses with and without the file, and the rendered entrypoint (marker env on the dispatcher's exec only,prebuild, the rescue).dagger check -m .dagger/modules/e2e sdk-test-check sdk-lint-check sdk-types-checkpass; so doerror-check,missed-generation-check,entrypoint-client-call-check,function-cache-check,types-round-trip-checkandvendoring-check.TestTelemetry/TestGolden/sdks-ruby-*goldens (17, incl. log-success) all pass against this branch, pinned by SHA (6ba32f1) at a42d564 ofviztest-external-sdks. They were hand-written as targets before this branch existed, and pass unchanged.dagger generatewas run for the vendoredsdk/of the e2e harness and the entrypoint goldens; the core clients' drift from the generating engine's schema is left out.