Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Improve validation errors #294

Open
gmpinder opened this issue Dec 11, 2024 · 0 comments · May be fixed by #295
Open

fix: Improve validation errors #294

gmpinder opened this issue Dec 11, 2024 · 0 comments · May be fixed by #295
Assignees
Labels
priority: critical Should be done as soon as possible type: fix Iterations on existing features or infrastructure.

Comments

@gmpinder
Copy link
Member

Currently the validation errors are very confusing to the users as it shows too many at once when it comes to validating the modules:

  × Recipe recipes/recipe-toybox.yml failed to validate
  ╰─▶ 
        × 11 errors encountered
          ╭─[./recipes/recipe-common.yml:79:9]
       78 │       # Add these Gnome extentions
       79 │ ╭─▶   - type: gnome-extensions
          · │             ────────┬───────
          · │                     ╰─┤ - "default-flatpaks" was expected
          · │                       │ - "gschema-overrides" was expected
          · │                       │ - "copy" was expected
          · │                       │ - "containerfile" was expected
          · │                       │ - "rpm-ostree" was expected
          · │                       │ - "yafti" was expected
          · │                       │ - "akmods" was expected
          · │                       │ - "script" was expected
          · │                       │ - "brew" was expected
       80 │ │       install:
       82 │ │         - Dash to Dock
          · │           ──────┬─────
          · │                 ╰─┤ - "negativo17" was expected
          · │                   │ - "ublue-update" was expected
          · │                   │ - "gnome-vrr" was expected
          · │                   │ - "1password" was expected
          · │                   │ - "dconf-update-service" was expected
          · │                   │ - "rpmfusion" was expected

image

image

This fix should try to analyze when the errors are in the module list and try to look to see if it matches with a particular type. The type property is a const in each module definition (except for external source: modules). So we should be able to check for the lack of an error for the const type and then filter out all extra errors that come from the schemas of non-matching types. This should leave us with the actual error and subsequently make the errors more useful to the user.

@gmpinder gmpinder added type: fix Iterations on existing features or infrastructure. priority: critical Should be done as soon as possible labels Dec 11, 2024
@gmpinder gmpinder self-assigned this Dec 11, 2024
@gmpinder gmpinder linked a pull request Dec 12, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: critical Should be done as soon as possible type: fix Iterations on existing features or infrastructure.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant