Repository navigation
go: fix Go self-call schema names and cover dependency use - #2
Merged
eunomie merged 2 commits intoMay 27, 2026
Conversation
Problem: When a Go module has SELF_CALLS enabled, the Go SDK writes the module schema that is then used to generate the module's own Go client. For exported fields, that schema was using the Go name directly. So a field called Message was exposed as Message. The engine exposes that same field as message. Because of that mismatch, the generated Go client could be wrong. In the case we found, it could generate a field and a method with the same Go name, which does not compile. Fix: Emit exported fields with the same name the engine uses. Message now becomes message. Test: Add a Message field to the existing Go self-call fixture and query message from the integration test. This proves the generated Go code compiles and the field is available under the expected name. Signed-off-by: Guillaume de Rouville <[email protected]>
Problem: The review raised a possible failure where a Go module with SELF_CALLS works when called directly, but breaks when another module depends on it. If that happened, the caller could still generate Go code for dag.Dep(), but the running engine would not expose dep at runtime. The user would only see the failure when calling the function. We did not reproduce that exact failure, but this is still a useful area to cover because it is easy to miss. A module dependency is loaded through a different path than the module being called directly. Solution: Add two small Go fixtures: - self-calls-as-dep: caller -> dep - self-calls-transitive: caller -> middle -> dep Only dep has SELF_CALLS enabled. That keeps the tests focused on the dependency case from the review. Tests: viaDep calls a dependency function that calls itself through dag.Dep(). viaDepContainer returns a container created by that self-call and then reads stdout from the caller. This proves the returned object is still usable. viaDepWorker calls back into dag.Dep() from a secondary object. This proves the case is not limited to methods on the root object. viaTransitiveDep calls through caller -> middle -> dep. This proves the self-call still works when the module with SELF_CALLS is a dependency of a dependency. Signed-off-by: Guillaume de Rouville <[email protected]>
7 tasks done
eunomie
pushed a commit
that referenced
this pull request
May 27, 2026
* go: fix self-call field names Problem: When a Go module has SELF_CALLS enabled, the Go SDK writes the module schema that is then used to generate the module's own Go client. For exported fields, that schema was using the Go name directly. So a field called Message was exposed as Message. The engine exposes that same field as message. Because of that mismatch, the generated Go client could be wrong. In the case we found, it could generate a field and a method with the same Go name, which does not compile. Fix: Emit exported fields with the same name the engine uses. Message now becomes message. Test: Add a Message field to the existing Go self-call fixture and query message from the integration test. This proves the generated Go code compiles and the field is available under the expected name. Signed-off-by: Guillaume de Rouville <[email protected]> * tests: cover self-calls from dependencies Problem: The review raised a possible failure where a Go module with SELF_CALLS works when called directly, but breaks when another module depends on it. If that happened, the caller could still generate Go code for dag.Dep(), but the running engine would not expose dep at runtime. The user would only see the failure when calling the function. We did not reproduce that exact failure, but this is still a useful area to cover because it is easy to miss. A module dependency is loaded through a different path than the module being called directly. Solution: Add two small Go fixtures: - self-calls-as-dep: caller -> dep - self-calls-transitive: caller -> middle -> dep Only dep has SELF_CALLS enabled. That keeps the tests focused on the dependency case from the review. Tests: viaDep calls a dependency function that calls itself through dag.Dep(). viaDepContainer returns a container created by that self-call and then reads stdout from the caller. This proves the returned object is still usable. viaDepWorker calls back into dag.Dep() from a secondary object. This proves the case is not limited to methods on the root object. viaTransitiveDep calls through caller -> middle -> dep. This proves the self-call still works when the module with SELF_CALLS is a dependency of a dependency. Signed-off-by: Guillaume de Rouville <[email protected]> --------- Signed-off-by: Yves Brissaud <[email protected]>
eunomie
added a commit
that referenced
this pull request
May 27, 2026
The self-call introspection emitter must reproduce exactly the names the engine exposes (the TypeDef path passes raw Go names and lets the engine normalize them). PR #2 fixed exported struct fields. Apply the same to the remaining names: - enum values -> ToScreamingSnake (Active -> ACTIVE); previously always mismatched, so a self-called enum value sent the wrong wire name. - function/constructor arguments -> ToLowerCamel (matches the engine; only bit non-lowerCamel params such as acronyms). - object/interface/enum type names and their type references -> ToCamel (only bit acronym type names, e.g. HTTPProxy -> HttpProxy). Add a Color enum to the Go self-calls fixture and a self-call that passes an enum argument, covering the enum-value casing end to end. Signed-off-by: Yves Brissaud <[email protected]>
eunomie
pushed a commit
that referenced
this pull request
May 28, 2026
* go: fix self-call field names Problem: When a Go module has SELF_CALLS enabled, the Go SDK writes the module schema that is then used to generate the module's own Go client. For exported fields, that schema was using the Go name directly. So a field called Message was exposed as Message. The engine exposes that same field as message. Because of that mismatch, the generated Go client could be wrong. In the case we found, it could generate a field and a method with the same Go name, which does not compile. Fix: Emit exported fields with the same name the engine uses. Message now becomes message. Test: Add a Message field to the existing Go self-call fixture and query message from the integration test. This proves the generated Go code compiles and the field is available under the expected name. Signed-off-by: Guillaume de Rouville <[email protected]> * tests: cover self-calls from dependencies Problem: The review raised a possible failure where a Go module with SELF_CALLS works when called directly, but breaks when another module depends on it. If that happened, the caller could still generate Go code for dag.Dep(), but the running engine would not expose dep at runtime. The user would only see the failure when calling the function. We did not reproduce that exact failure, but this is still a useful area to cover because it is easy to miss. A module dependency is loaded through a different path than the module being called directly. Solution: Add two small Go fixtures: - self-calls-as-dep: caller -> dep - self-calls-transitive: caller -> middle -> dep Only dep has SELF_CALLS enabled. That keeps the tests focused on the dependency case from the review. Tests: viaDep calls a dependency function that calls itself through dag.Dep(). viaDepContainer returns a container created by that self-call and then reads stdout from the caller. This proves the returned object is still usable. viaDepWorker calls back into dag.Dep() from a secondary object. This proves the case is not limited to methods on the root object. viaTransitiveDep calls through caller -> middle -> dep. This proves the self-call still works when the module with SELF_CALLS is a dependency of a dependency. Signed-off-by: Guillaume de Rouville <[email protected]> --------- Signed-off-by: Yves Brissaud <[email protected]>
eunomie
added a commit
that referenced
this pull request
May 28, 2026
The self-call introspection emitter must reproduce exactly the names the engine exposes (the TypeDef path passes raw Go names and lets the engine normalize them). PR #2 fixed exported struct fields. Apply the same to the remaining names: - enum values -> ToScreamingSnake (Active -> ACTIVE); previously always mismatched, so a self-called enum value sent the wrong wire name. - function/constructor arguments -> ToLowerCamel (matches the engine; only bit non-lowerCamel params such as acronyms). - object/interface/enum type names and their type references -> ToCamel (only bit acronym type names, e.g. HTTPProxy -> HttpProxy). Add a Color enum to the Go self-calls fixture and a self-call that passes an enum argument, covering the enum-value casing end to end. Signed-off-by: Yves Brissaud <[email protected]>
eunomie
pushed a commit
that referenced
this pull request
May 28, 2026
* go: fix self-call field names Problem: When a Go module has SELF_CALLS enabled, the Go SDK writes the module schema that is then used to generate the module's own Go client. For exported fields, that schema was using the Go name directly. So a field called Message was exposed as Message. The engine exposes that same field as message. Because of that mismatch, the generated Go client could be wrong. In the case we found, it could generate a field and a method with the same Go name, which does not compile. Fix: Emit exported fields with the same name the engine uses. Message now becomes message. Test: Add a Message field to the existing Go self-call fixture and query message from the integration test. This proves the generated Go code compiles and the field is available under the expected name. Signed-off-by: Guillaume de Rouville <[email protected]> * tests: cover self-calls from dependencies Problem: The review raised a possible failure where a Go module with SELF_CALLS works when called directly, but breaks when another module depends on it. If that happened, the caller could still generate Go code for dag.Dep(), but the running engine would not expose dep at runtime. The user would only see the failure when calling the function. We did not reproduce that exact failure, but this is still a useful area to cover because it is easy to miss. A module dependency is loaded through a different path than the module being called directly. Solution: Add two small Go fixtures: - self-calls-as-dep: caller -> dep - self-calls-transitive: caller -> middle -> dep Only dep has SELF_CALLS enabled. That keeps the tests focused on the dependency case from the review. Tests: viaDep calls a dependency function that calls itself through dag.Dep(). viaDepContainer returns a container created by that self-call and then reads stdout from the caller. This proves the returned object is still usable. viaDepWorker calls back into dag.Dep() from a secondary object. This proves the case is not limited to methods on the root object. viaTransitiveDep calls through caller -> middle -> dep. This proves the self-call still works when the module with SELF_CALLS is a dependency of a dependency. Signed-off-by: Guillaume de Rouville <[email protected]> --------- Signed-off-by: Yves Brissaud <[email protected]>
eunomie
added a commit
that referenced
this pull request
May 28, 2026
The self-call introspection emitter must reproduce exactly the names the engine exposes (the TypeDef path passes raw Go names and lets the engine normalize them). PR #2 fixed exported struct fields. Apply the same to the remaining names: - enum values -> ToScreamingSnake (Active -> ACTIVE); previously always mismatched, so a self-called enum value sent the wrong wire name. - function/constructor arguments -> ToLowerCamel (matches the engine; only bit non-lowerCamel params such as acronyms). - object/interface/enum type names and their type references -> ToCamel (only bit acronym type names, e.g. HTTPProxy -> HttpProxy). Add a Color enum to the Go self-calls fixture and a self-call that passes an enum argument, covering the enum-value casing end to end. Signed-off-by: Yves Brissaud <[email protected]>
eunomie
pushed a commit
that referenced
this pull request
May 29, 2026
* go: fix self-call field names Problem: When a Go module has SELF_CALLS enabled, the Go SDK writes the module schema that is then used to generate the module's own Go client. For exported fields, that schema was using the Go name directly. So a field called Message was exposed as Message. The engine exposes that same field as message. Because of that mismatch, the generated Go client could be wrong. In the case we found, it could generate a field and a method with the same Go name, which does not compile. Fix: Emit exported fields with the same name the engine uses. Message now becomes message. Test: Add a Message field to the existing Go self-call fixture and query message from the integration test. This proves the generated Go code compiles and the field is available under the expected name. Signed-off-by: Guillaume de Rouville <[email protected]> * tests: cover self-calls from dependencies Problem: The review raised a possible failure where a Go module with SELF_CALLS works when called directly, but breaks when another module depends on it. If that happened, the caller could still generate Go code for dag.Dep(), but the running engine would not expose dep at runtime. The user would only see the failure when calling the function. We did not reproduce that exact failure, but this is still a useful area to cover because it is easy to miss. A module dependency is loaded through a different path than the module being called directly. Solution: Add two small Go fixtures: - self-calls-as-dep: caller -> dep - self-calls-transitive: caller -> middle -> dep Only dep has SELF_CALLS enabled. That keeps the tests focused on the dependency case from the review. Tests: viaDep calls a dependency function that calls itself through dag.Dep(). viaDepContainer returns a container created by that self-call and then reads stdout from the caller. This proves the returned object is still usable. viaDepWorker calls back into dag.Dep() from a secondary object. This proves the case is not limited to methods on the root object. viaTransitiveDep calls through caller -> middle -> dep. This proves the self-call still works when the module with SELF_CALLS is a dependency of a dependency. Signed-off-by: Guillaume de Rouville <[email protected]> --------- Signed-off-by: Yves Brissaud <[email protected]>
eunomie
added a commit
that referenced
this pull request
May 29, 2026
The self-call introspection emitter must reproduce exactly the names the engine exposes (the TypeDef path passes raw Go names and lets the engine normalize them). PR #2 fixed exported struct fields. Apply the same to the remaining names: - enum values -> ToScreamingSnake (Active -> ACTIVE); previously always mismatched, so a self-called enum value sent the wrong wire name. - function/constructor arguments -> ToLowerCamel (matches the engine; only bit non-lowerCamel params such as acronyms). - object/interface/enum type names and their type references -> ToCamel (only bit acronym type names, e.g. HTTPProxy -> HttpProxy). Add a Color enum to the Go self-calls fixture and a self-call that passes an enum argument, covering the enum-value casing end to end. Signed-off-by: Yves Brissaud <[email protected]>
eunomie
pushed a commit
that referenced
this pull request
May 30, 2026
* go: fix self-call field names Problem: When a Go module has SELF_CALLS enabled, the Go SDK writes the module schema that is then used to generate the module's own Go client. For exported fields, that schema was using the Go name directly. So a field called Message was exposed as Message. The engine exposes that same field as message. Because of that mismatch, the generated Go client could be wrong. In the case we found, it could generate a field and a method with the same Go name, which does not compile. Fix: Emit exported fields with the same name the engine uses. Message now becomes message. Test: Add a Message field to the existing Go self-call fixture and query message from the integration test. This proves the generated Go code compiles and the field is available under the expected name. Signed-off-by: Guillaume de Rouville <[email protected]> * tests: cover self-calls from dependencies Problem: The review raised a possible failure where a Go module with SELF_CALLS works when called directly, but breaks when another module depends on it. If that happened, the caller could still generate Go code for dag.Dep(), but the running engine would not expose dep at runtime. The user would only see the failure when calling the function. We did not reproduce that exact failure, but this is still a useful area to cover because it is easy to miss. A module dependency is loaded through a different path than the module being called directly. Solution: Add two small Go fixtures: - self-calls-as-dep: caller -> dep - self-calls-transitive: caller -> middle -> dep Only dep has SELF_CALLS enabled. That keeps the tests focused on the dependency case from the review. Tests: viaDep calls a dependency function that calls itself through dag.Dep(). viaDepContainer returns a container created by that self-call and then reads stdout from the caller. This proves the returned object is still usable. viaDepWorker calls back into dag.Dep() from a secondary object. This proves the case is not limited to methods on the root object. viaTransitiveDep calls through caller -> middle -> dep. This proves the self-call still works when the module with SELF_CALLS is a dependency of a dependency. Signed-off-by: Guillaume de Rouville <[email protected]> --------- Signed-off-by: Yves Brissaud <[email protected]>
eunomie
added a commit
that referenced
this pull request
May 30, 2026
The self-call introspection emitter must reproduce exactly the names the engine exposes (the TypeDef path passes raw Go names and lets the engine normalize them). PR #2 fixed exported struct fields. Apply the same to the remaining names: - enum values -> ToScreamingSnake (Active -> ACTIVE); previously always mismatched, so a self-called enum value sent the wrong wire name. - function/constructor arguments -> ToLowerCamel (matches the engine; only bit non-lowerCamel params such as acronyms). - object/interface/enum type names and their type references -> ToCamel (only bit acronym type names, e.g. HTTPProxy -> HttpProxy). Add a Color enum to the Go self-calls fixture and a self-call that passes an enum argument, covering the enum-value casing end to end. Signed-off-by: Yves Brissaud <[email protected]>
eunomie
pushed a commit
that referenced
this pull request
Jun 1, 2026
* go: fix self-call field names Problem: When a Go module has SELF_CALLS enabled, the Go SDK writes the module schema that is then used to generate the module's own Go client. For exported fields, that schema was using the Go name directly. So a field called Message was exposed as Message. The engine exposes that same field as message. Because of that mismatch, the generated Go client could be wrong. In the case we found, it could generate a field and a method with the same Go name, which does not compile. Fix: Emit exported fields with the same name the engine uses. Message now becomes message. Test: Add a Message field to the existing Go self-call fixture and query message from the integration test. This proves the generated Go code compiles and the field is available under the expected name. Signed-off-by: Guillaume de Rouville <[email protected]> * tests: cover self-calls from dependencies Problem: The review raised a possible failure where a Go module with SELF_CALLS works when called directly, but breaks when another module depends on it. If that happened, the caller could still generate Go code for dag.Dep(), but the running engine would not expose dep at runtime. The user would only see the failure when calling the function. We did not reproduce that exact failure, but this is still a useful area to cover because it is easy to miss. A module dependency is loaded through a different path than the module being called directly. Solution: Add two small Go fixtures: - self-calls-as-dep: caller -> dep - self-calls-transitive: caller -> middle -> dep Only dep has SELF_CALLS enabled. That keeps the tests focused on the dependency case from the review. Tests: viaDep calls a dependency function that calls itself through dag.Dep(). viaDepContainer returns a container created by that self-call and then reads stdout from the caller. This proves the returned object is still usable. viaDepWorker calls back into dag.Dep() from a secondary object. This proves the case is not limited to methods on the root object. viaTransitiveDep calls through caller -> middle -> dep. This proves the self-call still works when the module with SELF_CALLS is a dependency of a dependency. Signed-off-by: Guillaume de Rouville <[email protected]> --------- Signed-off-by: Yves Brissaud <[email protected]>
eunomie
added a commit
that referenced
this pull request
Jun 1, 2026
The self-call introspection emitter must reproduce exactly the names the engine exposes (the TypeDef path passes raw Go names and lets the engine normalize them). PR #2 fixed exported struct fields. Apply the same to the remaining names: - enum values -> ToScreamingSnake (Active -> ACTIVE); previously always mismatched, so a self-called enum value sent the wrong wire name. - function/constructor arguments -> ToLowerCamel (matches the engine; only bit non-lowerCamel params such as acronyms). - object/interface/enum type names and their type references -> ToCamel (only bit acronym type names, e.g. HTTPProxy -> HttpProxy). Add a Color enum to the Go self-calls fixture and a self-call that passes an enum argument, covering the enum-value casing end to end. Signed-off-by: Yves Brissaud <[email protected]>
eunomie
pushed a commit
that referenced
this pull request
Jun 2, 2026
* go: fix self-call field names Problem: When a Go module has SELF_CALLS enabled, the Go SDK writes the module schema that is then used to generate the module's own Go client. For exported fields, that schema was using the Go name directly. So a field called Message was exposed as Message. The engine exposes that same field as message. Because of that mismatch, the generated Go client could be wrong. In the case we found, it could generate a field and a method with the same Go name, which does not compile. Fix: Emit exported fields with the same name the engine uses. Message now becomes message. Test: Add a Message field to the existing Go self-call fixture and query message from the integration test. This proves the generated Go code compiles and the field is available under the expected name. Signed-off-by: Guillaume de Rouville <[email protected]> * tests: cover self-calls from dependencies Problem: The review raised a possible failure where a Go module with SELF_CALLS works when called directly, but breaks when another module depends on it. If that happened, the caller could still generate Go code for dag.Dep(), but the running engine would not expose dep at runtime. The user would only see the failure when calling the function. We did not reproduce that exact failure, but this is still a useful area to cover because it is easy to miss. A module dependency is loaded through a different path than the module being called directly. Solution: Add two small Go fixtures: - self-calls-as-dep: caller -> dep - self-calls-transitive: caller -> middle -> dep Only dep has SELF_CALLS enabled. That keeps the tests focused on the dependency case from the review. Tests: viaDep calls a dependency function that calls itself through dag.Dep(). viaDepContainer returns a container created by that self-call and then reads stdout from the caller. This proves the returned object is still usable. viaDepWorker calls back into dag.Dep() from a secondary object. This proves the case is not limited to methods on the root object. viaTransitiveDep calls through caller -> middle -> dep. This proves the self-call still works when the module with SELF_CALLS is a dependency of a dependency. Signed-off-by: Guillaume de Rouville <[email protected]> --------- Signed-off-by: Yves Brissaud <[email protected]>
eunomie
added a commit
that referenced
this pull request
Jun 2, 2026
The self-call introspection emitter must reproduce exactly the names the engine exposes (the TypeDef path passes raw Go names and lets the engine normalize them). PR #2 fixed exported struct fields. Apply the same to the remaining names: - enum values -> ToScreamingSnake (Active -> ACTIVE); previously always mismatched, so a self-called enum value sent the wrong wire name. - function/constructor arguments -> ToLowerCamel (matches the engine; only bit non-lowerCamel params such as acronyms). - object/interface/enum type names and their type references -> ToCamel (only bit acronym type names, e.g. HTTPProxy -> HttpProxy). Add a Color enum to the Go self-calls fixture and a self-call that passes an enum argument, covering the enum-value casing end to end. Signed-off-by: Yves Brissaud <[email protected]>
eunomie
pushed a commit
that referenced
this pull request
Jun 4, 2026
* go: fix self-call field names Problem: When a Go module has SELF_CALLS enabled, the Go SDK writes the module schema that is then used to generate the module's own Go client. For exported fields, that schema was using the Go name directly. So a field called Message was exposed as Message. The engine exposes that same field as message. Because of that mismatch, the generated Go client could be wrong. In the case we found, it could generate a field and a method with the same Go name, which does not compile. Fix: Emit exported fields with the same name the engine uses. Message now becomes message. Test: Add a Message field to the existing Go self-call fixture and query message from the integration test. This proves the generated Go code compiles and the field is available under the expected name. Signed-off-by: Guillaume de Rouville <[email protected]> * tests: cover self-calls from dependencies Problem: The review raised a possible failure where a Go module with SELF_CALLS works when called directly, but breaks when another module depends on it. If that happened, the caller could still generate Go code for dag.Dep(), but the running engine would not expose dep at runtime. The user would only see the failure when calling the function. We did not reproduce that exact failure, but this is still a useful area to cover because it is easy to miss. A module dependency is loaded through a different path than the module being called directly. Solution: Add two small Go fixtures: - self-calls-as-dep: caller -> dep - self-calls-transitive: caller -> middle -> dep Only dep has SELF_CALLS enabled. That keeps the tests focused on the dependency case from the review. Tests: viaDep calls a dependency function that calls itself through dag.Dep(). viaDepContainer returns a container created by that self-call and then reads stdout from the caller. This proves the returned object is still usable. viaDepWorker calls back into dag.Dep() from a secondary object. This proves the case is not limited to methods on the root object. viaTransitiveDep calls through caller -> middle -> dep. This proves the self-call still works when the module with SELF_CALLS is a dependency of a dependency. Signed-off-by: Guillaume de Rouville <[email protected]> --------- Signed-off-by: Yves Brissaud <[email protected]>
eunomie
added a commit
that referenced
this pull request
Jun 4, 2026
The self-call introspection emitter must reproduce exactly the names the engine exposes (the TypeDef path passes raw Go names and lets the engine normalize them). PR #2 fixed exported struct fields. Apply the same to the remaining names: - enum values -> ToScreamingSnake (Active -> ACTIVE); previously always mismatched, so a self-called enum value sent the wrong wire name. - function/constructor arguments -> ToLowerCamel (matches the engine; only bit non-lowerCamel params such as acronyms). - object/interface/enum type names and their type references -> ToCamel (only bit acronym type names, e.g. HTTPProxy -> HttpProxy). Add a Color enum to the Go self-calls fixture and a self-call that passes an enum argument, covering the enum-value casing end to end. Signed-off-by: Yves Brissaud <[email protected]>
eunomie
pushed a commit
that referenced
this pull request
Jun 5, 2026
* go: fix self-call field names Problem: When a Go module has SELF_CALLS enabled, the Go SDK writes the module schema that is then used to generate the module's own Go client. For exported fields, that schema was using the Go name directly. So a field called Message was exposed as Message. The engine exposes that same field as message. Because of that mismatch, the generated Go client could be wrong. In the case we found, it could generate a field and a method with the same Go name, which does not compile. Fix: Emit exported fields with the same name the engine uses. Message now becomes message. Test: Add a Message field to the existing Go self-call fixture and query message from the integration test. This proves the generated Go code compiles and the field is available under the expected name. Signed-off-by: Guillaume de Rouville <[email protected]> * tests: cover self-calls from dependencies Problem: The review raised a possible failure where a Go module with SELF_CALLS works when called directly, but breaks when another module depends on it. If that happened, the caller could still generate Go code for dag.Dep(), but the running engine would not expose dep at runtime. The user would only see the failure when calling the function. We did not reproduce that exact failure, but this is still a useful area to cover because it is easy to miss. A module dependency is loaded through a different path than the module being called directly. Solution: Add two small Go fixtures: - self-calls-as-dep: caller -> dep - self-calls-transitive: caller -> middle -> dep Only dep has SELF_CALLS enabled. That keeps the tests focused on the dependency case from the review. Tests: viaDep calls a dependency function that calls itself through dag.Dep(). viaDepContainer returns a container created by that self-call and then reads stdout from the caller. This proves the returned object is still usable. viaDepWorker calls back into dag.Dep() from a secondary object. This proves the case is not limited to methods on the root object. viaTransitiveDep calls through caller -> middle -> dep. This proves the self-call still works when the module with SELF_CALLS is a dependency of a dependency. Signed-off-by: Guillaume de Rouville <[email protected]> --------- Signed-off-by: Yves Brissaud <[email protected]>
eunomie
added a commit
that referenced
this pull request
Jun 5, 2026
The self-call introspection emitter must reproduce exactly the names the engine exposes (the TypeDef path passes raw Go names and lets the engine normalize them). PR #2 fixed exported struct fields. Apply the same to the remaining names: - enum values -> ToScreamingSnake (Active -> ACTIVE); previously always mismatched, so a self-called enum value sent the wrong wire name. - function/constructor arguments -> ToLowerCamel (matches the engine; only bit non-lowerCamel params such as acronyms). - object/interface/enum type names and their type references -> ToCamel (only bit acronym type names, e.g. HTTPProxy -> HttpProxy). Add a Color enum to the Go self-calls fixture and a self-call that passes an enum argument, covering the enum-value casing end to end. Signed-off-by: Yves Brissaud <[email protected]>
eunomie
pushed a commit
that referenced
this pull request
Jun 8, 2026
* go: fix self-call field names Problem: When a Go module has SELF_CALLS enabled, the Go SDK writes the module schema that is then used to generate the module's own Go client. For exported fields, that schema was using the Go name directly. So a field called Message was exposed as Message. The engine exposes that same field as message. Because of that mismatch, the generated Go client could be wrong. In the case we found, it could generate a field and a method with the same Go name, which does not compile. Fix: Emit exported fields with the same name the engine uses. Message now becomes message. Test: Add a Message field to the existing Go self-call fixture and query message from the integration test. This proves the generated Go code compiles and the field is available under the expected name. Signed-off-by: Guillaume de Rouville <[email protected]> * tests: cover self-calls from dependencies Problem: The review raised a possible failure where a Go module with SELF_CALLS works when called directly, but breaks when another module depends on it. If that happened, the caller could still generate Go code for dag.Dep(), but the running engine would not expose dep at runtime. The user would only see the failure when calling the function. We did not reproduce that exact failure, but this is still a useful area to cover because it is easy to miss. A module dependency is loaded through a different path than the module being called directly. Solution: Add two small Go fixtures: - self-calls-as-dep: caller -> dep - self-calls-transitive: caller -> middle -> dep Only dep has SELF_CALLS enabled. That keeps the tests focused on the dependency case from the review. Tests: viaDep calls a dependency function that calls itself through dag.Dep(). viaDepContainer returns a container created by that self-call and then reads stdout from the caller. This proves the returned object is still usable. viaDepWorker calls back into dag.Dep() from a secondary object. This proves the case is not limited to methods on the root object. viaTransitiveDep calls through caller -> middle -> dep. This proves the self-call still works when the module with SELF_CALLS is a dependency of a dependency. Signed-off-by: Guillaume de Rouville <[email protected]> --------- Signed-off-by: Yves Brissaud <[email protected]>
eunomie
added a commit
that referenced
this pull request
Jun 8, 2026
The self-call introspection emitter must reproduce exactly the names the engine exposes (the TypeDef path passes raw Go names and lets the engine normalize them). PR #2 fixed exported struct fields. Apply the same to the remaining names: - enum values -> ToScreamingSnake (Active -> ACTIVE); previously always mismatched, so a self-called enum value sent the wrong wire name. - function/constructor arguments -> ToLowerCamel (matches the engine; only bit non-lowerCamel params such as acronyms). - object/interface/enum type names and their type references -> ToCamel (only bit acronym type names, e.g. HTTPProxy -> HttpProxy). Add a Color enum to the Go self-calls fixture and a self-call that passes an enum argument, covering the enum-value casing end to end. Signed-off-by: Yves Brissaud <[email protected]>
eunomie
pushed a commit
that referenced
this pull request
Jun 9, 2026
* go: fix self-call field names Problem: When a Go module has SELF_CALLS enabled, the Go SDK writes the module schema that is then used to generate the module's own Go client. For exported fields, that schema was using the Go name directly. So a field called Message was exposed as Message. The engine exposes that same field as message. Because of that mismatch, the generated Go client could be wrong. In the case we found, it could generate a field and a method with the same Go name, which does not compile. Fix: Emit exported fields with the same name the engine uses. Message now becomes message. Test: Add a Message field to the existing Go self-call fixture and query message from the integration test. This proves the generated Go code compiles and the field is available under the expected name. Signed-off-by: Guillaume de Rouville <[email protected]> * tests: cover self-calls from dependencies Problem: The review raised a possible failure where a Go module with SELF_CALLS works when called directly, but breaks when another module depends on it. If that happened, the caller could still generate Go code for dag.Dep(), but the running engine would not expose dep at runtime. The user would only see the failure when calling the function. We did not reproduce that exact failure, but this is still a useful area to cover because it is easy to miss. A module dependency is loaded through a different path than the module being called directly. Solution: Add two small Go fixtures: - self-calls-as-dep: caller -> dep - self-calls-transitive: caller -> middle -> dep Only dep has SELF_CALLS enabled. That keeps the tests focused on the dependency case from the review. Tests: viaDep calls a dependency function that calls itself through dag.Dep(). viaDepContainer returns a container created by that self-call and then reads stdout from the caller. This proves the returned object is still usable. viaDepWorker calls back into dag.Dep() from a secondary object. This proves the case is not limited to methods on the root object. viaTransitiveDep calls through caller -> middle -> dep. This proves the self-call still works when the module with SELF_CALLS is a dependency of a dependency. Signed-off-by: Guillaume de Rouville <[email protected]> --------- Signed-off-by: Yves Brissaud <[email protected]>
eunomie
added a commit
that referenced
this pull request
Jun 9, 2026
The self-call introspection emitter must reproduce exactly the names the engine exposes (the TypeDef path passes raw Go names and lets the engine normalize them). PR #2 fixed exported struct fields. Apply the same to the remaining names: - enum values -> ToScreamingSnake (Active -> ACTIVE); previously always mismatched, so a self-called enum value sent the wrong wire name. - function/constructor arguments -> ToLowerCamel (matches the engine; only bit non-lowerCamel params such as acronyms). - object/interface/enum type names and their type references -> ToCamel (only bit acronym type names, e.g. HTTPProxy -> HttpProxy). Add a Color enum to the Go self-calls fixture and a self-call that passes an enum argument, covering the enum-value casing end to end. Signed-off-by: Yves Brissaud <[email protected]>
eunomie
pushed a commit
that referenced
this pull request
Oct 9, 2026
A copy-on-write full checkout still rewrote the whole worktree: it removed the source snapshot's worktree, which cannot be trusted (a workspace repository carries pending edits), and checked out every file again. On dagger/dagger (16.5k files, 253MB) `git checkout -f` alone took 6.3s under load; GitRef.__fullCheckout was #2 on the resume critical path. When the ref has a checkout base (withCommit and pulls record one, see LocalGitRef.incrementalCheckoutIneligible), start instead from the base's own __fullCheckout: a clean worktree of that commit by construction, never edited. In a copy-on-write child of it: - fetch only what the base lacks from the source repository, negotiating from its HEAD (a checkout's HEAD is usually detached: without the tip, fetch would receive the whole history again), keeping packs whole so no inherited pack is freshened; - apply the tree delta to the worktree with the same plan and writer as incremental source trees (planIncrementalGitCheckout, applyIncrementalGitCheckout), which also gate on ancestry, gitlinks and attribute changes; .gitmodules falls back too; - rebuild .git's metadata as before, but set HEAD and the refs as the checkout would (gitCheckoutRefs) instead of running it, and normalize timestamps under .git only. The base checkout is materialized cold only at the top level, as for incremental trees (incrementalParentTree). Otherwise, and for refs without a checkout base, unusual ref names, or any failure, the wipe path runs as before, then the full checkout. Each copy-on-write checkout now records the path it took (delta, wipe, full), its detail and the skipped paths' reasons as dagger.git.checkout.cow.path, .detail and .skipped, and a zero-length wcprof marker of class git.checkout.<path>[...]. TestCowGitCheckoutDelta compares the result with a fresh checkout file for file across branch, tag, detached and commit-named refs and directory/file/symlink reshapes, and bounds the fetched objects by the delta. In the engine test, the committed head's checkout layer is 0.5MiB instead of 21MiB. Signed-off-by: Alex Suraci <[email protected]>
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.
This PR is a follow-up against eunomie's
workspace-go-no-codegen-at-runtimebranch.That branch changes how Go modules with SELF_CALLS provide the schema used to generate their own Go client. My manual review led to those findings:
The actual bug
A Go module can expose fields on its root object:
The engine exposes that field as message, but the new self-call schema emitter was exposing it as Message.
That mismatch can break the generated Go client. In the failing case, generated code could end up with a field and a method using the same Go name, so the code would not compile.
What changed:
Messagenow becomesmessage.Dependency coverage added:
caller->depcaller->middle->depThe dep module is the only module with SELF_CALLS enabled. That keeps the tests focused on the case from the review.
The new tests verify:
Tested with:
Result: 17 passed.