The 0.12 release blog post (https://dagger.io/blog/dagger-0-12) mentions the addition of Enums, however there aren't many details.
I'm wondering if the description ("Undetermined risk; analyze further" for the Severity.UNKNOWN enum variant) is used in any way?
When I call my function that has an Enum as an argument, it just prints out a list of variants like UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL.
#What happens with description of a defined Dagger Enum?
1 messages · Page 1 of 1 (latest)
The descriptions can be viewed as doc-strings in the generated code
But, yeah you can't see them in the CLI sadly - I think that would probably take up too much space, especially if there were a lot of enum values
But we could always revisit that description tbf!
We can edit the blog post to link to the docs page about Enum
Yeah, they're most useful now from the IDE, when client bindings are generated from a dependency.
Thanks for the quick replies, a link would be great since I have troubles with finding it.
Would you ever consider adding some kind of option that would allow us to include the descriptions of Enums too? Some kind of a verbosity flag? It could be such that it's one enum variant per line.
ARGUMENTS
--severity
- UNKNOWN Undetermined risk; analyze further
- LOW Minimal risk; routine fix
It's a nice feature for someone who's playing around with pipelines, but didn't author them. I'm thinking of ways they could use Dagger CLI to get all the info they need.
I'm up for it as I've seen this pattern in some CLIs.
Yeah, I'd be alright with that 😄
@primal meteor any chance you could open an issue?
@Jed Of course! 🙂
uv used to do that, but it seems they've simplified the output now. Example:
Before uv help run
--resolution <RESOLUTION>
The strategy to use when selecting between the different compatible versions for a given package
requirement.
By default, `uv` will use the latest compatible version of each package (`highest`).
[env: UV_RESOLUTION=]
Possible values:
- highest: Resolve the highest compatible version of each package
- lowest: Resolve the lowest compatible version of each package
- lowest-direct: Resolve the lowest compatible version of any direct dependencies, and the highest
compatible version of any transitive dependencies
Now uv run --help
--resolution <RESOLUTION>
The strategy to use when selecting between the different compatible versions for a given package
requirement [env: UV_RESOLUTION=] [possible values: highest, lowest, lowest-direct]
EDIT: Oh, they use a more compact help when doing uv <command> --help but more information when doing uv help <command>.
It looks like perhaps we don't have a docs page for the new enums.. cc @muted fjord
(or at least I couldn't find it)
No there's not, @queen river is it in your list or should I take care of that?
Vikram is on vacation
Maybe something very simple to start, and we can improve it later
Oh, so I'm going to open an issue and take it as soon as I've finish with https://github.com/dagger/dagger/pull/7864
GitHub
Following up on #7852, this PR uses the packageManager field of the package.json to use the correct package manager.
If not, it detect the used lockfile.
This PR also includes a change to generate ...
Yeah, just the basic example,
I'm back next week, I can do it then unless it's urgent
Nw, I'm on it 😉 enjoy your vacation
I think it's a good opportunity to test the principle that new features should be contributed with (at least basic) docs
Ok, lmk if you need help. Remember it should be a multi-lang page/example or if that's not applicable, the applicable languages should be called out in the page (there are some examples of this already). Ping me if you need more info.
We already have an example from the blog post so that should help
For what it's worth, the blog post examples are a great introduction.
I have opened the issue: https://github.com/dagger/dagger/issues/7922
Thank you @shrewd belfry for the uv example, I've included that to better illustrate.
GitHub
What are you trying to do? This request was inspired by the addition of Enum support in 0.12. @dagger.enum_type class Severity(dagger.Enum): """Vulnerability severity levels"&qu...