Skip to content

✨ Introduce dagger-cue verify command #2331

Closed

Description

@marcosnils

What are you trying to do?

Since we have some custom dagger-cue logic to validate the plan correctness, just doing a simple cue eval might not be enough to make sure that our plans are correct. We also don't want users to install the CUE binary in order to validate that they're plans are actually runnable. This helps in the case where you're refactoring things and making changes that don't actually require any action to be executed each time.

This would be analogous the compilation steps in compiled languages. In the context of developing my plan, I would probably want to just verify the plan and not just one particular run of one particular action. I just want to know if my plan "compiles".

Proposal

dagger-cue verify: verifies the plan in the CWD
dagger-cue verify -p plan.cue: verifies the plan according to the specified path

If plan validates successfully, command exists with status code 0 and without output. On the contrary, command exits with status code 1 and showing the corresponding error through stderr

Ref: Discord initial discussion https://discord.com/channels/707636530424053791/796905486145683506/968920497461018624

cc @dagger/maintainers thoughts? ideas?

Why is this important to you?

To have fast iteration loops and feedback while writing my plan. I could also potentially run dagger-cue verify each time I save the file in my editor to get immediate feedback

How are you currently working around this?

Forcing dagger-cue to execute a #Nop action which triggers plan validation.

Activity

  1. NotTheEconomist commented on Apr 27, 2022

    @NotTheEconomist
    Contributor

    +1. In addition to "doing a simple cue eval might not be enough" -- we should not require that Dagger users install the cue binary.

    Recommend a dagger verify --fmt option that additionally runs cue fmt on the plan file. This could be used down the road for IDE integrations.

  2. shykes commented on Apr 27, 2022

    @shykes
    Contributor

    This is very needed, and can we PLEASE add a check for #493 ... For now this is a "wontfix" from upstream CUE and it's easily in my top 3 most painful bugs right now. All it takes is a typo in an imported definition name... and I'll be wasting 30mn of my time, or more, on a wild goose chase trying to understand why my plan isn't working. I bet many developers hit this problem every day without even realizing it - since they have no idea what's wrong. I wouldn't be surprised if people had given up on Dagger altogether because of it. It's just that bad.

  3. aluzzardi commented on Apr 27, 2022

    @aluzzardi
    Contributor

    I think this would be super helpful.

    In terms of command/functionality, I think the following are needed (or at least, were requested at some point or another):

    • verify the plan is correct
    • eval the plan (e.g. cue eval without cue)
    • plan the plan: show the list of actions and their dependencies. I don't think we're tracking this but to me it would be super useful to debug. UPDATE: Logged as dagger plan command #2335
    • lint the plan Linter for Package Coding Style #2167
    • fmt the plan

    Now I'm wondering which of these could be combined.

    Of those, I think verify is the one that doesn't necessarily warrant its own command, could be combined with another (e.g. dagger lint? dagger eval? dagger plan?)

    Edit: @marcosnils btw, today you kinda can get what you want with dagger do --help which as a side effect will load the entire plan (to display the list of available actions).

  4. changed the title [-]✨ Introduce dagger verify command[/-] [+]✨ Introduce dagger-cue verify command[/+] on Nov 15, 2022
  5. added and removed
    area/cli
    on Nov 15, 2022
  6. marcosnils commented on Dec 21, 2022

    @marcosnils
    ContributorAuthor

    I'll resolve this since we have dagger-cue --dry-run now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions