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
CLI: decide whether to support id or to continue hiding #6360
Right now #6293 went with hiding id fields on types from the CLI because IDs are not generally safe to re-use across sessions.
However, #6297 will drastically improve the ID system and opens the possibility of allowing IDs to be re-used in some circumstances. We can thus consider whether to embrace that in the CLI and add some mechanism for getting the IDs of objects and re-use those.
To be clear, this isn't super high priority, the status quo of hiding ids is fine for now and we should theoretically be able to make adjustments here in the future in backwards compatible way.
As I described in #6517 I think it’s best to ignore/hide IDs for now until the use case surfaces, at which point we'll create a new issue to bring ids into the foreground.
No the new ID system opens up a path to plausibly making IDs generally re-usable across sessions but it still requires more work.
The biggest source of problems are local dirs, but there's some others like secrets too. We can't make all IDs perfectly reusable but it's theoretically possible to make them re-usable for a certain amount of time (and then error clearly once they expire).
I'm also not convinced we really should do this since it just encourages wrapping the CLI rather than writing modules that implement the logic (and thus avoid the need for persisting IDs for re-use across sessions).
@shykes I think so yes (at least, I can't think of why it wouldn't work off the top of my head). We'd still need the CLI to support providing ID strings as arguments to functions for all IDable types.
In the choice between A) investing time in doing this vs. B) investing time in alternative solutions like #5774, I'd vote for B). Just because I think it will result in a better end experience.
Does that boil down to exposing core functions to the CLI? Or does it involve more than that?
No it's just that right now when you e.g. dagger call fn --dir-arg foobar (where --dir-arg is of type Directory), the CLI assumes the value of the arg is a path to a local dir. But now we'd need it to be able to identify args as being in an ID format and use those instead of trying to interpret as a path. Wouldn't be that hard or anything (the corner cases are obscure enough to ignore), just was noting it wouldn't work out of the box even when wrapping in dagger run yet.
Does that boil down to exposing core functions to the CLI? Or does it involve more than that?
No it's just that right now when you e.g. dagger call fn --dir-arg foobar (where --dir-arg is of type Directory), the CLI assumes the value of the arg is a path to a local dir. But now we'd need it to be able to identify args as being in an ID format and use those instead of trying to interpret as a path. Wouldn't be that hard or anything (the corner cases are obscure enough to ignore), just was noting it wouldn't work out of the box even when wrapping in dagger run yet.
Activity
helderco commentedon Jan 3, 2024
Yeah, sounds good to hide for now. Should at least hide from
syncas well but that's in:helderco commentedon Jan 29, 2024
As I described in #6517 I think it’s best to ignore/hide IDs for now until the use case surfaces, at which point we'll create a new issue to bring
ids into the foreground.shykes commentedon Feb 21, 2024
FYI the use case is there. I need
id, and so will everyone composingdagger callin a shell script. 🙏 .helderco commentedon Feb 21, 2024
I also considered what @sipsma said in:
Is it confirmed that IDs are stable now to be used in this way? Only in certain cases? Which cases?
sipsma commentedon Feb 22, 2024
No the new ID system opens up a path to plausibly making IDs generally re-usable across sessions but it still requires more work.
The biggest source of problems are local dirs, but there's some others like secrets too. We can't make all IDs perfectly reusable but it's theoretically possible to make them re-usable for a certain amount of time (and then error clearly once they expire).
I'm also not convinced we really should do this since it just encourages wrapping the CLI rather than writing modules that implement the logic (and thus avoid the need for persisting IDs for re-use across sessions).
shykes commentedon Feb 22, 2024
@sipsma if I wrap my shell in a persistent session ie.
dagger run sh, then are IDs guaranteed to work across commands of that shell?sipsma commentedon Feb 22, 2024
@shykes I think so yes (at least, I can't think of why it wouldn't work off the top of my head). We'd still need the CLI to support providing ID strings as arguments to functions for all IDable types.
In the choice between A) investing time in doing this vs. B) investing time in alternative solutions like #5774, I'd vote for B). Just because I think it will result in a better end experience.
shykes commentedon Feb 22, 2024
Does that boil down to exposing core functions to the CLI? Or does it involve more than that?
Makes sense. I think those two things might converge eventually (eg. one valuable scripting language for us to support would be bash).
sipsma commentedon Feb 22, 2024
No it's just that right now when you e.g.
dagger call fn --dir-arg foobar(where--dir-argis of typeDirectory), the CLI assumes the value of the arg is a path to a local dir. But now we'd need it to be able to identify args as being in an ID format and use those instead of trying to interpret as a path. Wouldn't be that hard or anything (the corner cases are obscure enough to ignore), just was noting it wouldn't work out of the box even when wrapping indagger runyet.shykes commentedon Feb 22, 2024
Oh, right! Duh.