You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
🐞 Elixir/Rust/Python: strange experimentalWithAllGPUs function name #6310
diff --git a/sdk/rust/crates/dagger-sdk/src/gen.rs b/sdk/rust/crates/dagger-sdk/src/gen.rs
index 7aa880b6e..5f9803f3c 100644
--- a/sdk/rust/crates/dagger-sdk/src/gen.rs+++ b/sdk/rust/crates/dagger-sdk/src/gen.rs@@ -929,7 +929,7 @@ impl Container {
/// EXPERIMENTAL API! Subject to change/removal at any time.
/// Configures all available GPUs on the host to be accessible to this container.
/// This currently works for Nvidia devices only.
- pub fn experimental_with_all_gp_us(&self) -> Container {+ pub fn experimental_with_all_gpus(&self) -> Container {
let query = self.selection.select("experimentalWithAllGPUs");
return Container {
proc: self.proc.clone(),
@@ -3195,7 +3195,7 @@ impl GeneratedCode {
query.execute(self.graphql_client.clone()).await
}
/// Set the list of paths to mark generated in version control.
- pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {+ pub fn with_vcsgenerated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
let mut query = self.selection.select("withVCSGeneratedPaths");
query = query.arg(
"paths",
@@ -3208,7 +3208,7 @@ impl GeneratedCode {
};
}
/// Set the list of paths to ignore in version control.
- pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {+ pub fn with_vcsignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
let mut query = self.selection.select("withVCSIgnoredPaths");
query = query.arg(
"paths",
It seems like when we transform to camel case, you can't have both:
changed the title [-]🐞 Elixir: strange experimentalWithAllGPUs function name[/-][+]🐞 Elixir/Rust/Python: strange experimentalWithAllGPUs function name[/+]on Jan 26, 2024
We could alternatively maintain a bespoke list of acronyms and hope each language has a library that supports that sort of thing, but keeping that in sync across SDKs seems like it'd be a constant battle.
We could alternatively maintain a bespoke list of acronyms and hope each language has a library that supports that sort of thing, but keeping that in sync across SDKs seems like it'd be a constant battle.
Or we could use acronym word with a camel case, such as experimentalWithAllGPUs -> experimentalWithAllGpus. I’m not sure if it make sense to some language such as Go or Java that uses camel case style but it solve on snake case function like this issue.
We could alternatively maintain a bespoke list of acronyms
Even more alternatively, could we potentially add a method to the dagger API that performs the word splitting? Then each SDK joins them up? That way, we only need to handle this complexity in the Go SDK.
Though the issue with that is that the SDKs are using the graphql introspection API - so not 100% sure about that, if we were instead using the fancy new TypeDefs API, it would be super easy to add into that.
Activity
jedevc commentedon Jan 16, 2024
cc @vito since you've been in the graphql schema space 😄
I think this is some weirdness with how the string conversion library we use works,
GPUsgets split intoGP+Usinstead of keeping it as is.vito commentedon Jan 16, 2024
My guess is we need to use
strcase.ConfigureAcronymwingyplus commentedon Jan 16, 2024
I workaround it by replacing it with
Gpus(https://github.com/wingyplus/dagger/blob/elixir-new-codegen/sdk/elixir/dagger_codegen/lib/dagger/codegen/elixir_generator/formatter.ex#L21). 😂I found this issue on the Rust SDK also
dagger/sdk/rust/crates/dagger-sdk/src/gen.rs
Line 889 in 9bf9f7f
jedevc commentedon Jan 26, 2024
Eek we also have this issue in python (cc @helderco):
dagger/sdk/python/src/dagger/client/gen.py
Line 501 in 2999573
Poked into this - it looks like this is left up to the SDK codegen to convert, the input at the point of generation is
experimentalWithAllGPUs.In the rust case (which I'm more familiar with), this function performs the incorrect conversion:
dagger/sdk/rust/crates/dagger-codegen/src/rust/functions.rs
Lines 17 to 19 in 2999573
Super weird though, because, if I change the code slightly:
Then I get:
It seems like when we transform to camel case, you can't have both:
[-]🐞 Elixir: strange experimentalWithAllGPUs function name[/-][+]🐞 Elixir/Rust/Python: strange experimentalWithAllGPUs function name[/+]vito commentedon Jan 26, 2024
Welp. Maybe it's time to just stop using acronyms?
We could alternatively maintain a bespoke list of acronyms and hope each language has a library that supports that sort of thing, but keeping that in sync across SDKs seems like it'd be a constant battle.
wingyplus commentedon Jan 28, 2024
Or we could use acronym word with a camel case, such as
experimentalWithAllGPUs->experimentalWithAllGpus. I’m not sure if it make sense to some language such as Go or Java that uses camel case style but it solve on snake case function like this issue.jedevc commentedon Jan 29, 2024
Even more alternatively, could we potentially add a method to the dagger API that performs the word splitting? Then each SDK joins them up? That way, we only need to handle this complexity in the Go SDK.
Though the issue with that is that the SDKs are using the graphql introspection API - so not 100% sure about that, if we were instead using the fancy new TypeDefs API, it would be super easy to add into that.
Just another option to add to the pile 🎉
helderco commentedon Jan 29, 2024
Yeah, that's my plan with:
Need to update the description, but have been thinking on modularizing it.
feat(sdk/elixir): improve acronym word conversion