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

Structured validation errors #342

Open
jsoriano opened this issue May 23, 2022 · 0 comments
Open

Structured validation errors #342

jsoriano opened this issue May 23, 2022 · 0 comments
Labels
Team:Ecosystem Label for the Packages Ecosystem team

Comments

@jsoriano
Copy link
Member

jsoriano commented May 23, 2022

Validation functions return all-or-nothing errors, this makes difficult to introduce different levels of errors (as warnings/fatals), or to distinguish between types of errors (as limits-related, vs. file-structure-related).

Structured errors can be the founding of different validation modes (#313), and would allow to define warning-level validations (as the ones proposed in #318, #317, #316, #341 (comment)...).

In general it would allow to optionally disable checks per package.

The structure could be something as:

  • Error level (a number or an enum like warn/error/fatal...).
  • Error type (unique identifier for each error type).
  • Actual wrapped error.

This structure should be serializable as JSON or similar, so these errors can be easily consumed in other languages or through APIs. Something like this was requested in #285 (comment).

They should be also easily consumable by CI jobs, so warnings can be shown in jenkins reports or github comments, as mentioned in elastic/integrations#3829 (comment).

Take into account final error messages: elastic/elastic-package#994.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Ecosystem Label for the Packages Ecosystem team
Projects
None yet
Development

No branches or pull requests

2 participants